CMS 3D CMS Logo

DTConfigHandler.h

Go to the documentation of this file.
00001 #ifndef DTConfigHandler_H
00002 #define DTConfigHandler_H
00003 
00014 //----------------------
00015 // Base Class Headers --
00016 //----------------------
00017 
00018 
00019 //------------------------------------
00020 // Collaborating Class Declarations --
00021 //------------------------------------
00022 #include "CondFormats/DTObjects/interface/DTConfigList.h"
00023 #include "CondFormats/DTObjects/interface/DTConfigData.h"
00024 #include "CondCore/DBCommon/interface/TypedRef.h"
00025 class DTDBSession;
00026 
00027 //---------------
00028 // C++ Headers --
00029 //---------------
00030 #include <string>
00031 #include <map>
00032 
00033 //              ---------------------
00034 //              -- Class Interface --
00035 //              ---------------------
00036 
00037 class DTConfigHandler {
00038 
00039  public:
00040 
00043 
00044   static DTConfigHandler* create( DTDBSession* session,
00045                                   const std::string& token );
00046   static void remove( const DTDBSession* session );
00047   static void remove( const DTConfigHandler* handler );
00048 
00050   const DTConfigList* getContainer();
00051   int get( int cfgId, DTConfigData*& obj );
00052 
00053   void getData( int cfgId, std::vector<const std::string*>& list );
00054 
00055   int set( int cfgId, const std::string& token );
00057   typedef std::map< int, cond::TypedRef<DTConfigData>* >::const_iterator
00058                                                           const_iterator;
00059   const_iterator begin() const;
00060   const_iterator end() const;
00061 
00063   void purge();
00064 
00066   std::string clone( DTDBSession* newSession,
00067                      const std::string& newToken,
00068                      const std::string& objContainer,
00069                      const std::string& refContainer );
00070 
00071   static int maxBrickNumber;
00072   static int maxStringNumber;
00073   static int maxByteNumber;
00074 
00075  private:
00076 
00079   DTConfigHandler( DTDBSession* session, const std::string& token );
00080   DTConfigHandler( const DTConfigHandler& x );
00081   const DTConfigHandler& operator=( const DTConfigHandler& x );
00082 
00085   virtual ~DTConfigHandler();
00086 
00087   std::string clone( DTDBSession* newSession,
00088                      const std::string& objContainer,
00089                      const std::string& refContainer );
00090 
00091   static std::string compToken( const std::string& token, int id );
00092   static int         compToken( const std::string& token );
00093 
00094   DTDBSession* dbSession;
00095   std::string objToken;
00096   cond::TypedRef<DTConfigList>* refSet;
00097   std::map<int,cond::TypedRef<DTConfigData>*> refMap;
00098   int cachedBrickNumber;
00099   int cachedStringNumber;
00100   int cachedByteNumber;
00101 
00102 //  typedef std::map<unsigned int,DTConfigHandler*> handler_map;
00103   typedef std::map<const DTDBSession*,DTConfigHandler*> handler_map;
00104   typedef handler_map::const_iterator c_map_iter;
00105   typedef handler_map::iterator         map_iter;
00106   static handler_map handlerMap;
00107 
00108 };
00109 
00110 
00111 #endif // DTConfigHandler_H
00112 
00113 
00114 
00115 
00116 
00117 

Generated on Tue Jun 9 17:26:50 2009 for CMSSW by  doxygen 1.5.4