00001 // ===================================================================== 00002 // $Id: TDataDeflation.hh,v 1.1.1.1 2003/06/27 02:56:42 goiwai Exp $ 00003 // $Name: CLDAQ-1-06-00 $ 00004 // ===================================================================== 00005 #ifndef __TDATADEFLATION_HH 00006 #define __TDATADEFLATION_HH 00007 #ifdef __CLDAQ_ZLIB_USE 00008 00009 #include "Tglobals.h" 00010 00011 // Z_NO_COMPRESSION 0 00012 // Z_BEST_SPEED 1 00013 // Z_BEST_COMPRESSION 9 00014 // Z_DEFAULT_COMPRESSION (-1) 00015 00016 class TDataDeflation 00017 { 00018 00019 private: 00020 enum { tDefaultBufferSize = 1024 * 1024 }; 00021 00022 private: 00023 Tzstream theDeflationStream; 00024 Tint theCompressionLevel; 00025 Tint theStatus; 00026 Tbyte* theOutputBuffer; 00027 Tint theSizeOfOutputBuffer; 00028 Tvoid* theDeflatedData; 00029 Tint theSizeOfDeflatedData; 00030 00031 public: 00032 TDataDeflation( Tint bufsize = tDefaultBufferSize, Tint level = Z_DEFAULT_COMPRESSION ); 00033 TDataDeflation( const TDataDeflation& right ); 00034 ~TDataDeflation(); 00035 00036 public: 00037 const TDataDeflation& operator=( const TDataDeflation& right ); 00038 00039 public: 00040 Tvoid Compress( Tvoid* input, Tint nbyte, Tbool islast = Tfalse ); 00041 00042 public: 00043 const Tzstream& GetDeflationStream() const; 00044 Tzstream& GetDeflationStream(); 00045 Tint GetCompressionLevel() const; 00046 Tint GetStatus() const; 00047 Tint GetSizeOfOutputBuffer() const; 00048 Tvoid* GetDeflatedData() const; 00049 Tint GetSizeOfDeflatedData() const; 00050 Tvoid SetCompressionLevel( Tint level ); 00051 Tvoid SetOutputBuffer( Tint bufsize ); 00052 00053 }; 00054 00055 inline const Tzstream& TDataDeflation::GetDeflationStream() const 00056 { 00057 return( theDeflationStream ); 00058 } 00059 00060 inline Tzstream& TDataDeflation::GetDeflationStream() 00061 { 00062 return( theDeflationStream ); 00063 } 00064 00065 inline Tint TDataDeflation::GetCompressionLevel() const 00066 { 00067 return( theCompressionLevel ); 00068 } 00069 00070 inline Tint TDataDeflation::GetStatus() const 00071 { 00072 return( theStatus ); 00073 } 00074 00075 inline Tint TDataDeflation::GetSizeOfOutputBuffer() const 00076 { 00077 return( theSizeOfOutputBuffer ); 00078 } 00079 00080 inline Tvoid* TDataDeflation::GetDeflatedData() const 00081 { 00082 return( theDeflatedData ); 00083 } 00084 00085 inline Tint TDataDeflation::GetSizeOfDeflatedData() const 00086 { 00087 return( theSizeOfDeflatedData ); 00088 } 00089 00090 #endif 00091 #endif