Octane v1.01.20 - The Open Compression Toolkit for C++ | http://octane.sourceforge.net/ |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 //--------------------------------------------------------------------------- 00013 00014 //--------------------------------------------------------------------------- 00015 // recursive header protection 00016 #ifndef OctaneCompressor_StatisticalH 00017 #define OctaneCompressor_StatisticalH 00018 //--------------------------------------------------------------------------- 00019 00020 //--------------------------------------------------------------------------- 00021 // application includes 00022 #include "../modelers/modeler.hpp" 00023 #include "../parsers/parser.hpp" 00024 #include "../coders/coder.hpp" 00025 #include "../bitio/bitio.hpp" 00026 #include "compressor.hpp" 00027 #include "../core/compressormanager.hpp" 00028 //--------------------------------------------------------------------------- 00029 00030 00031 00032 //--------------------------------------------------------------------------- 00039 class OctaneCompressor_Statistical : public OctaneCompressor 00040 { 00041 protected: 00042 // children components 00044 OctaneParser* parserp; 00046 OctaneModeler* modelerp; 00048 OctaneCoder* coderp; 00049 public: 00051 OctaneCompressor_Statistical(bool registerme=false); 00053 virtual ~OctaneCompressor_Statistical(); 00054 public: 00055 //--------------------------------------------------------------------------- 00056 // OCTANE PUBLIC API - RTTI AND HELP FUNCTIONS - these are supported by all derived classes 00057 virtual std::string GetClassName() {return "StatisticalCompressorBase";} 00058 virtual std::string GetDescription() {return "Statistical Compressor Base Class";} 00059 virtual std::string GetHelpInformation(); 00060 //--------------------------------------------------------------------------- 00061 public: 00062 //--------------------------------------------------------------------------- 00063 // OCTANE PUBLIC API - AUXILIARY FUNCTIONS - these are supported by all derived classes 00064 virtual void ShowDebuggingInfo(); 00065 virtual unsigned int GetMemoryUsed(); 00066 virtual unsigned int GetDiskspaceUsed(bool fortempdecompressiononly); 00067 virtual std::string GetParametersInformation(); 00068 virtual void SetDefaultParameters(); 00069 virtual bool SetParameter(const std::string ¶metername,const std::string ¶metervalue); 00070 //--------------------------------------------------------------------------- 00071 public: 00072 //--------------------------------------------------------------------------- 00073 // COMPRESSOR PUBLIC API - PREPARATION FOR COMPRESSING/DECOMPRESSING 00074 virtual void ResetState(); 00075 virtual void SynchronizeStateForNewStream(); 00076 virtual bool PrepareForCompression(); 00077 virtual void SetupAnyDefaultParser(); 00078 virtual bool IsReadyToCompress(); 00079 //--------------------------------------------------------------------------- 00080 protected: 00081 //--------------------------------------------------------------------------- 00082 // COMPRESSOR DERIVED COMPRESSION/DECOMPRESSING - implement these in derived classes 00083 virtual bool DoProtectedCompress(bitreader &from, bitwriter &to); 00084 virtual bool DoProtectedDecompress(bitreader &from, bitwriter &to); 00085 //--------------------------------------------------------------------------- 00086 protected: 00087 //--------------------------------------------------------------------------- 00088 // OCTANE PROTECTED DERIVED STATE LOADING AND SAVING 00089 virtual bool DoProtectedCreateSymbolsAndModelsUsingStream(bitreader &from); 00090 virtual bool DoProtectedSaveState(bitwriter &to,bool fortempdecompressiononly); 00091 virtual bool DoProtectedLoadState(bitreader &from); 00092 //--------------------------------------------------------------------------- 00093 }; 00094 //--------------------------------------------------------------------------- 00095 00096 00097 00098 00099 00100 00101 //--------------------------------------------------------------------------- 00102 #endif 00103 //--------------------------------------------------------------------------- 00104