CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 ) {
14 
19  conddb_column( SNAPSHOT_TIME, boost::posix_time::ptime );
20  conddb_column( INSERTION_TIME, boost::posix_time::ptime );
21 
22  class Table : public IGTTable {
23  public:
24  explicit Table( coral::ISchema& schema );
25  virtual ~Table(){}
26  bool exists();
27  void create();
28  bool select( const std::string& name);
29  bool select( const std::string& name, cond::Time_t& validity, boost::posix_time::ptime& snapshotTime );
30  bool select( const std::string& name, cond::Time_t& validity, std::string& description,
31  std::string& release, boost::posix_time::ptime& snapshotTime );
32  void insert( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
33  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime );
34  void update( const std::string& name, cond::Time_t validity, const std::string& description, const std::string& release,
35  const boost::posix_time::ptime& snapshotTime, const boost::posix_time::ptime& insertionTime );
36  private:
37  coral::ISchema& m_schema;
38  };
39  }
40 
41  conddb_table ( GLOBAL_TAG_MAP ) {
42 
43  static constexpr unsigned int PAYLOAD_HASH_SIZE = 40;
44 
46  // to be changed to RECORD_NAME!
48  // to be changed to RECORD_LABEL!
51 
52  class Table : public IGTMapTable {
53  public:
54  explicit Table( coral::ISchema& schema );
55  virtual ~Table(){}
56  bool exists();
57  void create();
58  bool select( const std::string& gtName, std::vector<std::tuple<std::string,std::string,std::string> >& tags );
59  bool select( const std::string& gtName, const std::string& preFix, const std::string& postFix,
60  std::vector<std::tuple<std::string,std::string,std::string> >& tags );
61  void insert( const std::string& gtName, const std::vector<std::tuple<std::string,std::string,std::string> >& tags );
62  private:
63  coral::ISchema& m_schema;
64  };
65  }
66 
67  class GTSchema : public IGTSchema {
68  public:
69  explicit GTSchema( coral::ISchema& schema );
70  virtual ~GTSchema(){}
71  bool exists();
72  void create();
75  private:
78  };
79 
80  }
81 }
82 #endif
GLOBAL_TAG::Table & gtTable()
Definition: GTSchema.cc:140
tuple schema
Definition: dataDML.py:2334
GLOBAL_TAG::Table m_gtTable
Definition: GTSchema.h:76
#define conddb_column(...)
Definition: DbCore.h:74
#define constexpr
GTSchema(coral::ISchema &schema)
Definition: GTSchema.cc:124
unsigned long long Time_t
Definition: Time.h:16
GLOBAL_TAG_MAP::Table & gtMapTable()
Definition: GTSchema.cc:144
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:49
tuple tags
Definition: o2o.py:248
tuple description
Definition: idDealer.py:66
static unsigned int PAYLOAD_HASH_SIZE
Definition: GTSchema.h:43
#define update(a, b)
GLOBAL_TAG_MAP::Table m_gtMapTable
Definition: GTSchema.h:77
#define conddb_table(NAME)
Definition: DbCore.h:49