CMS 3D CMS Logo

GTEditor.h
Go to the documentation of this file.
1 #ifndef CondCore_CondDB_GTEditor_h
2 #define CondCore_CondDB_GTEditor_h
3 //
4 // Package: CondDB
5 // Class : GTEditor
6 //
10 //
11 // Author: Giacomo Govi
12 // Created: Jul 2013
13 //
14 
17 //
18 #include <boost/date_time/posix_time/posix_time.hpp>
19 
20 namespace cond {
21 
22  namespace persistency {
23 
24  class SessionImpl;
25  class GTEditorData;
26 
27  // value semantics...
28  class GTEditor {
29  public:
30  // default ctor
31  GTEditor();
32 
33  // ctor
34  explicit GTEditor(const std::shared_ptr<SessionImpl>& session);
35 
36  // ctor used after new tag creation. the specified params are assumed and passed directly to the object.
37  GTEditor(const std::shared_ptr<SessionImpl>& session, const std::string& gtName);
38 
39  //
40  GTEditor(const GTEditor& rhs);
41 
42  //
43  GTEditor& operator=(const GTEditor& rhs);
44 
45  // loads to tag to edit
46  void load(const std::string& gtName);
47 
48  // read only getters. they could be changed to return references...
49  std::string name() const;
50 
51  // getters/setters for the updatable parameters
52  cond::Time_t validity() const;
54 
55  std::string description() const;
57 
58  std::string release() const;
59  void setRelease(const std::string& release);
60 
61  boost::posix_time::ptime snapshotTime() const;
62  void setSnapshotTime(const boost::posix_time::ptime& snapshotTime);
63 
64  // register a new insertion.
65  // if checkType==true, the object type declared for the tag is verified to be the same type as the iov payloadObjectType record object type.
66  void insert(const std::string& recordName, const std::string& tagName, bool checkType = false);
67  void insert(const std::string& recordName,
68  const std::string& recordLabel,
69  const std::string& tagName,
70  bool checkType = false);
71 
72  // execute the update/intert queries and reset the buffer
73  bool flush();
74  // execute the update/intert queries and reset the buffer
75  bool flush(const boost::posix_time::ptime& operationTime);
76 
77  private:
78  void checkTransaction(const std::string& ctx);
79 
80  private:
81  std::shared_ptr<GTEditorData> m_data;
82  std::shared_ptr<SessionImpl> m_session;
83  };
84 
85  } // namespace persistency
86 } // namespace cond
87 
88 #endif
cond::persistency::GTEditor::setRelease
void setRelease(const std::string &release)
Definition: GTEditor.cc:78
cond::persistency::GTEditor::insert
void insert(const std::string &recordName, const std::string &tagName, bool checkType=false)
Definition: GTEditor.cc:96
cond::persistency::GTEditor::snapshotTime
boost::posix_time::ptime snapshotTime() const
Definition: GTEditor.cc:85
cond::persistency::GTEditor::release
std::string release() const
Definition: GTEditor.cc:76
align_cfg.recordName
recordName
Definition: align_cfg.py:66
cond::persistency::GTEditor::setValidity
void setValidity(cond::Time_t validity)
Definition: GTEditor.cc:60
cond::persistency::GTEditor::GTEditor
GTEditor()
Definition: GTEditor.cc:25
cond::persistency::GTEditor::load
void load(const std::string &gtName)
Definition: GTEditor.cc:43
cond::persistency::GTEditor::checkTransaction
void checkTransaction(const std::string &ctx)
Definition: GTEditor.cc:146
cond::persistency::GTEditor::description
std::string description() const
Definition: GTEditor.cc:67
cond::persistency::GTEditor::m_session
std::shared_ptr< SessionImpl > m_session
Definition: GTEditor.h:82
cond
Definition: plugin.cc:23
cond::persistency::GTEditor
Definition: GTEditor.h:28
HLT_FULL_cff.recordLabel
recordLabel
Definition: HLT_FULL_cff.py:6769
Time.h
createPayload.checkType
checkType
Definition: createPayload.py:383
cond::persistency::GTEditor::setSnapshotTime
void setSnapshotTime(const boost::posix_time::ptime &snapshotTime)
Definition: GTEditor.cc:89
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
cond::persistency::GTEditor::flush
bool flush()
Definition: GTEditor.cc:144
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cond::persistency::GTEditor::validity
cond::Time_t validity() const
Definition: GTEditor.cc:58
cond::persistency::GTEditor::setDescription
void setDescription(const std::string &description)
Definition: GTEditor.cc:69
cond::persistency::GTEditor::m_data
std::shared_ptr< GTEditorData > m_data
Definition: GTEditor.h:81
cond::persistency::GTEditor::name
std::string name() const
Definition: GTEditor.cc:56
cond::persistency::GTEditor::operator=
GTEditor & operator=(const GTEditor &rhs)
Definition: GTEditor.cc:37
Types.h
JetPartonCorrections_cff.tagName
tagName
Definition: JetPartonCorrections_cff.py:12