Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

msg Class Reference

Short Description. More...

#include <msg.h>

Inheritance diagram for msg:

SCTPmsg STDINmsg TCPmsg UNIXmsg wxMsg UNIXmsgServer List of all members.

Public Member Functions

 msg ()
 Short Description.
virtual ~msg (void)
msgoperator<< (const int i)
 Add an integer arguement.
msgoperator<< (const float f)
 Add a floating point arguement.
msgoperator<< (const double d)
 Add a double floating point arguement.
msgoperator<< (const char *str)
 Add a string arguement, must not contain ''.
msgoperator<< (const string &str)
 Add a string arguement, must not contain ''.
msgoperator<< (const __omsgctrl &omc)
 Short Description.
void data (const char *data, int size)
 Add a binary data arguement, may contain ''.
virtual int dispatch (void)
 Short Description.
int poll (void)
 Attempts to fixup inbuf if partial message found (fragment is deleted).
const string & type (void)
 Short Description.
int size ()
 Short Description.
msgoperator>> (int &i)
 Short Description.
msgoperator>> (float &f)
 Short Description.
msgoperator>> (double &d)
 Short Description.
msgoperator>> (char *&str)
 Short Description.
msgoperator>> (string &str)
 Short Description.
msgoperator>> (__imsgctrl &imc)
 Short Description.
bool moreArgs (void)
 operator bool ()
 Short Description.
int error (void)
virtual int recv (void)
 Short Description.
virtual int recvNoWait (void)
 Short Description.

Protected Member Functions

virtual int send (void)
 Short Description.
int msg_pop_arg (string *msg, string *arg, int index)
 get top argument of message "queue"

Protected Attributes

list< string > _arglist
string _type
int _size
string outbuf
string inbuf
int error_code

Friends

ostream & operator<< (ostream &os, msg &m)
 Short Description.

Detailed Description

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 52 of file msg.h.


Constructor & Destructor Documentation

msg::msg  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 20 of file msg.cpp.

References _arglist, _size, and _type.

virtual msg::~msg void   )  [inline, virtual]
 

Definition at line 56 of file msg.h.


Member Function Documentation

void msg::data const char *  data,
int  size
 

Add a binary data arguement, may contain ''.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 144 of file msg.cpp.

References outbuf.

Referenced by operator<<().

int msg::dispatch void   )  [virtual]
 

Short Description.

Long Description if necessary.

Parameters:
<parameter name> <parameter descreption>="">
Returns:
0 on success, -1 on error.
Author:
<author name>="">

Reimplemented in STDINmsg.

Definition at line 191 of file msg.cpp.

References _arglist, _size, _type, inbuf, msg_pop_arg(), and poll().

Referenced by childTest(), main(), parentTest(), Daemon::processClient(), Daemon::processController(), Controller::processMsgs(), processNet(), processNET(), wxMsg::recv(), TCPmsg::run(), TCPmsg::select(), and testUnamedSockets().

int msg::error void   )  [inline]
 

Definition at line 94 of file msg.h.

Referenced by childTest(), Daemon::processController(), Controller::processMsgs(), and processNet().

bool msg::moreArgs void   )  [inline]
 

Definition at line 88 of file msg.h.

References _size.

Referenced by Controller::info(), Controller::joyX(), Controller::joyY(), Daemon::processClient(), Daemon::processController(), Controller::setAngle(), Controller::setAngleValue(), Controller::setPower(), and Controller::setPowerValue().

int msg::msg_pop_arg string *  msg,
string *  arg,
int  index
[protected]
 

get top argument of message "queue"

'index' is the index of a delimiter before the arguement to be popped(' ' or '?') returns index of next delimiter on success pops and unescapes 1 value from msg (' ' delineated)

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 304 of file msg.cpp.

References escaped(), and inbuf.

Referenced by dispatch().

msg::operator bool  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 543 of file msg.cpp.

References _size.

msg & msg::operator<< const __omsgctrl omc  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 118 of file msg.cpp.

References __omsgctrl::ctrl, data(), outbuf, send(), and __omsgctrl::str.

msg & msg::operator<< const string &  str  ) 
 

Add a string arguement, must not contain ''.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 102 of file msg.cpp.

References data(), and outbuf.

msg & msg::operator<< const char *  str  ) 
 

Add a string arguement, must not contain ''.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 86 of file msg.cpp.

References data(), and outbuf.

