Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:47:47

0001 #ifndef CondTools_DT_DTKeyedConfigCache_h
0002 #define CondTools_DT_DTKeyedConfigCache_h
0003 /** \class DTKeyedConfigCache
0004  *
0005  *  Description:
0006  *       Class to hold configuration identifier for chambers
0007  *
0008  *  This class was originally defined in
0009  *  CondCore/DTPlugins/interface/DTConfigPluginHandler.h
0010  *  It was moved, renamed, and modified to not be a singleton
0011  *  for thread safety, but otherwise little was changed.
0012  *
0013  *  \author Paolo Ronchese INFN Padova
0014  *
0015  */
0016 
0017 #include <map>
0018 #include <string>
0019 #include <vector>
0020 
0021 #include "CondCore/CondDB/interface/KeyList.h"
0022 
0023 class DTKeyedConfig;
0024 
0025 //              ---------------------
0026 //              -- Class Interface --
0027 //              ---------------------
0028 
0029 class DTKeyedConfigCache {
0030 public:
0031   DTKeyedConfigCache();
0032   DTKeyedConfigCache(const DTKeyedConfigCache& x) = delete;
0033   const DTKeyedConfigCache& operator=(const DTKeyedConfigCache& x) = delete;
0034   virtual ~DTKeyedConfigCache();
0035 
0036   int get(const cond::persistency::KeyList& keyList, int cfgId, const DTKeyedConfig*& obj);
0037 
0038   void getData(const cond::persistency::KeyList& keyList, int cfgId, std::vector<std::string>& list);
0039 
0040   void purge();
0041 
0042   static const int maxBrickNumber;
0043   static const int maxStringNumber;
0044   static const int maxByteNumber;
0045 
0046 private:
0047   typedef std::pair<int, const DTKeyedConfig*> counted_brick;
0048   std::map<int, counted_brick> brickMap;
0049   int cachedBrickNumber;
0050   int cachedStringNumber;
0051   int cachedByteNumber;
0052 };
0053 #endif