![]() |
MAK RTIspy API Documentation for HLA Evolved
|
The DtMsgBundler class provides a means for bundling and unbundling messages. More...
Collaboration diagram for DtMsgBundler:Public Member Functions | |
| DtMsgBundler (DtBoost::shared_ptr< DtMsgHeaderReader > hdrReader, size_t maxBundleSize=0) | |
| Constructor. | |
| virtual | ~DtMsgBundler () |
| Destructor. | |
| virtual bool | addToBundle (char *msg, size_t msgSize) |
| Adds a message to the current bundle. | |
| virtual bool | getBundle (char **bundlePtr, size_t &bundleSize) |
| Returns the location and size of the current bundle. | |
| virtual bool | isBundled (const char *bufferPtr, size_t size) const |
| Returns true if the given message is bundled. | |
| virtual bool | unbundle (char *bufferPtr, size_t size) |
| Unbundle new packet. | |
| virtual bool | isEmpty () |
| Returns true if the msgBundler has no messages. | |
| virtual bool | recvNextMsgFromBundle (char **msgPtr, size_t &msgSize) |
| Returns the location and size of the next message in the received bundle. | |
| virtual size_t | maxSendBundleSize () const |
| Get/Set the maximum outgoing bundle size. | |
| virtual void | setMaxSendBundleSize (size_t maxSize) |
Protected Attributes | |
| std::vector< char > | mySendBundlingBuff |
| The buffer for storing messages in the current outgoing bundle. | |
| size_t | myCurrSendBundleSize |
| The size of the current outgoing bundle. | |
| size_t | myRemainingRecvBundleSize |
| The remaining size of the current received bundle. | |
| char * | myNextRecvMsg |
| The location of the next message in the received bundle. | |
| bool | myResizeSendBuff |
| Whether the maximum send bundle must be resized next time it is emptied. | |
| size_t | myNewSendBuffSize |
| The new size for the send buffer. | |
| DtBoost::shared_ptr < DtMsgHeaderReader > | myHeaderReader |
| Reads data from message header. | |
The DtMsgBundler class provides a means for bundling and unbundling messages.
| DtMsgBundler::DtMsgBundler | ( | DtBoost::shared_ptr< DtMsgHeaderReader > | hdrReader, |
| size_t | maxBundleSize = 0 |
||
| ) |
Constructor.
|
virtual |
Destructor.
|
virtual |
Adds a message to the current bundle.
Returns false if message was too large to be added to the bundle.
References myCurrSendBundleSize, myHeaderReader, and mySendBundlingBuff.
Referenced by DtUdpMsgSocket::sendMessage(), and DtTcpMsgSocket::sendMessage().
|
virtual |
Returns the location and size of the current bundle.
A new bundle will be started the next time addToBundle is called. Return value is false if there are no bundled messages.
References myCurrSendBundleSize, myNewSendBuffSize, myResizeSendBuff, and mySendBundlingBuff.
Referenced by DtUdpMsgSocket::flush(), DtTcpMsgSocket::flush(), DtUdpMsgSocket::sendMessage(), and DtTcpMsgSocket::sendMessage().
|
virtual |
Returns true if the given message is bundled.
References myHeaderReader.
Referenced by DtUdpMsgSocket::recv().
|
virtual |
Returns true if the msgBundler has no messages.
References myCurrSendBundleSize.
|
virtual |
Get/Set the maximum outgoing bundle size.
Changes may not take affect until after the current bundle is sent.
References myNewSendBuffSize, myResizeSendBuff, and mySendBundlingBuff.
Referenced by DtTcpMsgSocket::bundleSize(), and DtUdpMsgSocket::sendMessage().
|
virtual |
Returns the location and size of the next message in the received bundle.
Returns false if there were no messages left in bundle.
References myHeaderReader, myNextRecvMsg, and myRemainingRecvBundleSize.
Referenced by DtUdpMsgSocket::recv().
|
virtual |
References myCurrSendBundleSize, myNewSendBuffSize, myResizeSendBuff, and mySendBundlingBuff.
Referenced by DtUdpMsgSocket::enableBundling(), and DtTcpMsgSocket::enableBundling().
|
virtual |
Unbundle new packet.
Buffer must remain valid until bundle is completely processed. If unbundling already in progress, previous bundle is lost. Returns false if an error occurs.
References myNextRecvMsg, and myRemainingRecvBundleSize.
Referenced by DtUdpMsgSocket::recv().
|
protected |
The size of the current outgoing bundle.
Referenced by addToBundle(), getBundle(), isEmpty(), and setMaxSendBundleSize().
|
protected |
Reads data from message header.
Referenced by addToBundle(), isBundled(), and recvNextMsgFromBundle().
|
protected |
The new size for the send buffer.
Referenced by getBundle(), maxSendBundleSize(), and setMaxSendBundleSize().
|
protected |
The location of the next message in the received bundle.
Referenced by recvNextMsgFromBundle(), and unbundle().
|
protected |
The remaining size of the current received bundle.
Referenced by recvNextMsgFromBundle(), and unbundle().
|
protected |
Whether the maximum send bundle must be resized next time it is emptied.
Referenced by getBundle(), maxSendBundleSize(), and setMaxSendBundleSize().
|
protected |
The buffer for storing messages in the current outgoing bundle.
Referenced by addToBundle(), getBundle(), maxSendBundleSize(), and setMaxSendBundleSize().