 |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
Go to the documentation of this file.
12 #ifndef CTKEVENTBUSMANAGER_H
13 #define CTKEVENTBUSMANAGER_H
49 void removeObserver(
const QObject *obj,
const QString topic =
"",
bool qt_disconnect =
true);
55 void removeSignal(
const QObject *obj, QString topic =
"",
bool qt_disconnect =
true);
85 bool createServer(
const QString &communication_protocol,
unsigned int listen_port);
91 bool createClient(
const QString &communication_protocol,
const QString &server_host,
unsigned int port);
107 bool m_EnableEventLogging;
108 QString m_LogEventTopic;
117 #endif // CTKEVENTBUSMANAGER
void removeObserver(const QObject *obj, const QString topic="", bool qt_disconnect=true)
Remove the object passed as argument from the observer's hash.
void logEventTopic(const QString topic)
When logging is enabled, allows logging events releted to specific id (require a valid topic).
bool isLocalSignalPresent(const QString topic) const
Retrieve if the signal has been registered previously.
void shutdown()
Destroy the singleton instance. To be called at the end of the application.
static ctkEventBusManager * instance()
Return an instance of the event bus.
void initializeNetworkConnectors()
initialize NetworkConnectors
#define ctkGenericReturnArgument
bool removeEventProperty(ctkBusEvent &props) const
Remove the event property from the event bus hash.
void detachObjectFromBus()
Intercepts objects deletation and detach them from the event bus.
void enableEventLogging(bool enable=true)
Enable/Disable event logging to allow dumping events notification into the selected logging output st...
void plugNetworkConnector(const QString &protocol, ctkNetworkConnector *connector)
Plug a new network connector into the connector hash for the given network protocol (protocol eg....
bool createServer(const QString &communication_protocol, unsigned int listen_port)
Create the server for remote communication according to the given protocol and listen port.
bool addEventProperty(ctkBusEvent &props) const
Add a new event property (observer or event) to the event bus hash.
void logAllEvents()
When enabled, allows logging all events. It reset the value for m_LogEventId to -1 (the default)
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.
void removeSignal(const QObject *obj, QString topic="", bool qt_disconnect=true)
Remove the object passed as argument from the signal emitter's hash.
void startListen()
Allow to start server listening.
void notifyEvent(ctkBusEvent &event_dictionary, ctkEventArgumentsList *argList=NULL, QGenericReturnArgument *returnArg=NULL) const
Notify events associated to the given id locally to the application.
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.