SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Event dispatching in MAF v3
Summary
Why creating an event bus?
Event Bus inside MAF3 Architecture
Characteristics
How register a signal and a callback
Local vs Remote Dispatching.
2
Event Bus - Reasons
Communication between modules
Independency between modules
Need of flexibility
3
MAF3 Architecture
4
Communication
There are several types of communication:
Publish-Subscribe: Modules may subscribe to certain
message types. Whenever a module publishes a message
to the bus, it will be delivered to all modules that
subscribed to its message type.
Broadcast: The message will be delivered to all (other)
modules.
Point-to-point: The message has one and only one
recipient.
5
Examples of Event Bus
Enterprise Service Bus:
6
D-Bus
Mbus
http://www.mbus.org/
Signal/Slot
7
Characteristics
mafEventBus is based on Signal/Slot connecting
mechanism implemented in Qt.
Extends the Qt mechanism to allow connection also at
run-time without to include the class that define the signal
with which the connection has to be established.
Can manage local to the application or remote events
through mafEventDispatcher exchanging event
information written into the mafEvent token.
Remote connection can be managed with different
extensible protocols through mafNetworkConnector.
Event filtering by topic.
Independent from mafCore.
Patterns involved
Façade
The class mafEventBusManager allows to access all
the functionalities of event emit and observe
registration/notification.
Observer
An event must be registered with its Topic as
signal or callback without a specific order.
A topic represents an unique string associated with
one signal.
Event Topic Taxonomy
1023
maf.local.resources.viewManager.create
Reverse DNS notation:
How it works (Basic)
Register in the Bus any Signal Emitter.
Register in the Bus any Callback associating it
to a particular Topic to observe.
Notify through the Bus an event (local or
remote) to update all the observers (with or
without arguments and return values)
Only QObjects (or inherited class) can be a
signal emitter or observer due to the
signal/slot mechanism used into the bus.
Register
Signal
Attach the
Observer/s
Notify
Events
How It Works (Remote side)
Remote notification are achieved by asking the
bus module to create a client for the given
remote communication protocol: “XMLRPC”,
“SOAP”…
Network protocols are extensible through the
plug of new mafNetworkConnector into the
mafEventBusManager:
plugNetworkConnector("SOAP", new mafNetworkConnectorQtSoap());
All these steps are accessible through the
mafEventBusManager façade class.
mafEvent
Class for storing information into a QHash.
Into the hash stores keys and values related to the
event to be notified.
Define some API to simplify the access of the event
information stored into the hash.
Signal Emitter
Register as a signal emitter:
Create a Qt Signal inside the class header used as a
signal emitter.
Define a string topic to associate to a signal.
Register to the Event Bus as emitter using the
mafRegisterLocalSignal or
mafRegisterRemoteSignal macros or giving to the
mafEventBusManager (through the call of
addEventProperty method) the mafEvent filled with
proper information.
Register as Signal Emitter
In your .h file define the signal:
...
signals:
void loadPluginLibrary(const mafString &pluginFilename);
...
… then in .cpp create the topic and register the
signal into the Event Bus:
mafString load_library_topic =
“maf.local.resources.pluginManager.loadPlugin”;
mafRegisterLocalSignal(load_library_topic, this,
"loadPluginLibrary(const mafString &)");
Observer
Register as Observer:
Define a Qt slot into the class that wants to become an
observer.
Register that slot in the bus associating it with a Signal
through the predefined topic through the macro
mafRegisterLocalCallback or giving to the
mafEventBusManager (through the call of
addEventProperty method) the mafEvent filled with
proper information.
Register as Observer
In your .h file define the slot:
public slots:
/// Loads a plugin
void loadPlugin(const mafString &pluginFilename);
… then in .cpp register it into the Event Bus:
mafRegisterLocalCallback(“maf.local.resources.pluginManager.loadPlugi
n”, this, "loadPlugin(const mafString &)");
Notify an Event
Event Notification can be done in three different way:
No Arguments and No Return Value
With Arguments and No Return Value
With Arguments and With Return Value
Notification with
No Argument and No return value
Get the mafEventBusManager instance:
mafEventBusManager *m_EventBus = mafEventBusManager::instance();
Send the notification for a given topic:
m_EventBus->notifyEvent("maf.local.eventBus.globalUpdate");
Notification with
Arguments and No Return Value
Create the list of arguments to send through the
notification:
mafEventArgumentsList arglist;
mafEventGenericArgument value = mafEventArgument(int, 35)
arglist.append(value);
Notify the event associated to the topic:
m_EventBus->notifyEvent("maf.local.myTopic", mafEventTypeLocal,
&arglist);
Notification with
Arguments and Return Value
Create the list of argument (as before)
Create the placeholder for the Return Value
(here is show an ‘int’ return value):
mafEventArgumentsList arglist;
mafEventGenericArgument value = mafEventArgument(int, 35)
arglist.append(value);
int returnValue = 0;
Notify the event associated to the topic. The
return value will be present into the variable
after the call:
mafGenericReturnArgument ret_val =
mafEventReturnArgument(int,returnValue);
m_EventBus->notifyEvent("maf.local.myTopic", mafEventTypeLocal,
&arglist, &ret_val);
Remote Notification
Same as the three cases shown in the slides before,
but instead of mafEventTypeLocal, use
mafEventTypeRemote.
mafEventDispatcherRemote will be in charge of
dispatching those events through the
mafNetworkConnector.
Remote Notification
Remote Event Pack
The local call needs the flag mafEventTypeRemote
and a list of parameters containing:
information on the topic to be called by the remote
application on its Event Bus (called remote event
parameters)
related optional parameters (called remote data
parameters)
Remote Event Unpack
Remote application receive the list of parameters (Event
and Data Parameters).
Extract from the Event Parameter the ID to be called
locally.
Extract the Data Parameters to build the local Arguments
list for the new event.
Return to the caller application the connection result: Fail
or Ok which will cause the notification of the two related
events:
maf.local.eventBus.remoteCommunicationFailed
and
maf.local.eventBus.remoteCommunicationDone
References
MAF http://www.openmaf.org
Qt http://qt.nokia.com
Design Pattern http://sourcemaking.com/design_patterns
Thank You
Authors
Paolo Quadrani: p.quadrani@scsolutions.it
Daniele Giunchi: d.giunchi@scsolutions.it
Roberto Mucci: r.mucci@cineca.it

