#include <GyrosCommsInterface.hpp>
Public Member Functions | |
const bool | Connected () |
virtual const void * | GetCommObject (void) |
GyrosCommsInterface () | |
virtual COMMERRORS::CommError | Receive (std::vector< labust::xml::GyrosReader > &data, bool wait=false)=0 |
virtual void | RegisterCallbackObject (CommEntity *entity) |
virtual COMMERRORS::CommError | Send (const labust::xml::GyrosWriter &data, bool wait=false)=0 |
virtual COMMERRORS::CommError | Send (const std::vector< labust::xml::GyrosWriter > &data, bool wait=false)=0 |
virtual void | unRegisterCallbackObject () |
virtual | ~GyrosCommsInterface () |
Protected Attributes | |
CommEntity * | callbackObject |
bool | connected |
Private Member Functions | |
GyrosCommsInterface (const GyrosCommsInterface &orig) | |
GyrosCommsInterface & | operator= (const GyrosCommsInterface &) |
This class represents the communication interface which can be used to send and receive data with other processes It is configured from an XML config file The interface uses the GYROS data format (XML based) The CommsInterface must ensure that any communication protocol can be used in two ways: PASSIVE: data is sent and received by calling member functions ACTIVE: data is sent by calling CommsInterface member functions, and received data is passed from CommsInterface through a callback (see CommEntity)
Definition at line 78 of file GyrosCommsInterface.hpp.
Definition at line 82 of file GyrosCommsInterface.hpp.
virtual LABUST::COMMUNICATION::GyrosCommsInterface::~GyrosCommsInterface | ( | ) | [inline, virtual] |
Definition at line 89 of file GyrosCommsInterface.hpp.
LABUST::COMMUNICATION::GyrosCommsInterface::GyrosCommsInterface | ( | const GyrosCommsInterface & | orig | ) | [private] |
const bool LABUST::COMMUNICATION::GyrosCommsInterface::Connected | ( | ) | [inline] |
Definition at line 165 of file GyrosCommsInterface.hpp.
virtual const void* LABUST::COMMUNICATION::GyrosCommsInterface::GetCommObject | ( | void | ) | [inline, virtual] |
This methods allows to access the hidden comms device. This allows the user to set some specific options. The user is not forced to implement this function.
Reimplemented in LABUST::COMMUNICATION::GyrosMoosCommsInterface.
Definition at line 137 of file GyrosCommsInterface.hpp.
GyrosCommsInterface& LABUST::COMMUNICATION::GyrosCommsInterface::operator= | ( | const GyrosCommsInterface & | ) | [private] |
virtual COMMERRORS::CommError LABUST::COMMUNICATION::GyrosCommsInterface::Receive | ( | std::vector< labust::xml::GyrosReader > & | data, |
bool | wait = false |
||
) | [pure virtual] |
PASSIVE This methods allows to receive data from the comms buffer. Stores all received data in the GYROS vector as multiple objects If lock is set, the call blocks until data is available for receiving, otherwise exits with an empty vector Must be implemented
data | vector of gyrosreaders with received data |
wait | true if the call should block until data is available, false to return error code |
Implemented in LABUST::COMMUNICATION::GyrosMoosCommsInterface.
virtual void LABUST::COMMUNICATION::GyrosCommsInterface::RegisterCallbackObject | ( | CommEntity * | entity | ) | [inline, virtual] |
ACTIVE this method allows user to register an object which will be used as a communications hook in case the comm channel has to initiate communication The comm channel should call this function when it has received data and needs the system to provide or read it
obj | pointer to object on which callbacks will be executed |
Reimplemented in LABUST::COMMUNICATION::GyrosMoosCommsInterface.
Definition at line 151 of file GyrosCommsInterface.hpp.
virtual COMMERRORS::CommError LABUST::COMMUNICATION::GyrosCommsInterface::Send | ( | const labust::xml::GyrosWriter & | data, |
bool | wait = false |
||
) | [pure virtual] |
PASSIVE or ACTIVE usage This method allows user to send data over the underlying connection channel data is passed as a GYROS writer object
data | vector of gyroswriters with data to send |
wait | true if function should block until the data is sent, false to return immediately |
Implemented in LABUST::COMMUNICATION::GyrosMoosCommsInterface.
virtual COMMERRORS::CommError LABUST::COMMUNICATION::GyrosCommsInterface::Send | ( | const std::vector< labust::xml::GyrosWriter > & | data, |
bool | wait = false |
||
) | [pure virtual] |
PASSIVE or ACTIVE usage This method allows user to send data over the underlying connection channel data is passed as a GYROS writer object vector
data | vector of gyroswriters with data to send |
wait | true if function should block until the data is sent, false to return immediately |
Implemented in LABUST::COMMUNICATION::GyrosMoosCommsInterface.
virtual void LABUST::COMMUNICATION::GyrosCommsInterface::unRegisterCallbackObject | ( | ) | [inline, virtual] |
sets callbackobject to NULL Must not delete the object!
Definition at line 160 of file GyrosCommsInterface.hpp.
The comm channel can call the callback method on this object when it is ready to communicate
Definition at line 175 of file GyrosCommsInterface.hpp.
bool LABUST::COMMUNICATION::GyrosCommsInterface::connected [protected] |
Definition at line 177 of file GyrosCommsInterface.hpp.