
#include <Beowulf/TCPmessage.H>
Collaboration diagram for TCPmessage:

The basic message structure is as follows:
Definition at line 92 of file TCPmessage.H.
Public Member Functions | |
| TCPmessage () | |
| uninitialized constructor (for pointers) | |
| TCPmessage (const int32 msgid, const int32 msgaction, const float msgeti=0.0F) | |
| constructor with empty message body | |
| TCPmessage (const int32 msgid, const int32 msgaction, const float msgeti, const void *buf, const int bufsize) | |
| constructor with copy of given message body | |
| TCPmessage (const TCPmessage &m) | |
| copy constructor | |
| TCPmessage & | operator= (const TCPmessage &m) |
| assignment | |
| ~TCPmessage () | |
| destructor | |
| void | addImage (const Image< PixRGB< byte > > &im) |
| method to add elements into a message to be sent out | |
| void | addImage (const Image< byte > &im) |
| method to add elements into a message to be sent out | |
| void | addImage (const Image< float > &im) |
| method to add elements into a message to be sent out | |
| void | addImageSet (const ImageSet< float > &im) |
| method to add elements into a message to be sent out | |
| void | addFixation (const Fixation &fix) |
| method to add elements into a message to be sent out | |
| void | addString (const char *str) |
| method to add elements into a message to be sent out | |
| void | addInt32 (const int32 val) |
| method to add elements into a message to be sent out | |
| void | addFloat (const float val) |
| method to add elements into a message to be sent out | |
| void | addDouble (const double val) |
| method to add elements into a message to be sent out | |
| void | addInt64 (const int64 val) |
| method to add elements into a message to be sent out | |
| void | setID (const int32 id) |
| modify message ID | |
| int32 | getID () const |
| get message ID | |
| void | setAction (const int32 ac) |
| modify message action | |
| int32 | getAction () const |
| get message action | |
| void | setETI (const float eti) |
| modify message eti (estimated time to idle) | |
| float | getETI () const |
| get message eti (estimated time to idle) | |
| int32 | getSize () const |
| get total message size (mostly for debuging purposes) | |
| bool | isBusy () const |
| check whether message is busy (sending or receiving data): | |
| void | reset (const int32 msgid, const int32 msgaction, const float msgeti=0.0F) |
| empty old contents and get ready for a re-use: | |
| void | freeMem () |
| free memory: | |
| void | getElementRaw (void **elem, int32 &typ) |
| DONT'T USE THIS; use one of the type-specific getElement functions below. | |
| Image< PixRGB< byte > > | getElementColByteIma () |
| Get a color byte image from the message stream. | |
| Image< byte > | getElementByteIma () |
| Get a byte image from the message stream. | |
| Image< float > | getElementFloatIma () |
| Get a float image from the message stream. | |
| ImageSet< float > | getElementFloatImaSet () |
| Get a float image set from the message stream. | |
| int32 | getElementInt32 () |
| Get an int32 value from the message stream. | |
| int64 | getElementInt64 () |
| Get an int64 value from the message stream. | |
| double | getElementDouble () |
| Get a double value from the message stream. | |
| float | getElementFloat () |
| Get a float value from the message stream. | |
| Fixation | getElementFixation () |
| Get a Fixation from the message stream. | |
| std::string | getElementString () |
| Get a string value from the message stream. | |
| template<class T> | |
| void | unpack (const T *data, const int nitem) |
| unpack some data from message (memory must be pre-allocated): | |
Friends | |
| class | TCPcliServ |
| make our private methods accessible to TCPcliServ: | |
Classes | |
| struct | TCPmessageHeader |
| This private struct is the common header in all TCPmessage objects. | |
|
|
uninitialized constructor (for pointers)
Definition at line 56 of file TCPmessage.C. References reset(). |
|
||||||||||||||||
|
constructor with empty message body
Definition at line 61 of file TCPmessage.C. References reset(). |
|
||||||||||||||||||||||||
|
constructor with copy of given message body NOTE: we do a deep copy of the given buffer, so that it can be freed immediately upon return from this constructor Definition at line 67 of file TCPmessage.C. References reset(). |
|
|
copy constructor
Definition at line 79 of file TCPmessage.C. |
|
|
destructor
Definition at line 92 of file TCPmessage.C. |
|
|
method to add elements into a message to be sent out
Definition at line 162 of file TCPmessage.C. References TCPMSG_DOUBLE. Referenced by beowulf_xx_basic_tcpmessage_xx_1(), SingleChannelBeoServer::check(), SingleChannelBeo::handleInput(), main(), packageSensorResult(), and setupVentralPacket(). |
|
|
method to add elements into a message to be sent out
Definition at line 131 of file TCPmessage.C. References Fixation::frame, Fixation::i, Fixation::j, and TCPMSG_FIXATION. Referenced by main(). |
|
|
method to add elements into a message to be sent out
Definition at line 156 of file TCPmessage.C. References TCPMSG_FLOAT. Referenced by TestJoyStickListener::axis(), beowulf_xx_basic_tcpmessage_xx_1(), main(), and setupVentralPacket(). |
|
|
method to add elements into a message to be sent out
Definition at line 114 of file TCPmessage.C. References Image< T >::getArrayPtr(), Image< T >::getHeight(), Image< T >::getSize(), Image< T >::getWidth(), and TCPMSG_FLOATIMA. |
|
|
method to add elements into a message to be sent out
Definition at line 105 of file TCPmessage.C. References Image< T >::getArrayPtr(), Image< T >::getHeight(), Image< T >::getSize(), Image< T >::getWidth(), and TCPMSG_BYTEIMA. |
|
|
method to add elements into a message to be sent out
Definition at line 96 of file TCPmessage.C. References TCPMSG_COLBYTEIMA. Referenced by addImageSet(), beowulf_xx_basic_tcpmessage_xx_1(), SingleChannelBeoServer::check(), computeCMAP(), SingleChannelBeo::handleInput(), main(), BeobotVisualCortex::masterProcess(), TestJoyStickListener::sendData(), sendImageUpdate(), setupVentralPacket(), and submain(). |
|
|
method to add elements into a message to be sent out
Definition at line 123 of file TCPmessage.C. References addImage(), i, ImageSet< T >::size(), and TCPMSG_FLOATIMASET. Referenced by SingleChannelBeoServer::check(), and setupDorsalPacket(). |
|
|
method to add elements into a message to be sent out
Definition at line 144 of file TCPmessage.C. References TCPMSG_INT32. Referenced by TestJoyStickListener::axis(), beowulf_xx_basic_tcpmessage_xx_1(), main(), packageAgentManagerCommand(), packageSensorResult(), setupDorsalPacket(), setupTrackingResultPacket(), setupVentralPacket(), and GSlocalizer::threadCompute(). |
|
|
method to add elements into a message to be sent out
Definition at line 150 of file TCPmessage.C. References TCPMSG_INT64. Referenced by beowulf_xx_basic_tcpmessage_xx_1(). |
|
|
method to add elements into a message to be sent out
Definition at line 138 of file TCPmessage.C. References TCPMSG_STRING. Referenced by beowulf_xx_basic_tcpmessage_xx_1(), SingleChannelBeo::handleInput(), and main(). |
|
|
free memory:
Definition at line 177 of file TCPmessage.C. References h, LERROR, and ArrayHandle< T >::swap(). Referenced by reset(). |
|
|
get message action
Definition at line 344 of file TCPmessage.H. Referenced by TCPcliServ::check(), Beowulf::receive(), and Beowulf::send(). |
|
|
Get a byte image from the message stream. The current message element must have type TCPMSG_BYTEIMA Definition at line 271 of file TCPmessage.C. References TCPMSG_BYTEIMA. Referenced by beowulf_xx_basic_tcpmessage_xx_1(), SingleChannelBeoServer::check(), computeCMAP(), computeCMAP2(), main(), and BeobotVisualCortex::slaveProcess(). |
|
|
Get a color byte image from the message stream. The current message element must have type TCPMSG_COLBYTEIMA Definition at line 264 of file TCPmessage.C. References TCPMSG_COLBYTEIMA. Referenced by beowulf_xx_basic_tcpmessage_xx_1(), checkInMessages(), getSearchCommand(), and main(). |
|
|
Get a double value from the message stream. The current message element must have type TCPMSG_DOUBLE Definition at line 306 of file TCPmessage.C. References TCPMSG_DOUBLE, and unpack(). Referenced by beowulf_xx_basic_tcpmessage_xx_1(), SingleChannelBeoServer::check(), getSearchCommand(), main(), unpackageToSensorResult(), and SingleChannelBeo::waitForOutput(). |
|
|
Get a Fixation from the message stream. The current message element must have type TCPMSG_FIXATION Definition at line 320 of file TCPmessage.C. References TCPMSG_FIXATION. Referenced by main(). |
|
|
Get a float value from the message stream. The current message element must have type TCPMSG_FLOAT Definition at line 313 of file TCPmessage.C. References TCPMSG_FLOAT, and unpack(). Referenced by beowulf_xx_basic_tcpmessage_xx_1(), getSearchCommand(), and main(). |
|
|
Get a float image from the message stream. The current message element must have type TCPMSG_FLOATIMA Definition at line 278 of file TCPmessage.C. References TCPMSG_FLOATIMA. Referenced by beowulf_xx_basic_tcpmessage_xx_1(), SingleChannelBeoServer::check(), main(), BeobotVisualCortex::masterCollect(), BeoSubQtMainForm::parseMessage(), receiveCMAPS(), and SingleChannelBeo::waitForOutput(). |
|
|
Get a float image set from the message stream. The current message element must have type TCPMSG_FLOATIMASET Definition at line 285 of file TCPmessage.C. References TCPMSG_FLOATIMASET. Referenced by getTrackCommand(), and SingleChannelBeo::waitForOutput(). |
|
|
Get an int32 value from the message stream. The current message element must have type TCPMSG_INT32 Definition at line 292 of file TCPmessage.C. References TCPMSG_INT32, and unpack(). Referenced by beowulf_xx_basic_tcpmessage_xx_1(), checkInMessages(), getSearchCommand(), getTrackCommand(), main(), processDorsalResult(), processVentralResult(), and unpackageToSensorResult(). |
|
|
Get an int64 value from the message stream. The current message element must have type TCPMSG_INT64 Definition at line 299 of file TCPmessage.C. References TCPMSG_INT64, and unpack(). Referenced by beowulf_xx_basic_tcpmessage_xx_1(). |
|
||||||||||||
|
DONT'T USE THIS; use one of the type-specific getElement functions below. OK, only use this function if you need to handle multiple possible message types; if you know for sure which type of element you expect, then it is safer and more efficient to call one of the type-specific functions like getElementByteIma() or getElementInt32(); see below. If you do need to use this raw function, then after calling it, typ will contain TCPMSG_xxx so that the type of elem can be inferred. CAUTION: object will be allocated with new; you must delete it when done with it! Definition at line 188 of file TCPmessage.C. References LFATAL, s, TCPMSG_BYTEIMA, TCPMSG_COLBYTEIMA, TCPMSG_DOUBLE, TCPMSG_FIXATION, TCPMSG_FLOAT, TCPMSG_FLOATIMA, TCPMSG_FLOATIMASET, TCPMSG_INT32, TCPMSG_INT64, TCPMSG_STRING, unpack(), and val. |
|
|
Get a string value from the message stream. The current message element must have type TCPMSG_STRING Definition at line 327 of file TCPmessage.C. References ASSERT, TCPMSG_STRING, and unpack(). Referenced by beowulf_xx_basic_tcpmessage_xx_1(), SingleChannelBeoServer::check(), and main(). |
|
|
get message eti (estimated time to idle)
Definition at line 352 of file TCPmessage.H. Referenced by Beowulf::receive(). |
|
|
get message ID
Definition at line 336 of file TCPmessage.H. Referenced by TCPcliServ::check(), computeCMAP(), computeCMAP2(), Beowulf::receive(), and Beowulf::send(). |
|
|
get total message size (mostly for debuging purposes)
Definition at line 356 of file TCPmessage.H. Referenced by TCPcliServ::check(), main(), and processVentralResult(). |
|
|
check whether message is busy (sending or receiving data):
Definition at line 360 of file TCPmessage.H. |
|
|
assignment
Definition at line 84 of file TCPmessage.C. References itsBusy, itsHead, itsMsg, itsUpkidx, and ArrayHandle< T >::swap(). |
|
||||||||||||||||
|
empty old contents and get ready for a re-use:
Definition at line 168 of file TCPmessage.C. References freeMem(). Referenced by TestJoyStickListener::axis(), beowulf_xx_basic_tcpmessage_xx_1(), SingleChannelBeoServer::check(), TCPcliServ::check(), getSearchCommand(), getTrackCommand(), main(), BeobotVisualCortex::masterProcess(), packageAgentManagerCommand(), packageSensorResult(), processDorsalResult(), processVentralResult(), sendImageUpdate(), setupDorsalPacket(), setupTrackingResultPacket(), setupVentralPacket(), submain(), TCPmessage(), and GSlocalizer::threadCompute(). |
|
|
modify message action
Definition at line 340 of file TCPmessage.H. Referenced by main(), BeobotVisualCortex::masterProcess(), and submain(). |
|
|
modify message eti (estimated time to idle)
Definition at line 348 of file TCPmessage.H. |
|
|
modify message ID
Definition at line 332 of file TCPmessage.H. |
|
||||||||||||||||
|
unpack some data from message (memory must be pre-allocated):
Definition at line 398 of file TCPmessage.H. Referenced by getElementDouble(), getElementFloat(), getElementInt32(), getElementInt64(), getElementRaw(), and getElementString(). |
|
|
make our private methods accessible to TCPcliServ:
Definition at line 291 of file TCPmessage.H. |
1.4.4