Weitere ähnliche Inhalte

Ähnlich wie Event Dispatching in MAF v3: How to Register Signals and Callbacks

Azure Service Bus Performance Checklist
Azure Service Bus Performance ChecklistAzure Service Bus Performance Checklist
Azure Service Bus Performance ChecklistSalim M Bhonhariya
 
Iot hub agent
Iot hub agentIot hub agent
Iot hub agentrtfmpliz1
 
Observer design pattern
Observer design patternObserver design pattern
Observer design patternSameer Rathoud
 
INTERNET OF THINGS & AZURE
INTERNET OF THINGS & AZUREINTERNET OF THINGS & AZURE
INTERNET OF THINGS & AZUREDotNetCampus
 
Estendere applicazioni extbase
Estendere applicazioni extbaseEstendere applicazioni extbase
Estendere applicazioni extbaseCristian Buja
 
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...VMware Tanzu
 
WiMAX implementation in ns3
WiMAX implementation in ns3WiMAX implementation in ns3
WiMAX implementation in ns3Mustafa Khaleel
 
Ibm mq with c# sending and receiving messages
Ibm mq with c# sending and receiving messagesIbm mq with c# sending and receiving messages
Ibm mq with c# sending and receiving messagesShreesha Rao
 
quickguide-einnovator-3-rabbitmq
quickguide-einnovator-3-rabbitmqquickguide-einnovator-3-rabbitmq
quickguide-einnovator-3-rabbitmqjorgesimao71
 
MPI Introduction
MPI IntroductionMPI Introduction
MPI IntroductionRohit Banga
 
Android development training programme , Day 3
Android development training programme , Day 3Android development training programme , Day 3
Android development training programme , Day 3DHIRAJ PRAVIN
 

Ähnlich wie Event Dispatching in MAF v3: How to Register Signals and Callbacks (20)

