00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef I_BESUncompressManager_h
00034 #define I_BESUncompressManager_h 1
00035
00036 #include <map>
00037 #include <string>
00038
00039 using std::map ;
00040 using std::string ;
00041
00042 #include "BESObj.h"
00043
00044 class BESCache ;
00045
00046 typedef string (*p_bes_uncompress)( const string &src, const string &target ) ;
00047
00060 class BESUncompressManager : public BESObj
00061 {
00062 private:
00063 static BESUncompressManager * _instance ;
00064 map< string, p_bes_uncompress > _uncompress_list ;
00065 unsigned int _retry ;
00066 unsigned int _num_tries ;
00067
00068 typedef map< string, p_bes_uncompress >::const_iterator UCIter ;
00069 typedef map< string, p_bes_uncompress >::iterator UIter ;
00070 protected:
00071 BESUncompressManager(void) ;
00072 public:
00073 virtual ~BESUncompressManager(void) {}
00074
00075 virtual bool add_method( const string &name,
00076 p_bes_uncompress method ) ;
00077 virtual bool remove_method( const string &name ) ;
00078 virtual p_bes_uncompress find_method( const string &name ) ;
00079
00080 virtual string get_method_names() ;
00081
00082 virtual string uncompress( const string &src,
00083 BESCache &cache ) ;
00084
00085 virtual void dump( ostream &strm ) const ;
00086
00087 static BESUncompressManager * TheManager() ;
00088 };
00089
00090 #endif // I_BESUncompressManager_h
00091