msg & msg::operator<< const double  d  ) 
 

Add a double floating point arguement.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 53 of file msg.cpp.

References outbuf.

msg & msg::operator<< const float  f  ) 
 

Add a floating point arguement.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 68 of file msg.cpp.

References outbuf.

msg & msg::operator<< const int  i  ) 
 

Add an integer arguement.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 36 of file msg.cpp.

References outbuf.

msg & msg::operator>> __imsgctrl imc  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 525 of file msg.cpp.

msg & msg::operator>> string &  str  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 504 of file msg.cpp.

References _arglist, and _size.

msg & msg::operator>> char *&  str  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>=""> improve this, provide facility for generic data

Definition at line 479 of file msg.cpp.

References _arglist, and _size.

msg & msg::operator>> double &  d  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 453 of file msg.cpp.

References _arglist, and _size.

msg & msg::operator>> float &  f  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 428 of file msg.cpp.

References _arglist, and _size.

msg & msg::operator>> int &  i  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 403 of file msg.cpp.

References _arglist, and _size.

int msg::poll void   ) 
 

Attempts to fixup inbuf if partial message found (fragment is deleted).

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
0 on fail, size of msg (in char's) on success
Author:
<author name>="">

Definition at line 262 of file msg.cpp.

References escaped(), i, and inbuf.

Referenced by dispatch(), poll(), and TrucknetTestSuite::testMessageCreation().

int msg::recv void   )  [virtual]
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Reimplemented in wxMsg, SCTPmsg, TCPmsg, and UNIXmsg.

Definition at line 343 of file msg.cpp.

int msg::recvNoWait void   )  [virtual]
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Reimplemented in SCTPmsg, STDINmsg, TCPmsg, and UNIXmsg.

Definition at line 358 of file msg.cpp.

Referenced by Controller::processMsgs().

int msg::send void   )  [protected, virtual]
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Reimplemented in wxMsg, SCTPmsg, STDINmsg, TCPmsg, and UNIXmsg.

Definition at line 169 of file msg.cpp.

References inbuf, and outbuf.

Referenced by operator<<(), and sendTest().

int msg::size  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 389 of file msg.cpp.

References _size.

Referenced by print().

const string & msg::type void   ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 374 of file msg.cpp.

References _type.

Referenced by childTest(), Controller::gain(), Controller::joyX(), Controller::joyY(), msgtest(), print(), Daemon::processClient(), Daemon::processController(), Controller::processMsgs(), processNet(), processNET(), sendAck(), Controller::sendAck(), Controller::sendNack(), servo(), Controller::setAngle(), Controller::setAngleValue(), Controller::setPower(), Controller::setPowerValue(), and Controller::speed().


Friends And Related Function Documentation

ostream& operator<< ostream &  os,
msg m
[friend]
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 558 of file msg.cpp.


Member Data Documentation

list<string> msg::_arglist [protected]
 

Definition at line 107 of file msg.h.

Referenced by dispatch(), STDINmsg::dispatch(), msg(), operator<<(), and operator>>().

int msg::_size [protected]
 

Definition at line 109 of file msg.h.

Referenced by dispatch(), STDINmsg::dispatch(), moreArgs(), msg(), operator bool(), operator<<(), operator>>(), and size().

string msg::_type [protected]
 

Definition at line 108 of file msg.h.

Referenced by dispatch(), STDINmsg::dispatch(), msg(), operator<<(), and type().

int msg::error_code [protected]
 

Definition at line 114 of file msg.h.

Referenced by UNIXmsg::recv(), TCPmsg::recv(), UNIXmsg::recvNoWait(), TCPmsg::recvNoWait(), and STDINmsg::recvNoWait().

string msg::inbuf [protected]
 

Definition at line 112 of file msg.h.

Referenced by dispatch(), STDINmsg::dispatch(), msg_pop_arg(), poll(), UNIXmsg::recv(), TCPmsg::recv(), wxMsg::recv(), UNIXmsg::recvNoWait(), TCPmsg::recvNoWait(), STDINmsg::recvNoWait(), and send().

string msg::outbuf [protected]
 

Definition at line 111 of file msg.h.

Referenced by data(), operator<<(), UNIXmsg::send(), TCPmsg::send(), send(), STDINmsg::send(), and wxMsg::send().


The documentation for this class was generated from the following files:
Generated on Fri Sep 1 14:26:01 2006 for Raptor by  doxygen 1.4.4