OpenDaVINCI  4.15.3
SuperComponent.h
Go to the documentation of this file.
1 
20 #ifndef CONTEXT_BASE_SUPERCOMPONENT_H_
21 #define CONTEXT_BASE_SUPERCOMPONENT_H_
22 
23 #include <memory>
24 #include <string>
25 #include <vector>
26 
28 #include <memory>
35 #include "opendavinci/generated/odcore/data/dmcp/ModuleExitCodeMessage.h"
36 #include "opendavinci/generated/odcore/data/dmcp/ModuleStateMessage.h"
37 #include "opendavinci/generated/odcore/data/dmcp/RuntimeStatistic.h"
38 
39 namespace odcore { namespace data { namespace dmcp { class ModuleDescriptor; } } }
40 namespace odcore { namespace data { class Container; } }
41 namespace odcore { namespace dmcp { namespace connection { class ModuleConnection; } } }
42 namespace odcore { namespace dmcp { namespace connection { class Server; } } }
43 namespace odcore { namespace dmcp { namespace discoverer { class Server; } } }
44 
45 namespace odcontext {
46  namespace base {
47 
48  using namespace std;
49 
56  private:
63 
69  SuperComponent& operator=(const SuperComponent&);
70 
71  public:
80  SuperComponent(const string &multicastGroup, const uint32_t &CID, const odcore::base::KeyValueConfiguration &configuration);
81 
82  virtual ~SuperComponent();
83 
89  odcore::io::conference::ContainerConference& getContainerConference();
90 
91  protected:
92  virtual odcore::base::KeyValueConfiguration getConfiguration(const odcore::data::dmcp::ModuleDescriptor& md);
93 
94  virtual odcore::base::KeyValueConfiguration getGlobalConfiguration() const;
95 
96  virtual void onNewModule(std::shared_ptr<odcore::dmcp::connection::ModuleConnection> mc);
97 
98  virtual void handleChangeState(const odcore::data::dmcp::ModuleDescriptor& md,
99  const odcore::data::dmcp::ModuleStateMessage::ModuleState &ms);
100 
101  virtual void handleExitCode(const odcore::data::dmcp::ModuleDescriptor& md,
102  const odcore::data::dmcp::ModuleExitCodeMessage::ModuleExitCode &me);
103 
104  virtual void handleRuntimeStatistics(const odcore::data::dmcp::ModuleDescriptor& md,
105  const odcore::data::dmcp::RuntimeStatistic& rs);
106 
107  virtual void handleConnectionLost(const odcore::data::dmcp::ModuleDescriptor& md);
108 
109  virtual void handleUnkownContainer(const odcore::data::dmcp::ModuleDescriptor& md,
110  const odcore::data::Container& container);
111 
112  private:
113  odcore::base::Mutex m_configurationMutex;
114  odcore::base::KeyValueConfiguration m_configuration;
115 
116  unique_ptr<odcore::dmcp::discoverer::Server> m_discovererServer;
117  unique_ptr<odcore::dmcp::connection::Server> m_connectionServer;
118 
119  std::shared_ptr<odcore::io::conference::ContainerConference> m_conference;
120 
121  vector<std::shared_ptr<odcore::dmcp::connection::ModuleConnection> > m_listOfModuleConnections;
122  };
123 
124  }
125 } // odcontext::base
126 
127 #endif /*CONTEXT_BASE_SUPERCOMPONENT_H_*/
Definition: base/Mutex.h:49
Definition: Container.h:40
Definition: SuperComponent.h:53
Definition: ModuleStateListener.h:34
#define OPENDAVINCI_API
Definition: opendavinci.h:67
Definition: ModuleConnection.h:45
Definition: ContainerConference.h:43
Definition: ConnectionHandler.h:34
Definition: ModuleConfigurationProvider.h:38
Definition: discoverer/Server.h:39
Definition: KeyValueConfiguration.h:58