MOOS

CMOOSMsg Class Reference

#include <MOOSMsg.h>

List of all members.

Public Member Functions

 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)
bool IsDataType (char cDataType)
bool IsDouble ()
bool IsString ()
bool IsSkewed (double dfTimeNow, double *pdfSkew=NULL)
bool IsYoungerThan (double dfAge)
bool IsType (char cType)
double GetTime ()
double GetDouble ()
std::string GetString ()
std::string GetKey ()
std::string GetName ()
std::string GetSource ()
std::string GetCommunity ()
std::string GetAsString (int nFieldWidth=12)
void Trace ()
void SetDouble (double dfD)
int Serialize (unsigned char *pBuffer, int nLen, bool bToStream=true)
bool operator< (const CMOOSMsg &Msg) 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_sOriginatingCommunity


Detailed Description

MOOS Comms Messaging class. This is a class encapsulating the data which the MOOS Comms API shuttles between the MOOSDB and other clients


Constructor & Destructor Documentation

CMOOSMsg::CMOOSMsg  ) 
 

standard construction destruction

CMOOSMsg::CMOOSMsg char  cMsgType,
const std::string &  sKey,
double  dfVal,
double  dfTime = -1
 

specialised construction

CMOOSMsg::CMOOSMsg char  cMsgType,
const std::string &  sKey,
const std::string &  sVal,
double  dfTime = -1
 

specialised construction


Member Function Documentation

string CMOOSMsg::GetAsString int  nFieldWidth = 12  ) 
 

format the message as string regardless of type

std::string CMOOSMsg::GetCommunity  )  [inline]
 

return the name of the MOOS community in which the orginator lives

double CMOOSMsg::GetDouble  )  [inline]
 

return double val of message

std::string CMOOSMsg::GetKey  )  [inline]
 

return the name of the message

std::string CMOOSMsg::GetSource  )  [inline]
 

return the name of the process (as registered with the DB) which posted this notification

std::string CMOOSMsg::GetString  )  [inline]
 

return string value of message

double CMOOSMsg::GetTime  )  [inline]
 

return time stamp of message

bool CMOOSMsg::IsDataType char  cDataType  ) 
 

check data type (MOOS_STRING or MOOS_DOUBLE)

bool CMOOSMsg::IsDouble  )  [inline]
 

check data type is double

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

bool CMOOSMsg::IsString  )  [inline]
 

check data type is string

bool CMOOSMsg::IsType char  cType  ) 
 

check message type MOOS_NOTIFY, REGISTER etc

bool CMOOSMsg::IsYoungerThan double  dfAge  ) 
 

return true if message is younger that dfAge

void CMOOSMsg::SetDouble double  dfD  )  [inline]
 

set the Double value

void CMOOSMsg::Trace  ) 
 

print a summary of the message


Member Data Documentation

char CMOOSMsg::m_cDataType
 

what kind of data is this? String,Double,Array?

char CMOOSMsg::m_cMsgType
 

what type of message is this? Notification,Command,Register etc

double CMOOSMsg::m_dfTime
 

double precision time stamp (UNIX time)

int CMOOSMsg::m_nID
 

ID of message

std::string CMOOSMsg::m_sKey
 

what is the variable name?


The documentation for this class was generated from the following files:
Generated on Fri Sep 28 20:14:20 2007 for MOOSLIB by  doxygen 1.4.6