OpenDaVINCI  4.16.0
odcore::dmcp::connection::ModuleConnection Class Reference

#include <ModuleConnection.h>

Inheritance diagram for odcore::dmcp::connection::ModuleConnection:
Inheritance graph

Public Member Functions

 ModuleConnection (std::shared_ptr< odcore::io::Connection > connection, ModuleConfigurationProvider &configProvider)
 
virtual ~ModuleConnection ()
 
void setModuleStateListener (ModuleStateListener *listener)
 
void waitForModuleDescription ()
 
void pulse (const odcore::data::dmcp::PulseMessage &pm)
 
void pulse_ack (const odcore::data::dmcp::PulseMessage &pm, const uint32_t &timeout)
 
vector< odcore::data::Containerpulse_ack_containers (const odcore::data::dmcp::PulseMessage &pm, const uint32_t &timeout)
 
const
odcore::data::dmcp::ModuleDescriptor 
getModuleDescriptor () const
 

Protected Member Functions

virtual void nextContainer (odcore::data::Container &c)
 
virtual void handleConnectionError ()
 

Protected Attributes

std::shared_ptr
< odcore::io::Connection
m_connection
 
ModuleConfigurationProviderm_configurationProvider
 
odcore::base::Condition m_descriptorCondition
 
odcore::data::dmcp::ModuleDescriptor m_descriptor
 
bool m_hasDescriptor
 
odcore::base::Condition m_pulseAckCondition
 
bool m_hasReceivedPulseAck
 
odcore::base::Condition m_pulseAckContainersCondition
 
bool m_hasReceivedPulseAckContainers
 
odcore::base::Mutex m_connectionLostMutex
 
bool m_connectionLost
 
ModuleStateListenerm_stateListener
 
odcore::base::Mutex m_stateListenerMutex
 
vector< odcore::data::Containerm_containersToBeTransferredToSupercomponent
 

Constructor & Destructor Documentation

odcore::dmcp::connection::ModuleConnection::ModuleConnection ( std::shared_ptr< odcore::io::Connection connection,
ModuleConfigurationProvider configProvider 
)

References m_connection.

odcore::dmcp::connection::ModuleConnection::~ModuleConnection ( )
virtual

References m_connection.

Member Function Documentation

const ModuleDescriptor odcore::dmcp::connection::ModuleConnection::getModuleDescriptor ( ) const

References m_descriptor.

void odcore::dmcp::connection::ModuleConnection::pulse ( const odcore::data::dmcp::PulseMessage &  pm)

This method sends a pulse to the connected module.

Parameters
pmPulse to be sent.

References m_connection.

void odcore::dmcp::connection::ModuleConnection::pulse_ack ( const odcore::data::dmcp::PulseMessage &  pm,
const uint32_t &  timeout 
)

This method sends a pulse to the connected module and requires an ACK confirmation sent from the respective, dependent module that the PULSE has been processed.

Parameters
pmPulse to be sent.
timeoutTimeout in milliseconds to wait for the ACK message.

References m_connection, m_connectionLost, m_connectionLostMutex, m_hasReceivedPulseAck, m_pulseAckCondition, and odcore::base::Condition::waitOnSignalWithTimeout().

vector< odcore::data::Container > odcore::dmcp::connection::ModuleConnection::pulse_ack_containers ( const odcore::data::dmcp::PulseMessage &  pm,
const uint32_t &  timeout 
)

This method sends a pulse to the connected module and requires an ACK confirmation sent from the respective, dependent module that the PULSE has been processed. In addition to the original pulse_ack method, this one also receives all newly created containers from the dependent module to be transferred to supercomponent.

Parameters
pmPulse to be sent.
timeoutTimeout in milliseconds to wait for the ACK message.
Returns
Containers to be transferred to supercomponent.

References m_connection, m_connectionLost, m_connectionLostMutex, m_containersToBeTransferredToSupercomponent, m_hasReceivedPulseAckContainers, m_pulseAckContainersCondition, and odcore::base::Condition::waitOnSignalWithTimeout().

void odcore::dmcp::connection::ModuleConnection::setModuleStateListener ( ModuleStateListener listener)
void odcore::dmcp::connection::ModuleConnection::waitForModuleDescription ( )

Member Data Documentation

ModuleConfigurationProvider& odcore::dmcp::connection::ModuleConnection::m_configurationProvider
protected

Referenced by nextContainer().

std::shared_ptr<odcore::io::Connection> odcore::dmcp::connection::ModuleConnection::m_connection
protected
bool odcore::dmcp::connection::ModuleConnection::m_connectionLost
protected
odcore::base::Mutex odcore::dmcp::connection::ModuleConnection::m_connectionLostMutex
protected
vector<odcore::data::Container> odcore::dmcp::connection::ModuleConnection::m_containersToBeTransferredToSupercomponent
protected
odcore::data::dmcp::ModuleDescriptor odcore::dmcp::connection::ModuleConnection::m_descriptor
protected
odcore::base::Condition odcore::dmcp::connection::ModuleConnection::m_descriptorCondition
protected
bool odcore::dmcp::connection::ModuleConnection::m_hasDescriptor
protected
bool odcore::dmcp::connection::ModuleConnection::m_hasReceivedPulseAck
protected

Referenced by nextContainer(), and pulse_ack().

bool odcore::dmcp::connection::ModuleConnection::m_hasReceivedPulseAckContainers
protected
odcore::base::Condition odcore::dmcp::connection::ModuleConnection::m_pulseAckCondition
protected
odcore::base::Condition odcore::dmcp::connection::ModuleConnection::m_pulseAckContainersCondition
protected
ModuleStateListener* odcore::dmcp::connection::ModuleConnection::m_stateListener
protected
odcore::base::Mutex odcore::dmcp::connection::ModuleConnection::m_stateListenerMutex
protected