MAK RTIspy API Documentation for HLA 1.3
Public Member Functions | Protected Attributes
DtMsgCompressor Class Reference

The DtMsgCompressor class provides a means for compressing and uncompressing messages. More...

+ Collaboration diagram for DtMsgCompressor:

List of all members.

Public Member Functions

 DtMsgCompressor (DtBoost::shared_ptr< DtMsgHeaderReader > hdrReader, size_t maxUncompressedMsgSize, MAKRti::DtU8 compressionLevel=1)
 Constructor.
virtual ~DtMsgCompressor ()
 Destructor.
virtual bool compressMsg (char *msg, size_t msgSize, char **compressedMsg, size_t &compressedSize)
 Compresses the message.
virtual bool isCompressed (const char *bufferPtr, size_t size) const
 Returns true if the given message is compressed.
virtual bool uncompressMsg (char *msg, size_t msgSize, char **uncompressedMsg, size_t &uncompressedSize)
 Uncompresses the message.
virtual MAKRti::DtU8 compressionLevel () const
 Get/Set the compression level.
virtual void setCompressionLevel (MAKRti::DtU8 level)
virtual size_t maxUncompressedMsgSize () const
 Get the maximum size of uncompressed messages.

Protected Attributes

std::vector< char > myCompressedBuffer
 Buffer for storing outgoing messages after they have been compressed.
std::vector< char > myUncompressedBuffer
 Buffer for storing incoming messages after they have been uncompressed.
size_t myUncompressedDataSize
 Size of the data in the uncompressed buffer.
DtBoost::shared_ptr
< DtMsgHeaderReader
myHeaderReader
 Reads data from message header.
MAKRti::DtU8 myCompressionLevel
 The compression level.
size_t myMaxUncompressedMsgSize
 The maximum size of uncompressed messages.
z_streamp myCompressionStream
 Pointer to ZLIB stream structure used for compression.
z_streamp myUncompressionStream
 Pointer to ZLIB stream structure used for decompression.

Detailed Description

The DtMsgCompressor class provides a means for compressing and uncompressing messages.


Constructor & Destructor Documentation

DtMsgCompressor::DtMsgCompressor ( DtBoost::shared_ptr< DtMsgHeaderReader hdrReader,
size_t  maxUncompressedMsgSize,
MAKRti::DtU8  compressionLevel = 1 
)

Destructor.

References myCompressionStream, and myUncompressionStream.


Member Function Documentation

virtual MAKRti::DtU8 DtMsgCompressor::compressionLevel ( ) const [inline, virtual]

Get/Set the compression level.

Referenced by DtTcpMsgSocket::compressionLevel().

bool DtMsgCompressor::compressMsg ( char *  msg,
size_t  msgSize,
char **  compressedMsg,
size_t &  compressedSize 
) [virtual]

Compresses the message.

Returns true if the message was compressed. Fills in the location and size of the compressed message if the message is successfully compressed.

References myCompressedBuffer, myCompressionStream, and myHeaderReader.

Referenced by DtUdpMsgSocket::sendMessage(), and DtTcpMsgSocket::sendMessage().

bool DtMsgCompressor::isCompressed ( const char *  bufferPtr,
size_t  size 
) const [virtual]

Returns true if the given message is compressed.

References myHeaderReader.

Referenced by DtUdpMsgSocket::recv(), and DtTcpMsgSocket::recvMessage().

virtual size_t DtMsgCompressor::maxUncompressedMsgSize ( ) const [inline, virtual]

Get the maximum size of uncompressed messages.

Used for internal buffer sizes.

void DtMsgCompressor::setCompressionLevel ( MAKRti::DtU8  level) [virtual]
bool DtMsgCompressor::uncompressMsg ( char *  msg,
size_t  msgSize,
char **  uncompressedMsg,
size_t &  uncompressedSize 
) [virtual]

Uncompresses the message.

Returns true if the message was uncompressed. Fills in the location and size of the uncompressed message if a full message is successfully uncompressed.

References myHeaderReader, myUncompressedBuffer, and myUncompressionStream.

Referenced by DtUdpMsgSocket::recv(), and DtTcpMsgSocket::recvMessage().


Member Data Documentation

std::vector<char> DtMsgCompressor::myCompressedBuffer [protected]

Buffer for storing outgoing messages after they have been compressed.

Referenced by compressMsg(), and DtMsgCompressor().

MAKRti::DtU8 DtMsgCompressor::myCompressionLevel [protected]

The compression level.

Referenced by DtMsgCompressor(), and setCompressionLevel().

Pointer to ZLIB stream structure used for compression.

Referenced by compressMsg(), DtMsgCompressor(), and ~DtMsgCompressor().

DtBoost::shared_ptr<DtMsgHeaderReader> DtMsgCompressor::myHeaderReader [protected]

Reads data from message header.

Referenced by compressMsg(), isCompressed(), and uncompressMsg().

The maximum size of uncompressed messages.

Referenced by DtMsgCompressor().

std::vector<char> DtMsgCompressor::myUncompressedBuffer [protected]

Buffer for storing incoming messages after they have been uncompressed.

Referenced by DtMsgCompressor(), and uncompressMsg().

Size of the data in the uncompressed buffer.

Pointer to ZLIB stream structure used for decompression.

Referenced by DtMsgCompressor(), uncompressMsg(), and ~DtMsgCompressor().


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

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)