CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Signals | Public Member Functions | Protected Member Functions | List of all members
ctkEventBus::ctkEventDispatcher Class Reference

#include <Plugins/org.commontk.eventbus/ctkEventDispatcher.h>

Inheritance diagram for ctkEventBus::ctkEventDispatcher:
Inheritance graph
[legend]
Collaboration diagram for ctkEventBus::ctkEventDispatcher:
Collaboration graph
[legend]

Signals

void notifyDefaultEvent ()
 Default notification signals for default events. More...
 
void remoteCommunicationDone ()
 Signal used to notify to observers that the remote communication has been terminated with success. More...
 
void remoteCommunicationFailed ()
 Signal used to notify to observers that the remote communication failed. More...
 

Public Member Functions

bool addObserver (ctkBusEvent &props)
 Add the observer to the events. More...
 
 ctkEventDispatcher ()
 object constructor. More...
 
bool isLocalSignalPresent (const QString topic) const
 method used to check if the given signal has been already registered for the given id. More...
 
virtual void notifyEvent (ctkBusEvent &event_dictionary, ctkEventArgumentsList *argList=NULL, QGenericReturnArgument *returnArg=NULL) const
 Emit event corresponding to the given id (present into the event_dictionary) locally to the application. More...
 
bool registerSignal (ctkBusEvent &props)
 register custom signals use by objects to raise them events. More...
 
bool removeObserver (const QObject *obj, const QString topic, bool qt_disconnect=true)
 remove the callback from the observer's hash. More...
 
bool removeObserver (ctkBusEvent &props)
 remove the callback from the observer's hash. More...
 
bool removeSignal (const QObject *obj, const QString topic="", bool qt_disconnect=true)
 Remove the signal from the signal's hash. More...
 
bool removeSignal (ctkBusEvent &props)
 Remove the signal from the signal's hash. More...
 
void resetHashes ()
 clean the signal and callback hashes. More...
 
virtual ~ctkEventDispatcher ()
 object destructor. More...
 

Protected Member Functions

virtual void initializeGlobalEvents ()
 Register MAF global events. More...
 
bool removeEventItem (ctkBusEvent &props)
 Interanl method used to remove the given event property. More...
 
ctkEventItemListType signalItemProperty (const QString topic) const
 Return the signal item property associated to the given ID. More...
 

Detailed Description

Class name: ctkEventDispatcher This allows dispatching events coming from local application to attached observers.

Definition at line 23 of file ctkEventDispatcher.h.

Constructor & Destructor Documentation

◆ ctkEventDispatcher()

ctkEventBus::ctkEventDispatcher::ctkEventDispatcher ( )

object constructor.

◆ ~ctkEventDispatcher()

virtual ctkEventBus::ctkEventDispatcher::~ctkEventDispatcher ( )
virtual

object destructor.

Member Function Documentation

◆ addObserver()

bool ctkEventBus::ctkEventDispatcher::addObserver ( ctkBusEvent props)

Add the observer to the events.

Return true if observer has beed added correctly, false otherwise. This method check before adding a new observer that it has not already been inserted into the events' Hash with the same id and callback signature.

◆ initializeGlobalEvents()

virtual void ctkEventBus::ctkEventDispatcher::initializeGlobalEvents ( )
protectedvirtual

Register MAF global events.

Reimplemented in ctkEventBus::ctkEventDispatcherRemote, and ctkEventBus::ctkEventDispatcherLocal.

◆ isLocalSignalPresent()

bool ctkEventBus::ctkEventDispatcher::isLocalSignalPresent ( const QString  topic) const

method used to check if the given signal has been already registered for the given id.

◆ notifyDefaultEvent

void ctkEventBus::ctkEventDispatcher::notifyDefaultEvent ( )
signal

Default notification signals for default events.

◆ notifyEvent()

virtual void ctkEventBus::ctkEventDispatcher::notifyEvent ( ctkBusEvent event_dictionary,
ctkEventArgumentsList argList = NULL,
QGenericReturnArgument *  returnArg = NULL 
) const
virtual

Emit event corresponding to the given id (present into the event_dictionary) locally to the application.

Reimplemented in ctkEventBus::ctkEventDispatcherRemote, and ctkEventBus::ctkEventDispatcherLocal.

◆ registerSignal()

bool ctkEventBus::ctkEventDispatcher::registerSignal ( ctkBusEvent props)

register custom signals use by objects to raise them events.

Return true if signal has beed added correctly, false otherwise. This method check before adding a new signal that it has not already been inserted into the events' Hash with the same id and signal signature. WARNING: due to Qt limitation you cannot use the same signal in different Topics.

◆ remoteCommunicationDone

void ctkEventBus::ctkEventDispatcher::remoteCommunicationDone ( )
signal

Signal used to notify to observers that the remote communication has been terminated with success.

◆ remoteCommunicationFailed

void ctkEventBus::ctkEventDispatcher::remoteCommunicationFailed ( )
signal

Signal used to notify to observers that the remote communication failed.

◆ removeEventItem()

bool ctkEventBus::ctkEventDispatcher::removeEventItem ( ctkBusEvent props)
protected

Interanl method used to remove the given event property.

◆ removeObserver() [1/2]

bool ctkEventBus::ctkEventDispatcher::removeObserver ( const QObject *  obj,
const QString  topic,
bool  qt_disconnect = true 
)

remove the callback from the observer's hash.

◆ removeObserver() [2/2]

bool ctkEventBus::ctkEventDispatcher::removeObserver ( ctkBusEvent props)

remove the callback from the observer's hash.

◆ removeSignal() [1/2]

bool ctkEventBus::ctkEventDispatcher::removeSignal ( const QObject *  obj,
const QString  topic = "",
bool  qt_disconnect = true 
)

Remove the signal from the signal's hash.

◆ removeSignal() [2/2]

bool ctkEventBus::ctkEventDispatcher::removeSignal ( ctkBusEvent props)

Remove the signal from the signal's hash.

◆ resetHashes()

void ctkEventBus::ctkEventDispatcher::resetHashes ( )

clean the signal and callback hashes.

This method is used when the destructor is called. The destructor of the dispatcher is called by the ctkEventBusManager destructor.

◆ signalItemProperty()

ctkEventItemListType ctkEventBus::ctkEventDispatcher::signalItemProperty ( const QString  topic) const
inlineprotected

Return the signal item property associated to the given ID.

Definition at line 107 of file ctkEventDispatcher.h.


The documentation for this class was generated from the following file: