MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes
DtMsgBundler Class Reference

The DtMsgBundler class provides a means for bundling and unbundling messages. More...

+ Collaboration diagram for DtMsgBundler:

Public Member Functions

 DtMsgBundler (std::shared_ptr< DtMsgHeaderReader > hdrReader, size_t maxBundleSize=0, size_t byteAlignment=0)
 Constructor. More...
 
virtual ~DtMsgBundler ()
 Destructor. More...
 
virtual bool addToBundle (char *msg, size_t msgSize)
 Adds a message to the current bundle. More...
 
virtual bool getBundle (char **bundlePtr, size_t &bundleSize)
 Returns the location and size of the current bundle. More...
 
virtual bool isBundled (const char *bufferPtr, size_t size) const
 Returns true if the given message is bundled. More...
 
virtual bool unbundle (char *bufferPtr, size_t size)
 Unbundle new packet. More...
 
virtual bool isEmpty ()
 Returns true if the msgBundler has no messages. More...
 
virtual bool recvNextMsgFromBundle (char **msgPtr, size_t &msgSize)
 Returns the location and size of the next message in the received bundle. More...
 
virtual size_t maxSendBundleSize () const
 Get/Set the maximum outgoing bundle size. More...
 
virtual void setMaxSendBundleSize (size_t maxSize)
 

Protected Attributes

std::vector< char > mySendBundlingBuff
 The buffer for storing messages in the current outgoing bundle. More...
 
size_t myCurrSendBundleSize
 The size of the current outgoing bundle. More...
 
size_t myRemainingRecvBundleSize
 The remaining size of the current received bundle. More...
 
char * myNextRecvMsg
 The location of the next message in the received bundle. More...
 
bool myResizeSendBuff
 Whether the maximum send bundle must be resized next time it is emptied. More...
 
size_t myNewSendBuffSize
 The new size for the send buffer. More...
 
std::shared_ptr
< DtMsgHeaderReader
myHeaderReader
 Reads data from message header. More...
 
size_t myMsgAddrByteAlignment
 The message address byte alignment. More...
 

Detailed Description

The DtMsgBundler class provides a means for bundling and unbundling messages.

Constructor & Destructor Documentation

DtMsgBundler::DtMsgBundler ( std::shared_ptr< DtMsgHeaderReader hdrReader,
size_t  maxBundleSize = 0,
size_t  byteAlignment = 0 
)

Constructor.

virtual DtMsgBundler::~DtMsgBundler ( )
virtual

Destructor.

Member Function Documentation

virtual bool DtMsgBundler::addToBundle ( char *  msg,
size_t  msgSize 
)
virtual

Adds a message to the current bundle.

Returns false if message was too large to be added to the bundle.

virtual bool DtMsgBundler::getBundle ( char **  bundlePtr,
size_t &  bundleSize 
)
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.

virtual bool DtMsgBundler::isBundled ( const char *  bufferPtr,
size_t  size 
) const
virtual

Returns true if the given message is bundled.

virtual bool DtMsgBundler::isEmpty ( )
virtual

Returns true if the msgBundler has no messages.

virtual size_t DtMsgBundler::maxSendBundleSize ( ) const
virtual

Get/Set the maximum outgoing bundle size.

Changes may not take affect until after the current bundle is sent.

virtual bool DtMsgBundler::recvNextMsgFromBundle ( char **  msgPtr,
size_t &  msgSize 
)
virtual

Returns the location and size of the next message in the received bundle.

Returns false if there were no messages left in bundle.

virtual void DtMsgBundler::setMaxSendBundleSize ( size_t  maxSize)
virtual
virtual bool DtMsgBundler::unbundle ( char *  bufferPtr,
size_t  size 
)
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.

Member Data Documentation

size_t DtMsgBundler::myCurrSendBundleSize
protected

The size of the current outgoing bundle.

std::shared_ptr<DtMsgHeaderReader> DtMsgBundler::myHeaderReader
protected

Reads data from message header.

size_t DtMsgBundler::myMsgAddrByteAlignment
protected

The message address byte alignment.

size_t DtMsgBundler::myNewSendBuffSize
protected

The new size for the send buffer.

char* DtMsgBundler::myNextRecvMsg
protected

The location of the next message in the received bundle.

size_t DtMsgBundler::myRemainingRecvBundleSize
protected

The remaining size of the current received bundle.

bool DtMsgBundler::myResizeSendBuff
protected

Whether the maximum send bundle must be resized next time it is emptied.

std::vector<char> DtMsgBundler::mySendBundlingBuff
protected

The buffer for storing messages in the current outgoing bundle.


The documentation for this class was generated from the following file:

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)