MOOS 0.2375
|
#include <MOOSMsg.h>
Public Member Functions | |
CMOOSMsg () | |
virtual | ~CMOOSMsg () |
CMOOSMsg (char cMsgType, const std::string &sKey, double dfVal, double dfTime=-1) | |
CMOOSMsg (char cMsgType, const std::string &sKey, const std::string &sVal, double dfTime=-1) | |
void | MarkAsBinary () |
bool | IsDataType (char cDataType) const |
bool | IsDouble () const |
bool | IsString () const |
bool | IsSkewed (double dfTimeNow, double *pdfSkew=NULL) |
bool | IsYoungerThan (double dfAge) const |
bool | IsType (char cType) const |
double | GetTime () const |
double | GetDouble () const |
std::string | GetString () const |
std::string | GetKey () const |
std::string | GetName () const |
std::string | GetSource () const |
std::string | GetSourceAux () const |
void | SetSourceAux (const std::string &sSrcAux) |
std::string | GetCommunity () const |
std::string | GetAsString (int nFieldWidth=12, int nNumDP=5) |
void | Trace () |
void | SetDouble (double dfD) |
int | Serialize (unsigned char *pBuffer, int nLen, bool bToStream=true) |
bool | operator< (const CMOOSMsg &Msg) const |
unsigned int | GetSizeInBytesWhenSerialised () const |
Public Attributes | |
char | m_cMsgType |
char | m_cDataType |
std::string | m_sKey |
int | m_nID |
double | m_dfTime |
double | m_dfVal |
double | m_dfVal2 |
std::string | m_sVal |
std::string | m_sSrc |
std::string | m_sSrcAux |
std::string | m_sOriginatingCommunity |
MOOS Comms Messaging class. This is a class encapsulating the data which the MOOS Comms API shuttles between the MOOSDB and other clients
CMOOSMsg::CMOOSMsg | ( | ) |
standard construction destruction
Definition at line 54 of file MOOSMsg.cpp.
CMOOSMsg::~CMOOSMsg | ( | ) | [virtual] |
Definition at line 66 of file MOOSMsg.cpp.
CMOOSMsg::CMOOSMsg | ( | char | cMsgType, |
const std::string & | sKey, | ||
double | dfVal, | ||
double | dfTime = -1 |
||
) |
specialised construction
Definition at line 71 of file MOOSMsg.cpp.
CMOOSMsg::CMOOSMsg | ( | char | cMsgType, |
const std::string & | sKey, | ||
const std::string & | sVal, | ||
double | dfTime = -1 |
||
) |
specialised construction
Definition at line 92 of file MOOSMsg.cpp.
string CMOOSMsg::GetAsString | ( | int | nFieldWidth = 12 , |
int | nNumDP = 5 |
||
) |
format the message as string regardless of type
Definition at line 546 of file MOOSMsg.cpp.
std::string CMOOSMsg::GetCommunity | ( | ) | const [inline] |
double CMOOSMsg::GetDouble | ( | ) | const [inline] |
std::string CMOOSMsg::GetKey | ( | ) | const [inline] |
unsigned int CMOOSMsg::GetSizeInBytesWhenSerialised | ( | ) | const |
Definition at line 316 of file MOOSMsg.cpp.
std::string CMOOSMsg::GetSource | ( | ) | const [inline] |
std::string CMOOSMsg::GetString | ( | ) | const [inline] |
double CMOOSMsg::GetTime | ( | ) | const [inline] |
bool CMOOSMsg::IsDataType | ( | char | cDataType | ) | const |
check data type (MOOS_STRING or MOOS_DOUBLE)
Definition at line 577 of file MOOSMsg.cpp.
bool CMOOSMsg::IsDouble | ( | ) | const [inline] |
bool CMOOSMsg::IsSkewed | ( | double | dfTimeNow, |
double * | pdfSkew = NULL |
||
) |
return true if mesage is substantially (SKEW_TOLERANCE) older than dfTimeNow if pdfSkew is not NULL, the time skew is returned in *pdfSkew
A method to check the timestamping of a MOOSMsg. Does so by checking the TimeNow
passed to it, and gives the requesting class an idea about how out of sync this message is by comparing the MOOSMsg's time stamp (m_dfTime
) to SKEW_TOLERANCE.
pdfSkew
, or amount of time difference between the MOOSDB and MOOSMsg timestamp if desired. Definition at line 521 of file MOOSMsg.cpp.
bool CMOOSMsg::IsString | ( | ) | const [inline] |
bool CMOOSMsg::IsType | ( | char | cType | ) | const |
check message type MOOS_NOTIFY, REGISTER etc
Definition at line 479 of file MOOSMsg.cpp.
bool CMOOSMsg::IsYoungerThan | ( | double | dfAge | ) | const |
return true if message is younger that dfAge
Definition at line 507 of file MOOSMsg.cpp.
void CMOOSMsg::MarkAsBinary | ( | ) |
Mark string payload as binary
Definition at line 114 of file MOOSMsg.cpp.
Definition at line 335 of file MOOSMsg.cpp.
void CMOOSMsg::SetDouble | ( | double | dfD | ) | [inline] |
void CMOOSMsg::SetSourceAux | ( | const std::string & | sSrcAux | ) | [inline] |
void CMOOSMsg::Trace | ( | ) |
print a summary of the message
Definition at line 484 of file MOOSMsg.cpp.
char CMOOSMsg::m_cMsgType |
double CMOOSMsg::m_dfTime |
double CMOOSMsg::m_dfVal |
double CMOOSMsg::m_dfVal2 |
int CMOOSMsg::m_nID |
std::string CMOOSMsg::m_sKey |
std::string CMOOSMsg::m_sOriginatingCommunity |
std::string CMOOSMsg::m_sSrc |
std::string CMOOSMsg::m_sSrcAux |
std::string CMOOSMsg::m_sVal |