00001 #ifndef CDB_TRANSLATORS_DICT_HH 00002 #define CDB_TRANSLATORS_DICT_HH 00003 00004 // File and Version Information: 00005 // $Id: CdbTranslatorsDict.hh,v 1.1 2005/05/03 20:59:51 gapon Exp $ 00006 00007 #include "CdbBase/CdbTranslatorsDictBase.hh" 00008 00009 #include <map> 00010 00011 /// The dictionary fo user defined translators 00012 /** 00013 * This is an implementation of the base interface class. 00014 * 00015 * @see class CdbTranslatorsDictBase 00016 */ 00017 class CdbTranslatorsDict : public CdbTranslatorsDictBase { 00018 00019 private: 00020 00021 /// The copy constructor (NOT IMPLEMENTED) 00022 00023 CdbTranslatorsDict( const CdbTranslatorsDict& ); 00024 00025 00026 /// The assignment operator (NOT IMPLEMENTED) 00027 00028 CdbTranslatorsDict& operator=( const CdbTranslatorsDict& ); 00029 00030 public: 00031 00032 /// The default constructor 00033 00034 CdbTranslatorsDict( ); 00035 00036 /// The destructor. 00037 00038 virtual ~CdbTranslatorsDict( ); 00039 00040 /// Add a translator 00041 /** 00042 * Implements the corresponding method defined in the base class or the interface. 00043 * 00044 * @see CdbTranslatorsDictBase::add() 00045 */ 00046 virtual CdbStatus add( const CdbCPtr< CdbObjectTranslator>& theTranslatorPtr ); 00047 00048 /// Find a translator by the specified keys 00049 /** 00050 * Implements the corresponding method defined in the base class or the interface. 00051 * 00052 * @see CdbTranslatorsDictBase::find() 00053 */ 00054 virtual CdbCPtr< CdbObjectTranslator > find( unsigned int theTranseintTypeId, 00055 const std::string& thePersistentTypeName 00056 ) const; 00057 private: 00058 00059 struct Persistent { 00060 std::map< std::string, CdbCPtr< CdbObjectTranslator > > _byPersistent; 00061 }; 00062 std::map< unsigned int, CdbTranslatorsDict::Persistent > _byTransient; 00063 }; 00064 00065 #endif // CDB_TRANSLATORS_DICT_HH
1.3-rc3