OpenDaVINCI  4.16.0
ModuleConnection.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_DMCP_CONNECTION_MODULECONNECTION_H_
21 #define OPENDAVINCI_DMCP_CONNECTION_MODULECONNECTION_H_
22 
23 #include <vector>
24 
26 #include <memory>
33 #include "opendavinci/generated/odcore/data/dmcp/ModuleDescriptor.h"
34 
35 namespace odcore { namespace data { namespace dmcp { class PulseMessage; } } }
36 namespace odcore { namespace dmcp { class ModuleConfigurationProvider; } }
37 namespace odcore { namespace dmcp { class ModuleStateListener; } }
38 
39 namespace odcore {
40  namespace dmcp {
41  namespace connection {
42 
43  using namespace std;
44 
47  {
48  private:
55 
61  ModuleConnection& operator=(const ModuleConnection &);
62 
63  public:
64  ModuleConnection(std::shared_ptr<odcore::io::Connection> connection,
65  ModuleConfigurationProvider &configProvider);
66  virtual ~ModuleConnection();
67 
68  void setModuleStateListener(ModuleStateListener* listener);
69 
70  void waitForModuleDescription();
71 
77  void pulse(const odcore::data::dmcp::PulseMessage &pm);
78 
87  void pulse_ack(const odcore::data::dmcp::PulseMessage &pm, const uint32_t &timeout);
88 
101  vector<odcore::data::Container> pulse_ack_containers(const odcore::data::dmcp::PulseMessage &pm, const uint32_t &timeout);
102 
103  const odcore::data::dmcp::ModuleDescriptor getModuleDescriptor() const;
104 
105  protected:
106  virtual void nextContainer(odcore::data::Container &c);
107  virtual void handleConnectionError();
108 
109  std::shared_ptr<odcore::io::Connection> m_connection;
111 
113  odcore::data::dmcp::ModuleDescriptor m_descriptor;
115 
118 
121 
124 
127 
128  vector<odcore::data::Container> m_containersToBeTransferredToSupercomponent;
129  };
130  }
131  }
132 } // odcore::dmcp
133 
134 #endif /*OPENDAVINCI_DMCP_CONNECTION_MODULECONNECTION_H_*/
Definition: base/Condition.h:64
Definition: ContainerListener.h:35
Definition: base/Mutex.h:49
ModuleStateListener * m_stateListener
Definition: ModuleConnection.h:125
Definition: Container.h:40
Definition: ConnectionErrorListener.h:30
bool m_connectionLost
Definition: ModuleConnection.h:123
Definition: ModuleStateListener.h:34
odcore::data::dmcp::ModuleDescriptor m_descriptor
Definition: ModuleConnection.h:113
odcore::base::Condition m_pulseAckCondition
Definition: ModuleConnection.h:116
#define OPENDAVINCI_API
Definition: opendavinci.h:67
odcore::base::Mutex m_stateListenerMutex
Definition: ModuleConnection.h:126
Definition: ModuleConnection.h:45
odcore::base::Condition m_pulseAckContainersCondition
Definition: ModuleConnection.h:119
vector< odcore::data::Container > m_containersToBeTransferredToSupercomponent
Definition: ModuleConnection.h:128
odcore::base::Condition m_descriptorCondition
Definition: ModuleConnection.h:112
ModuleConfigurationProvider & m_configurationProvider
Definition: ModuleConnection.h:110
bool m_hasReceivedPulseAckContainers
Definition: ModuleConnection.h:120
Definition: ModuleConfigurationProvider.h:38
bool m_hasDescriptor
Definition: ModuleConnection.h:114
bool m_hasReceivedPulseAck
Definition: ModuleConnection.h:117
odcore::base::Mutex m_connectionLostMutex
Definition: ModuleConnection.h:122
std::shared_ptr< odcore::io::Connection > m_connection
Definition: ModuleConnection.h:109