File indexing completed on 2024-04-06 12:02:45
0001 #ifndef CondTools_DT_DTKeyedConfigCache_h
0002 #define CondTools_DT_DTKeyedConfigCache_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
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
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