12 #ifndef CTKEVENTDEFINITIONS_H 13 #define CTKEVENTDEFINITIONS_H 21 #include <QStringList> 24 #include <QThreadPool> 28 #include "org_commontk_eventbus_Export.h" 32 #define TOPIC "event.topics" 33 #define TYPE "EventType" 34 #define SIGTYPE "SignatureType" 35 #define OBJECT "ObjectPointer" 36 #define SIGNATURE "Signature" 40 #define ctkRegisterLocalSignal(topic, sender, signature) \ 42 ctkBusEvent *properties = new ctkBusEvent(topic, ctkEventBus::ctkEventTypeLocal, ctkEventBus::ctkSignatureTypeSignal, static_cast<QObject*>(sender), signature); \ 43 bool ok = ctkEventBus::ctkEventBusManager::instance()->addEventProperty(*properties);\ 45 qWarning("%s", tr("Some problem occourred during the signal registration with ID '%1'.").arg(topic).toLatin1().data());\ 46 if(properties) {delete properties; properties = NULL;} \ 50 #define ctkRegisterRemoteSignal(topic, sender, signature) \ 52 ctkBusEvent *properties = new ctkBusEvent(topic, ctkEventBus::ctkEventTypeRemote, ctkEventBus::ctkSignatureTypeSignal, static_cast<QObject*>(sender), signature); \ 53 bool ok = ctkEventBus::ctkEventBusManager::instance()->addEventProperty(*properties);\ 55 qWarning("%s", tr("Some problem occourred during the signal registration with ID '%1'.").arg(topic).toLatin1().data());\ 56 if(properties) {delete properties; properties = NULL;} \ 60 #define ctkRegisterLocalCallback(topic, observer, signature) \ 62 ctkBusEvent *properties = new ctkBusEvent(topic, ctkEventBus::ctkEventTypeLocal, ctkEventBus::ctkSignatureTypeCallback, static_cast<QObject*>(observer), signature); \ 63 bool ok = ctkEventBus::ctkEventBusManager::instance()->addEventProperty(*properties);\ 65 qWarning("%s", tr("Some problem occourred during the callback registration with ID '%1'.").arg(topic).toLatin1().data());\ 66 if(properties) {delete properties; properties = NULL;} \ 70 #define ctkRegisterRemoteCallback(topic, sender, signature) \ 72 ctkBusEvent *properties = new ctkBusEvent(topic, ctkEventBus::ctkEventTypeRemote, ctkEventBus::ctkSignatureTypeCallback, static_cast<QObject*>(sender), signature); \ 73 bool ok = ctkEventBus::ctkEventBusManager::instance()->addEventProperty(*properties);\ 75 qWarning("%s", tr("Some problem occourred during the callback registration with ID '%1'.").arg(topic).toLatin1().data());\ 76 if(properties) {delete properties; properties = NULL;} \ 106 #define ctkEventArgument(type, data) QArgument<type >(#type, data) 107 #define ctkGenericReturnArgument QGenericReturnArgument 108 #define ctkEventReturnArgument(type, data) QReturnArgument<type >(#type, data) 126 #endif // CTKEVENTDEFINITIONS_H ctkEventArgumentsList * ctkEventArgumentsListPointer
Q_DECLARE_METATYPE(ctkEventBus::ctkEventArgumentsListPointer)
QMap< QString, QList< QVariant::Type > > mafRegisterMethodsMap
map which represent list of function to be registered in the server, with parameters
QHash< QString, ctkNetworkConnector * > ctkNetworkConnectorHash
Hash table that associate the communication protocol with the corresponding network connector class (...
QHash< QString, ctkBusEvent * > ctkEventsHashType
Types definitions for events' hash (to be more readable).
QHash< QString, QVariant > ctkEventHash
typedef that represents dictionary entries ( key , value )
QList< QGenericArgument > ctkEventArgumentsList
List of the arguments to be sent through the event bus.
QList< ctkBusEvent * > ctkEventItemListType
type definition for observers' properties list to be stored into the event's hash.