MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
msgCompressor.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2010 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: msgCompressor.h,v $ $Revision: $ $State: Exp $
7 *********************************************************************/
8 
12 
13 #pragma once
14 
15 #include "rtiMsConfig.h"
16 #include "msgHeaderReader.h"
17 
18 #include <vlutil/vlMachineTypes.h>
19 #include <vlutil/vlSmartPointers.h>
20 
21 #include <vector>
22 
25 struct z_stream_s;
26 typedef struct z_stream_s* z_streamp;
27 
32 {
33 public:
34 
36  DtMsgCompressor(std::shared_ptr<DtMsgHeaderReader> hdrReader,
37  size_t maxUncompressedMsgSize, MAKRti::DtU8 compressionLevel = 1);
38 
40  virtual ~DtMsgCompressor();
41 
45  virtual bool compressMsg(char* msg, size_t msgSize, char** compressedMsg,
46  size_t& compressedSize);
47 
49  virtual bool isCompressed(const char* bufferPtr, size_t size) const;
50 
54  virtual bool uncompressMsg(char* msg, size_t msgSize, char** uncompressedMsg,
55  size_t& uncompressedSize);
56 
58  virtual MAKRti::DtU8 compressionLevel() const { return myCompressionLevel; }
59  virtual void setCompressionLevel(MAKRti::DtU8 level);
60 
63  virtual size_t maxUncompressedMsgSize() const { return myMaxUncompressedMsgSize; }
64 
65 protected:
66 
68  std::vector<char> myCompressedBuffer;
69 
71  std::vector<char> myUncompressedBuffer;
72 
75 
77  std::shared_ptr<DtMsgHeaderReader> myHeaderReader;
78 
80  MAKRti::DtU8 myCompressionLevel;
81 
84 
87 
90 
91 };
z_streamp myUncompressionStream
Pointer to ZLIB stream structure used for decompression.
Definition: msgCompressor.h:89
z_streamp myCompressionStream
Pointer to ZLIB stream structure used for compression.
Definition: msgCompressor.h:86
std::vector< char > myCompressedBuffer
Buffer for storing outgoing messages after they have been compressed.
Definition: msgCompressor.h:68
size_t myMaxUncompressedMsgSize
The maximum size of uncompressed messages.
Definition: msgCompressor.h:83
The DtMsgCompressor class provides a means for compressing and uncompressing messages.
Definition: msgCompressor.h:31
std::shared_ptr< DtMsgHeaderReader > myHeaderReader
Reads data from message header.
Definition: msgCompressor.h:77
struct z_stream_s * z_streamp
Definition: msgCompressor.h:26
MAKRti::DtU8 myCompressionLevel
The compression level.
Definition: msgCompressor.h:80
size_t myUncompressedDataSize
Size of the data in the uncompressed buffer.
Definition: msgCompressor.h:74
virtual MAKRti::DtU8 compressionLevel() const
Get/Set the compression level.
Definition: msgCompressor.h:58
virtual size_t maxUncompressedMsgSize() const
Get the maximum size of uncompressed messages.
Definition: msgCompressor.h:63
std::vector< char > myUncompressedBuffer
Buffer for storing incoming messages after they have been uncompressed.
Definition: msgCompressor.h:71
#define DT_DLL_RTIUTIL
Definition: rtiMsConfig.h:160

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)