CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkNetworkConnector.h
Go to the documentation of this file.
1 /*
2  * ctkNetworkConnector.h
3  * ctkEventBus
4  *
5  * Created by Daniele Giunchi on 11/04/10.
6  * Copyright 2009 B3C. All rights reserved.
7  *
8  * See Licence at: http://tiny.cc/QXJ4D
9  *
10  */
11 
12 #ifndef CTKNETWORKCONNECTOR_H
13 #define CTKNETWORKCONNECTOR_H
14 
15 //include list
16 #include "ctkEventDefinitions.h"
17 
18 namespace ctkEventBus {
19 
24 class org_commontk_eventbus_EXPORT ctkNetworkConnector : public QObject {
25  Q_OBJECT
26 
27  Q_PROPERTY(QString protocol READ protocol);
28 
29 public:
32 
34  virtual void createClient(const QString hostName, const unsigned int port) = 0;
35 
37  virtual void createServer(const unsigned int port) = 0;
38 
40  virtual void startListen() = 0;
41 
43  virtual void send(const QString event_id, ctkEventArgumentsList *argList) = 0;
44 
46  virtual ctkNetworkConnector *clone() = 0;
47 
49  QString protocol();
50 
52  virtual void initializeForEventBus() = 0;
53 
54 Q_SIGNALS:
56  void remoteCommunication(const QString event_id, ctkEventArgumentsList *argList);
57 
58 protected:
59  QString m_Protocol;
60 };
61 
62 } //namespace ctkEventBus
63 
64 #endif // CTKNETWORKCONNECTOR_H
virtual void initializeForEventBus()=0
register all the signals and slots
void remoteCommunication(const QString event_id, ctkEventArgumentsList *argList)
signal for send a message to through network
ctkNetworkConnector()
object constructor.
QString m_Protocol
define the protocol of the connector (xmlrpc, soap, etc...)
virtual void startListen()=0
Start the server.
virtual ctkNetworkConnector * clone()=0
retrieve an instance of the object
virtual void createClient(const QString hostName, const unsigned int port)=0
create the unique instance of the client.
virtual void createServer(const unsigned int port)=0
create the unique instance of the server.
QString protocol()
retrieve the protocol type of the connector
virtual void send(const QString event_id, ctkEventArgumentsList *argList)=0
Allow to send a network request.