CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Namespaces | Macros | Typedefs | Enumerations | Functions
ctkEventDefinitions.h File Reference
#include <QByteArray>
#include <QList>
#include <QMap>
#include <QVariant>
#include <QString>
#include <QStringList>
#include <QHash>
#include <QThread>
#include <QThreadPool>
#include <QObject>
#include <QDebug>
#include "org_commontk_eventbus_Export.h"
Include dependency graph for ctkEventDefinitions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 ctkEventBus
 

Macros

#define ctkEventArgument(type, data)   QArgument<type >(#type, data)
 
#define ctkEventReturnArgument(type, data)   QReturnArgument<type >(#type, data)
 
#define ctkGenericReturnArgument   QGenericReturnArgument
 
#define ctkRegisterLocalCallback(topic, observer, signature)
 
#define ctkRegisterLocalSignal(topic, sender, signature)
 
#define ctkRegisterRemoteCallback(topic, sender, signature)
 
#define ctkRegisterRemoteSignal(topic, sender, signature)
 
#define OBJECT   "ObjectPointer"
 
#define SIGNATURE   "Signature"
 
#define SIGTYPE   "SignatureType"
 
#define TOPIC   "event.topics"
 
#define TYPE   "EventType"
 

Typedefs

typedef QList< QGenericArgument > ctkEventBus::ctkEventArgumentsList
 List of the arguments to be sent through the event bus. More...
 
typedef ctkEventArgumentsList * ctkEventBus::ctkEventArgumentsListPointer
 
typedef QHash< QString, QVariant > ctkEventBus::ctkEventHash
 typedef that represents dictionary entries ( key , value ) More...
 
typedef QList< ctkBusEvent * > ctkEventBus::ctkEventItemListType
 type definition for observers' properties list to be stored into the event's hash. More...
 
typedef QHash< QString, ctkBusEvent * > ctkEventBus::ctkEventsHashType
 Types definitions for events' hash (to be more readable). More...
 
typedef QHash< QString, ctkNetworkConnector * > ctkEventBus::ctkNetworkConnectorHash
 Hash table that associate the communication protocol with the corresponding network connector class (Eg. XMLRPC, ctkEventBus::ctkNetworkConnectorQXMLRPC) More...
 
typedef QMap< QString, QList< QVariant::Type > > ctkEventBus::mafRegisterMethodsMap
 map which represent list of function to be registered in the server, with parameters More...
 

Enumerations

enum  ctkEventBus::ctkEventType { ctkEventBus::ctkEventTypeLocal , ctkEventBus::ctkEventTypeRemote }
 
enum  ctkEventBus::ctkSignatureType { ctkEventBus::ctkSignatureTypeSignal = 0 , ctkEventBus::ctkSignatureTypeCallback = 1 }
 

Functions

 Q_DECLARE_METATYPE (ctkEventBus::ctkEventArgumentsListPointer)
 
 Q_DECLARE_METATYPE (ctkEventBus::mafRegisterMethodsMap)
 

Macro Definition Documentation

◆ ctkEventArgument

#define ctkEventArgument (   type,
  data 
)    QArgument<type >(#type, data)

Definition at line 106 of file ctkEventDefinitions.h.

◆ ctkEventReturnArgument

#define ctkEventReturnArgument (   type,
  data 
)    QReturnArgument<type >(#type, data)

Definition at line 108 of file ctkEventDefinitions.h.

◆ ctkGenericReturnArgument

#define ctkGenericReturnArgument   QGenericReturnArgument

Definition at line 107 of file ctkEventDefinitions.h.

◆ ctkRegisterLocalCallback

#define ctkRegisterLocalCallback (   topic,
  observer,
  signature 
)
Value:
{\
ctkBusEvent *properties = new ctkBusEvent(topic, ctkEventBus::ctkEventTypeLocal, ctkEventBus::ctkSignatureTypeCallback, static_cast<QObject*>(observer), signature); \
if(!ok) {\
qWarning("%s", tr("Some problem occourred during the callback registration with ID '%1'.").arg(topic).toLatin1().data());\
if(properties) {delete properties; properties = NULL;} \
}\
}
bool addEventProperty(ctkBusEvent &props) const
Add a new event property (observer or event) to the event bus hash.
static ctkEventBusManager * instance()
Return an instance of the event bus.

Definition at line 60 of file ctkEventDefinitions.h.

◆ ctkRegisterLocalSignal

#define ctkRegisterLocalSignal (   topic,
  sender,
  signature 
)
Value:
{\
ctkBusEvent *properties = new ctkBusEvent(topic, ctkEventBus::ctkEventTypeLocal, ctkEventBus::ctkSignatureTypeSignal, static_cast<QObject*>(sender), signature); \
if(!ok) {\
qWarning("%s", tr("Some problem occourred during the signal registration with ID '%1'.").arg(topic).toLatin1().data());\
if(properties) {delete properties; properties = NULL;} \
}\
}

Definition at line 40 of file ctkEventDefinitions.h.

◆ ctkRegisterRemoteCallback

#define ctkRegisterRemoteCallback (   topic,
  sender,
  signature 
)
Value:
{\
ctkBusEvent *properties = new ctkBusEvent(topic, ctkEventBus::ctkEventTypeRemote, ctkEventBus::ctkSignatureTypeCallback, static_cast<QObject*>(sender), signature); \
if(!ok) {\
qWarning("%s", tr("Some problem occourred during the callback registration with ID '%1'.").arg(topic).toLatin1().data());\
if(properties) {delete properties; properties = NULL;} \
}\
}

Definition at line 70 of file ctkEventDefinitions.h.

◆ ctkRegisterRemoteSignal

#define ctkRegisterRemoteSignal (   topic,
  sender,
  signature 
)
Value:
{\
ctkBusEvent *properties = new ctkBusEvent(topic, ctkEventBus::ctkEventTypeRemote, ctkEventBus::ctkSignatureTypeSignal, static_cast<QObject*>(sender), signature); \
if(!ok) {\
qWarning("%s", tr("Some problem occourred during the signal registration with ID '%1'.").arg(topic).toLatin1().data());\
if(properties) {delete properties; properties = NULL;} \
}\
}

Definition at line 50 of file ctkEventDefinitions.h.

◆ OBJECT

#define OBJECT   "ObjectPointer"

Definition at line 35 of file ctkEventDefinitions.h.

◆ SIGNATURE

#define SIGNATURE   "Signature"

Definition at line 36 of file ctkEventDefinitions.h.

◆ SIGTYPE

#define SIGTYPE   "SignatureType"

Definition at line 34 of file ctkEventDefinitions.h.

◆ TOPIC

#define TOPIC   "event.topics"

Definition at line 32 of file ctkEventDefinitions.h.

◆ TYPE

#define TYPE   "EventType"

Definition at line 33 of file ctkEventDefinitions.h.

Function Documentation

◆ Q_DECLARE_METATYPE() [1/2]

◆ Q_DECLARE_METATYPE() [2/2]

Q_DECLARE_METATYPE ( ctkEventBus::mafRegisterMethodsMap  )