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 // application includes 00013 #include "substrhuff.hpp" 00014 // system includes 00015 using namespace std; 00016 //--------------------------------------------------------------------------- 00017 00018 00019 //--------------------------------------------------------------------------- 00020 // Create a global instance in order to register it automatically with the global manager 00021 SubStrHuffCompressor GloballyInstantiated_SubStrHuffCompressor(true); 00022 //--------------------------------------------------------------------------- 00023 00024 00025 //--------------------------------------------------------------------------- 00026 SubStrHuffCompressor::SubStrHuffCompressor(bool registerme) 00027 :OctaneCompressor_Statistical(registerme) 00028 { 00029 // create the children objects 00030 parserp=new SubstringParser(); 00031 modelerp=new ZeroOrderModeler(); 00032 coderp=new HuffmanCoder(); 00033 00034 // REGISTER WITH COMPRESSOR MANAGER 00035 // this use a trick to make sure the global manager is ready for registration 00036 // and at the same time automatically register this instance with the global manager 00037 // note that the insurer is just temporary, and deletes when we exit the procedure 00038 if (registerme) 00039 CompressorManager_SingletonInsurer managerinsurance(this); 00040 00041 // now default setup of components 00042 SetupAnyDefaultParser(); 00043 } 00044 //---------------------------------------------------------------------------