CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GTSchema.h
Go to the documentation of this file.
1 #ifndef CondCore_CondDB_GTSchema_h
2 #define CondCore_CondDB_GTSchema_h
3 
4 #include "DbCore.h"
5 #include "IDbSchema.h"
6 //
7 #include <boost/date_time/posix_time/posix_time.hpp>
8 
9 namespace cond {
10 
11  namespace persistency {
12 
13  conddb_table(GLOBAL_TAG) {
18  conddb_column(SNAPSHOT_TIME, boost::posix_time::ptime);
19  conddb_column(INSERTION_TIME, boost::posix_time::ptime);
20 
21  class Table : public IGTTable {
22  public:
23  explicit Table(coral::ISchema& schema);
24  ~Table() override {}
25  bool exists() override;
26  void create() override;
27  bool select(const std::string& name) override;
28  bool select(const std::string& name, cond::Time_t& validity, boost::posix_time::ptime& snapshotTime) override;
29  bool select(const std::string& name,
30  cond::Time_t& validity,
33  boost::posix_time::ptime& snapshotTime) override;
34  void insert(const std::string& name,
35  cond::Time_t validity,
36  const std::string& description,
37  const std::string& release,
38  const boost::posix_time::ptime& snapshotTime,
39  const boost::posix_time::ptime& insertionTime) override;
40  void update(const std::string& name,
41  cond::Time_t validity,
42  const std::string& description,
43  const std::string& release,
44  const boost::posix_time::ptime& snapshotTime,
45  const boost::posix_time::ptime& insertionTime) override;
46 
47  private:
48  coral::ISchema& m_schema;
49  };
50  }
51 
52  conddb_table(GLOBAL_TAG_MAP) {
53  static constexpr unsigned int PAYLOAD_HASH_SIZE = 40;
54 
56  // to be changed to RECORD_NAME!
58  // to be changed to RECORD_LABEL!
61 
62  class Table : public IGTMapTable {
63  public:
64  explicit Table(coral::ISchema& schema);
65  ~Table() override {}
66  bool exists() override;
67  void create() override;
68  bool select(const std::string& gtName,
69  std::vector<std::tuple<std::string, std::string, std::string> >& tags) override;
70  bool select(const std::string& gtName,
71  const std::string& preFix,
72  const std::string& postFix,
73  std::vector<std::tuple<std::string, std::string, std::string> >& tags) override;
74  void insert(const std::string& gtName,
75  const std::vector<std::tuple<std::string, std::string, std::string> >& tags) override;
76 
77  private:
78  coral::ISchema& m_schema;
79  };
80  }
81 
82  class GTSchema : public IGTSchema {
83  public:
84  explicit GTSchema(coral::ISchema& schema);
85  ~GTSchema() override {}
86  bool exists() override;
87  void create() override;
88  GLOBAL_TAG::Table& gtTable() override;
90 
91  private:
94  };
95 
96  } // namespace persistency
97 } // namespace cond
98 #endif
void create() override
Definition: GTSchema.cc:131
GLOBAL_TAG::Table m_gtTable
Definition: GTSchema.h:92
GLOBAL_TAG_MAP::Table & gtMapTable() override
Definition: GTSchema.cc:138
#define conddb_column(...)
Definition: DbCore.h:76
GTSchema(coral::ISchema &schema)
Definition: GTSchema.cc:121
unsigned long long Time_t
Definition: Time.h:14
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
bool exists() override
Definition: GTSchema.cc:123
GLOBAL_TAG::Table & gtTable() override
Definition: GTSchema.cc:136
#define update(a, b)
GLOBAL_TAG_MAP::Table m_gtMapTable
Definition: GTSchema.h:93
static constexpr unsigned int PAYLOAD_HASH_SIZE
Definition: GTSchema.h:53
#define conddb_table(NAME)
Definition: DbCore.h:49