OpenDaVINCI  4.16.0
ClientModule.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_BASE_CLIENTMODULE_H_
21 #define OPENDAVINCI_BASE_CLIENTMODULE_H_
22 
23 #include <string>
24 
26 #include <memory>
32 #include "opendavinci/generated/odcore/data/dmcp/ModuleExitCodeMessage.h"
33 #include "opendavinci/generated/odcore/data/dmcp/ServerInformation.h"
34 
35 namespace odcore {
36  namespace base {
37  namespace module {
38 
39  using namespace std;
40 
49  private:
50  friend class ManagedClientModule;
51 
60  ClientModule(const int32_t &argc, char **argv, const string &name) throw (odcore::exceptions::InvalidArgumentException);
61 
62  private:
68  ClientModule(const ClientModule&);
69 
75  ClientModule& operator=(const ClientModule&);
76 
77  public:
78  virtual ~ClientModule();
79 
80  virtual odcore::data::dmcp::ModuleExitCodeMessage::ModuleExitCode runModule();
81 
87  const string getName() const;
88 
89  protected:
93  virtual void setUp() = 0;
94 
98  virtual void tearDown() = 0;
99 
105  virtual odcore::data::dmcp::ModuleExitCodeMessage::ModuleExitCode body() = 0;
106 
113  const odcore::base::KeyValueConfiguration getKeyValueConfiguration() const;
114 
121  std::shared_ptr<odcore::dmcp::connection::Client>& getDMCPClient();
122 
123  virtual void handleConnectionLost();
124 
128  virtual void DMCPconnectionLost() = 0;
129 
135  virtual odcore::data::dmcp::ModuleExitCodeMessage::ModuleExitCode runModuleImplementation() = 0;
136 
142  const odcore::data::dmcp::ServerInformation getServerInformation() const;
143 
144  private:
145  string m_name;
146  odcore::base::KeyValueConfiguration m_keyValueConfiguration;
147  odcore::data::dmcp::ServerInformation m_serverInformation;
148  std::shared_ptr<odcore::dmcp::connection::Client> m_dmcpClient;
149  };
150 
151  }
152  }
153 } // odcore::base::module
154 
155 #endif /*OPENDAVINCI_BASE_CLIENTMODULE_H_*/
#define OPENDAVINCI_API
Definition: opendavinci.h:67
Definition: AbstractCIDModule.h:42
Definition: ClientModule.h:47
Definition: ManagedClientModule.h:52
Definition: SuperComponentStateListener.h:30
Definition: KeyValueConfiguration.h:58