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 void (*p_bes_uncompress)( const string &src, const string &target ) ;
00047
00066 class BESUncompressManager : public BESObj
00067 {
00068 private:
00069 static BESUncompressManager * _instance ;
00070 map< string, p_bes_uncompress > _uncompress_list ;
00071 unsigned int _retry ;
00072 unsigned int _num_tries ;
00073
00074 typedef map< string, p_bes_uncompress >::const_iterator UCIter ;
00075 typedef map< string, p_bes_uncompress >::iterator UIter ;
00076 protected:
00077 BESUncompressManager(void) ;
00078 public:
00079 virtual ~BESUncompressManager(void) {}
00080
00081 virtual bool add_method( const string &name,
00082 p_bes_uncompress method ) ;
00083 virtual bool remove_method( const string &name ) ;
00084 virtual p_bes_uncompress find_method( const string &name ) ;
00085
00086 virtual string get_method_names() ;
00087
00088 virtual bool uncompress( const string &src,
00089 string &target,
00090 BESCache &cache ) ;
00091
00092 virtual void dump( ostream &strm ) const ;
00093
00094 static BESUncompressManager * TheManager() ;
00095 };
00096
00097 #endif // I_BESUncompressManager_h
00098