![]() |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
#include <Plugins/org.commontk.eventbus/ctkEventBusManager.h>
Public Slots | |
void | detachObjectFromBus () |
Intercepts objects deletation and detach them from the event bus. More... | |
Public Member Functions | |
bool | addEventProperty (ctkBusEvent &props) const |
Add a new event property (observer or event) to the event bus hash. More... | |
bool | createClient (const QString &communication_protocol, const QString &server_host, unsigned int port) |
Create the client for remote communication according to the given protocol, server host and port. More... | |
bool | createServer (const QString &communication_protocol, unsigned int listen_port) |
Create the server for remote communication according to the given protocol and listen port. More... | |
void | enableEventLogging (bool enable=true) |
Enable/Disable event logging to allow dumping events notification into the selected logging output stream. More... | |
void | initializeNetworkConnectors () |
initialize NetworkConnectors More... | |
bool | isLocalSignalPresent (const QString topic) const |
Retrieve if the signal has been registered previously. More... | |
void | logAllEvents () |
When enabled, allows logging all events. It reset the value for m_LogEventId to -1 (the default) More... | |
void | logEventTopic (const QString topic) |
When logging is enabled, allows logging events releted to specific id (require a valid topic). More... | |
void | notifyEvent (const QString topic, ctkEventType ev_type=ctkEventTypeLocal, ctkEventArgumentsList *argList=NULL, QGenericReturnArgument *returnArg=NULL) const |
Notify event associated to the given id locally to the application. More... | |
void | notifyEvent (ctkBusEvent &event_dictionary, ctkEventArgumentsList *argList=NULL, QGenericReturnArgument *returnArg=NULL) const |
Notify events associated to the given id locally to the application. More... | |
void | plugNetworkConnector (const QString &protocol, ctkNetworkConnector *connector) |
Plug a new network connector into the connector hash for the given network protocol (protocol eg. "XMLRPC") (connector_type eg. "ctkEventBus::ctkNetworkConnectorQXMLRPC"). More... | |
bool | removeEventProperty (ctkBusEvent &props) const |
Remove the event property from the event bus hash. More... | |
void | removeObserver (const QObject *obj, const QString topic="", bool qt_disconnect=true) |
Remove the object passed as argument from the observer's hash. More... | |
void | removeSignal (const QObject *obj, QString topic="", bool qt_disconnect=true) |
Remove the object passed as argument from the signal emitter's hash. More... | |
void | shutdown () |
Destroy the singleton instance. To be called at the end of the application. More... | |
void | startListen () |
Allow to start server listening. More... | |
Static Public Member Functions | |
static ctkEventBusManager * | instance () |
Return an instance of the event bus. More... | |
Class name: ctkEventBusManager This singletone provides the access point of the Communication Bus for MAF3 framework. ctkEventBusManager defines also the mafId maf.local.eventBus.globalUpdate to be used as generic update notification mechanism that the event bus can send to all the observers.
Definition at line 30 of file ctkEventBusManager.h.
bool ctkEventBus::ctkEventBusManager::addEventProperty | ( | ctkBusEvent & | props | ) | const |
Add a new event property (observer or event) to the event bus hash.
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.
bool ctkEventBus::ctkEventBusManager::createClient | ( | const QString & | communication_protocol, |
const QString & | server_host, | ||
unsigned int | port | ||
) |
Create the client for remote communication according to the given protocol, server host and port.
bool ctkEventBus::ctkEventBusManager::createServer | ( | const QString & | communication_protocol, |
unsigned int | listen_port | ||
) |
Create the server for remote communication according to the given protocol and listen port.
|
slot |
Intercepts objects deletation and detach them from the event bus.
void ctkEventBus::ctkEventBusManager::enableEventLogging | ( | bool | enable = true | ) |
Enable/Disable event logging to allow dumping events notification into the selected logging output stream.
void ctkEventBus::ctkEventBusManager::initializeNetworkConnectors | ( | ) |
initialize NetworkConnectors
|
static |
Return an instance of the event bus.
bool ctkEventBus::ctkEventBusManager::isLocalSignalPresent | ( | const QString | topic | ) | const |
Retrieve if the signal has been registered previously.
void ctkEventBus::ctkEventBusManager::logAllEvents | ( | ) |
When enabled, allows logging all events. It reset the value for m_LogEventId to -1 (the default)
void ctkEventBus::ctkEventBusManager::logEventTopic | ( | const QString | topic | ) |
When logging is enabled, allows logging events releted to specific id (require a valid topic).
void ctkEventBus::ctkEventBusManager::notifyEvent | ( | const QString | topic, |
ctkEventType | ev_type = ctkEventTypeLocal , |
||
ctkEventArgumentsList * | argList = NULL , |
||
QGenericReturnArgument * | returnArg = NULL |
||
) | const |
Notify event associated to the given id locally to the application.
void ctkEventBus::ctkEventBusManager::notifyEvent | ( | ctkBusEvent & | event_dictionary, |
ctkEventArgumentsList * | argList = NULL , |
||
QGenericReturnArgument * | returnArg = NULL |
||
) | const |
Notify events associated to the given id locally to the application.
void ctkEventBus::ctkEventBusManager::plugNetworkConnector | ( | const QString & | protocol, |
ctkNetworkConnector * | connector | ||
) |
Plug a new network connector into the connector hash for the given network protocol (protocol eg. "XMLRPC") (connector_type eg. "ctkEventBus::ctkNetworkConnectorQXMLRPC").
bool ctkEventBus::ctkEventBusManager::removeEventProperty | ( | ctkBusEvent & | props | ) | const |
Remove the event property from the event bus hash.
void ctkEventBus::ctkEventBusManager::removeObserver | ( | const QObject * | obj, |
const QString | topic = "" , |
||
bool | qt_disconnect = true |
||
) |
Remove the object passed as argument from the observer's hash.
This method allows to remove from the observer's hash the object passed as argument. If no topic is specified, the observer will be removed from all the topic it was listening, otherwise it will be disconnected only from the given topic.
void ctkEventBus::ctkEventBusManager::removeSignal | ( | const QObject * | obj, |
QString | topic = "" , |
||
bool | qt_disconnect = true |
||
) |
Remove the object passed as argument from the signal emitter's hash.
This method allows to remove from the signal emitter's hash the object passed as argument. If no topic is specified, the emitter will be removed from all the topic it was emitting signals, otherwise it will be removed only from the given topic.
void ctkEventBus::ctkEventBusManager::shutdown | ( | ) |
Destroy the singleton instance. To be called at the end of the application.
void ctkEventBus::ctkEventBusManager::startListen | ( | ) |
Allow to start server listening.