Azure Service Bus Performance Checklist
Azure Service Bus Performance ChecklistAzure Service Bus Performance Checklist
Azure Service Bus Performance Checklist
 
mqttvsrest_v4.pdf
mqttvsrest_v4.pdfmqttvsrest_v4.pdf
mqttvsrest_v4.pdf
 
Iot hub agent
Iot hub agentIot hub agent
Iot hub agent
 
SignalR with asp.net
SignalR with asp.netSignalR with asp.net
SignalR with asp.net
 
Vb.net iv
Vb.net ivVb.net iv
Vb.net iv
 
Observer design pattern
Observer design patternObserver design pattern
Observer design pattern
 
INTERNET OF THINGS & AZURE
INTERNET OF THINGS & AZUREINTERNET OF THINGS & AZURE
INTERNET OF THINGS & AZURE
 
KAFKA Quickstart
KAFKA QuickstartKAFKA Quickstart
KAFKA Quickstart
 
Estendere applicazioni extbase
Estendere applicazioni extbaseEstendere applicazioni extbase
Estendere applicazioni extbase
 
Robotlegs Extensions
Robotlegs ExtensionsRobotlegs Extensions
Robotlegs Extensions
 
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
 
WiMAX implementation in ns3
WiMAX implementation in ns3WiMAX implementation in ns3
WiMAX implementation in ns3
 
Ibm mq with c# sending and receiving messages
Ibm mq with c# sending and receiving messagesIbm mq with c# sending and receiving messages
Ibm mq with c# sending and receiving messages
 
GNURAdioDoc-8
GNURAdioDoc-8GNURAdioDoc-8
GNURAdioDoc-8
 
GNURAdioDoc-8
GNURAdioDoc-8GNURAdioDoc-8
GNURAdioDoc-8
 
quickguide-einnovator-3-rabbitmq
quickguide-einnovator-3-rabbitmqquickguide-einnovator-3-rabbitmq
quickguide-einnovator-3-rabbitmq
 
MPI Introduction
MPI IntroductionMPI Introduction
MPI Introduction
 
MPI
MPIMPI
MPI
 
Android development training programme , Day 3
Android development training programme , Day 3Android development training programme , Day 3
Android development training programme , Day 3
 
MPI
MPIMPI
MPI
 

