File indexing completed on 2023-03-17 10:45:48
0001 #ifndef CondCore_CondDB_GTEditor_h
0002 #define CondCore_CondDB_GTEditor_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include "CondCore/CondDB/interface/Time.h"
0016 #include "CondCore/CondDB/interface/Types.h"
0017
0018 #include <boost/date_time/posix_time/posix_time.hpp>
0019
0020 namespace cond {
0021
0022 namespace persistency {
0023
0024 class SessionImpl;
0025 class GTEditorData;
0026
0027
0028 class GTEditor {
0029 public:
0030
0031 GTEditor();
0032
0033
0034 explicit GTEditor(const std::shared_ptr<SessionImpl>& session);
0035
0036
0037 GTEditor(const std::shared_ptr<SessionImpl>& session, const std::string& gtName);
0038
0039
0040 GTEditor(const GTEditor& rhs);
0041
0042
0043 GTEditor& operator=(const GTEditor& rhs);
0044
0045
0046 void load(const std::string& gtName);
0047
0048
0049 std::string name() const;
0050
0051
0052 cond::Time_t validity() const;
0053 void setValidity(cond::Time_t validity);
0054
0055 std::string description() const;
0056 void setDescription(const std::string& description);
0057
0058 std::string release() const;
0059 void setRelease(const std::string& release);
0060
0061 boost::posix_time::ptime snapshotTime() const;
0062 void setSnapshotTime(const boost::posix_time::ptime& snapshotTime);
0063
0064
0065
0066 void insert(const std::string& recordName, const std::string& tagName, bool checkType = false);
0067 void insert(const std::string& recordName,
0068 const std::string& recordLabel,
0069 const std::string& tagName,
0070 bool checkType = false);
0071
0072
0073 bool flush();
0074
0075 bool flush(const boost::posix_time::ptime& operationTime);
0076
0077 private:
0078 void checkTransaction(const std::string& ctx);
0079
0080 private:
0081 std::shared_ptr<GTEditorData> m_data;
0082 std::shared_ptr<SessionImpl> m_session;
0083 };
0084
0085 }
0086 }
0087
0088 #endif