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 #ifndef msgCompressor_H_
14 #define msgCompressor_H_
15 
16 #include <rtiMsConfig.h>
17 #include <vlutil/vlMachineTypes.h>
18 #include <vlutil/vlSmartPointers.h>
19 #include <vector>
20 
21 #include "msgHeaderReader.h"
22 
25 struct z_stream_s;
26 typedef struct z_stream_s* z_streamp;
27 
32 {
33 public:
34 
36  DtMsgCompressor(DtBoost::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  DtBoost::shared_ptr<DtMsgHeaderReader> myHeaderReader;
78 
80  MAKRti::DtU8 myCompressionLevel;
81 
84 
87 
90 
91 };
92 
93 #endif

Document ID: Generated on Mon Jul 9 10:30:41 EDT 2018 from SVN revision 190224
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)