Kürzlich hochgeladen

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Kürzlich hochgeladen (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

Event Dispatching in MAF v3: How to Register Signals and Callbacks

  • 2. Summary Why creating an event bus? Event Bus inside MAF3 Architecture Characteristics How register a signal and a callback Local vs Remote Dispatching. 2
  • 3. Event Bus - Reasons Communication between modules Independency between modules Need of flexibility 3
  • 5. Communication There are several types of communication: Publish-Subscribe: Modules may subscribe to certain message types. Whenever a module publishes a message to the bus, it will be delivered to all modules that subscribed to its message type. Broadcast: The message will be delivered to all (other) modules. Point-to-point: The message has one and only one recipient. 5
  • 6. Examples of Event Bus Enterprise Service Bus: 6 D-Bus Mbus http://www.mbus.org/
  • 8. Characteristics mafEventBus is based on Signal/Slot connecting mechanism implemented in Qt. Extends the Qt mechanism to allow connection also at run-time without to include the class that define the signal with which the connection has to be established. Can manage local to the application or remote events through mafEventDispatcher exchanging event information written into the mafEvent token. Remote connection can be managed with different extensible protocols through mafNetworkConnector. Event filtering by topic. Independent from mafCore.
  • 9. Patterns involved Façade The class mafEventBusManager allows to access all the functionalities of event emit and observe registration/notification. Observer An event must be registered with its Topic as signal or callback without a specific order. A topic represents an unique string associated with one signal.
  • 11. How it works (Basic) Register in the Bus any Signal Emitter. Register in the Bus any Callback associating it to a particular Topic to observe. Notify through the Bus an event (local or remote) to update all the observers (with or without arguments and return values) Only QObjects (or inherited class) can be a signal emitter or observer due to the signal/slot mechanism used into the bus.
  • 13. How It Works (Remote side) Remote notification are achieved by asking the bus module to create a client for the given remote communication protocol: “XMLRPC”, “SOAP”… Network protocols are extensible through the plug of new mafNetworkConnector into the mafEventBusManager: plugNetworkConnector("SOAP", new mafNetworkConnectorQtSoap()); All these steps are accessible through the mafEventBusManager façade class.
  • 14. mafEvent Class for storing information into a QHash. Into the hash stores keys and values related to the event to be notified. Define some API to simplify the access of the event information stored into the hash.
  • 15. Signal Emitter Register as a signal emitter: Create a Qt Signal inside the class header used as a signal emitter. Define a string topic to associate to a signal. Register to the Event Bus as emitter using the mafRegisterLocalSignal or mafRegisterRemoteSignal macros or giving to the mafEventBusManager (through the call of addEventProperty method) the mafEvent filled with proper information.
  • 16. Register as Signal Emitter In your .h file define the signal: ... signals: void loadPluginLibrary(const mafString &pluginFilename); ... … then in .cpp create the topic and register the signal into the Event Bus: mafString load_library_topic = “maf.local.resources.pluginManager.loadPlugin”; mafRegisterLocalSignal(load_library_topic, this, "loadPluginLibrary(const mafString &)");
  • 17. Observer Register as Observer: Define a Qt slot into the class that wants to become an observer. Register that slot in the bus associating it with a Signal through the predefined topic through the macro mafRegisterLocalCallback or giving to the mafEventBusManager (through the call of addEventProperty method) the mafEvent filled with proper information.
  • 18. Register as Observer In your .h file define the slot: public slots: /// Loads a plugin void loadPlugin(const mafString &pluginFilename); … then in .cpp register it into the Event Bus: mafRegisterLocalCallback(“maf.local.resources.pluginManager.loadPlugi n”, this, "loadPlugin(const mafString &)");
  • 19. Notify an Event Event Notification can be done in three different way: No Arguments and No Return Value With Arguments and No Return Value With Arguments and With Return Value
  • 20. Notification with No Argument and No return value Get the mafEventBusManager instance: mafEventBusManager *m_EventBus = mafEventBusManager::instance(); Send the notification for a given topic: m_EventBus->notifyEvent("maf.local.eventBus.globalUpdate");
  • 21. Notification with Arguments and No Return Value Create the list of arguments to send through the notification: mafEventArgumentsList arglist; mafEventGenericArgument value = mafEventArgument(int, 35) arglist.append(value); Notify the event associated to the topic: m_EventBus->notifyEvent("maf.local.myTopic", mafEventTypeLocal, &arglist);
  • 22. Notification with Arguments and Return Value Create the list of argument (as before) Create the placeholder for the Return Value (here is show an ‘int’ return value): mafEventArgumentsList arglist; mafEventGenericArgument value = mafEventArgument(int, 35) arglist.append(value); int returnValue = 0; Notify the event associated to the topic. The return value will be present into the variable after the call: mafGenericReturnArgument ret_val = mafEventReturnArgument(int,returnValue); m_EventBus->notifyEvent("maf.local.myTopic", mafEventTypeLocal, &arglist, &ret_val);
  • 23. Remote Notification Same as the three cases shown in the slides before, but instead of mafEventTypeLocal, use mafEventTypeRemote. mafEventDispatcherRemote will be in charge of dispatching those events through the mafNetworkConnector.
  • 25. Remote Event Pack The local call needs the flag mafEventTypeRemote and a list of parameters containing: information on the topic to be called by the remote application on its Event Bus (called remote event parameters) related optional parameters (called remote data parameters)
  • 26. Remote Event Unpack Remote application receive the list of parameters (Event and Data Parameters). Extract from the Event Parameter the ID to be called locally. Extract the Data Parameters to build the local Arguments list for the new event. Return to the caller application the connection result: Fail or Ok which will cause the notification of the two related events: maf.local.eventBus.remoteCommunicationFailed and maf.local.eventBus.remoteCommunicationDone
  • 27. References MAF http://www.openmaf.org Qt http://qt.nokia.com Design Pattern http://sourcemaking.com/design_patterns
  • 28. Thank You Authors Paolo Quadrani: p.quadrani@scsolutions.it Daniele Giunchi: d.giunchi@scsolutions.it Roberto Mucci: r.mucci@cineca.it