Public Member Functions | Private Member Functions | Private Attributes
LABUST::COMMUNICATION::GyrosMoosCommsInterface Class Reference

#include <GyrosMoosCommsInterface.h>

Inheritance diagram for LABUST::COMMUNICATION::GyrosMoosCommsInterface:
Inheritance graph
[legend]

List of all members.

Public Member Functions

const void * GetCommObject (void)
 GyrosMoosCommsInterface (const labust::xml::Reader &reader, std::string configToUse="")
 GyrosMoosCommsInterface (const std::string &configPath, std::string configToUse="")
bool Iterate ()
bool OnConnectToServer ()
bool OnDisconnectFromServer ()
bool OnNewMail (MOOSMSG_LIST &NewMail)
bool OnStartUp ()
COMMERRORS::CommError Receive (std::vector< labust::xml::GyrosReader > &data, bool wait=false)
virtual void RegisterCallbackObject (CommEntity *entity)
COMMERRORS::CommError Send (const labust::xml::GyrosWriter &data, bool wait=false)
COMMERRORS::CommError Send (const std::vector< labust::xml::GyrosWriter > &data, bool wait=false)
virtual void UnRegisterCallbackObject ()
virtual ~GyrosMoosCommsInterface ()

Private Member Functions

 GyrosMoosCommsInterface (const GyrosMoosCommsInterface &orig)
GyrosMoosCommsInterfaceoperator= (const GyrosMoosCommsInterface &)

Private Attributes

boost::thread commsThread
MoosConfig config
boost::condition_variable dataReceivedSignal
boost::condition_variable dataSentSignal
boost::mutex locker
std::vector
< labust::xml::GyrosReader > 
messagesReceived
std::vector
< labust::xml::GyrosWriter > 
messagesToSend

Detailed Description

Definition at line 24 of file GyrosMoosCommsInterface.h.


Constructor & Destructor Documentation

LABUST::COMMUNICATION::GyrosMoosCommsInterface::GyrosMoosCommsInterface ( const labust::xml::Reader &  reader,
std::string  configToUse = "" 
)

Constructor that reads MOOS configuration from a preloaded XML file /xmlreader) XML reader must be set to the right <config> node before

Parameters:
readerXML reader with preloaded and preset config file, mandatory
configToUsename of configuration to use, if empty, the first one will be used

Definition at line 19 of file GyrosMoosCommsInterface.cpp.

LABUST::COMMUNICATION::GyrosMoosCommsInterface::GyrosMoosCommsInterface ( const std::string &  configPath,
std::string  configToUse = "" 
)

Constructor that reads MOOS configuration from an XML file on disk finds the first element <commsConfig type="moos"> with the configToUse name (if provided)

Parameters:
configPathpath to config file, mandatory
configToUsename of configuration to use, if empty, the first one will be used

Definition at line 59 of file GyrosMoosCommsInterface.cpp.

Definition at line 117 of file GyrosMoosCommsInterface.cpp.

Definition at line 113 of file GyrosMoosCommsInterface.cpp.


Member Function Documentation

Returns pointer to MOOS client

Returns:
pointer to MOOS client

Reimplemented from LABUST::COMMUNICATION::GyrosCommsInterface.

Definition at line 179 of file GyrosMoosCommsInterface.cpp.

Definition at line 235 of file GyrosMoosCommsInterface.cpp.

Definition at line 258 of file GyrosMoosCommsInterface.cpp.

Definition at line 294 of file GyrosMoosCommsInterface.cpp.

MOOSApp overrides

See also:
MOOSAPP.h

Definition at line 196 of file GyrosMoosCommsInterface.cpp.

Definition at line 276 of file GyrosMoosCommsInterface.cpp.

GyrosMoosCommsInterface& LABUST::COMMUNICATION::GyrosMoosCommsInterface::operator= ( const GyrosMoosCommsInterface ) [private]
COMMERRORS::CommError LABUST::COMMUNICATION::GyrosMoosCommsInterface::Receive ( std::vector< labust::xml::GyrosReader > &  data,
bool  wait = false 
) [virtual]

PASSIVE This methods allows to receive data from the comms buffer. in case the system has to initiate communication Stores all received data in the GYROSreader vector as multiple objects If lock is set, the call blocks until data is available for receiving, otherwise exits with an empty vector NAme of variable data was received from is stored as label of the gyros object

Parameters:
datavector of gyros objects to hold new data
waittrue if the call should block until data is available, false to return error code
Returns:
COMERRORS::ComError in case of error, 0 if everything is ok

Implements LABUST::COMMUNICATION::GyrosCommsInterface.

Definition at line 150 of file GyrosMoosCommsInterface.cpp.

ACTIVE Allows registration of object which will handle incomming messages from MOOS

Parameters:
objpointer to object on which callbacks will be executed

Reimplemented from LABUST::COMMUNICATION::GyrosCommsInterface.

Definition at line 184 of file GyrosMoosCommsInterface.cpp.

COMMERRORS::CommError LABUST::COMMUNICATION::GyrosMoosCommsInterface::Send ( const labust::xml::GyrosWriter &  data,
bool  wait = false 
) [virtual]

PASSIVE or ACTIVE usage Sends data through MOOS data is passed as a GYROSWriter object

See also:
GyrosWriter.hpp MOOS variable the data is sent to is determined by the label of gyros object If gyros has no label, output variable is "[process name]_OUT";
Parameters:
datareference to GYrosWriter with data to send
waittrue if function should block until the data is sent, false to return immediately
Returns:
COMERRORS::ComError in case of error, 0 if everything is ok

Implements LABUST::COMMUNICATION::GyrosCommsInterface.

Definition at line 125 of file GyrosMoosCommsInterface.cpp.

COMMERRORS::CommError LABUST::COMMUNICATION::GyrosMoosCommsInterface::Send ( const std::vector< labust::xml::GyrosWriter > &  data,
bool  wait = false 
) [virtual]

PASSIVE or ACTIVE usage Sends data through MOOS data is passed as a GYROSWriter object vector

See also:
GyrosWriter.hpp MOOS variable the data is sent to is determined by the label of gyros object If gyros has no label, output variable is "[process name]_OUT";
Parameters:
datareference to GYrosWriter vector with data to send
waittrue if function should block until the data is sent, false to return immediately
Returns:
COMERRORS::ComError in case of error, 0 if everything is ok

Implements LABUST::COMMUNICATION::GyrosCommsInterface.

Definition at line 136 of file GyrosMoosCommsInterface.cpp.

sets callbackobject to NULL

Definition at line 189 of file GyrosMoosCommsInterface.cpp.


Member Data Documentation

Definition at line 126 of file GyrosMoosCommsInterface.h.

Definition at line 122 of file GyrosMoosCommsInterface.h.

Definition at line 127 of file GyrosMoosCommsInterface.h.

Definition at line 127 of file GyrosMoosCommsInterface.h.

Definition at line 128 of file GyrosMoosCommsInterface.h.

Definition at line 124 of file GyrosMoosCommsInterface.h.

Definition at line 123 of file GyrosMoosCommsInterface.h.


The documentation for this class was generated from the following files:


acoustic_vr
Author(s):
autogenerated on Fri Feb 7 2014 11:37:09