#include <ODRunConfigInfo.h>
Definition at line 12 of file ODRunConfigInfo.h.
ODRunConfigInfo::ODRunConfigInfo |
( |
| ) |
|
Definition at line 11 of file ODRunConfigInfo.cc.
std::string m_trigger_mode
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
ODRunConfigInfo::~ODRunConfigInfo |
( |
| ) |
|
|
override |
void ODRunConfigInfo::clear |
( |
void |
| ) |
|
|
private |
Definition at line 269 of file ODRunConfigInfo.cc.
References gather_cfg::cout, DateHandler::dateToTm(), cuy::dh, alignCSCRings::e, and mps_fire::result.
274 if (result->
getId() == 0) {
280 "SELECT config_id, tag, version, run_type_def_id, run_mode_def_id, \
281 num_of_sequences, description, defaults, trg_mode, num_of_events, db_timestamp, usage_status \
282 FROM ECAL_RUN_CONFIGURATION_DAT WHERE config_id = :1 ");
288 result->
setId(rset->getInt(1));
289 result->
setTag(rset->getString(2));
300 Date dbdate = rset->getDate(11);
305 cout <<
" ODRunConfigInfo::fetchData(): " << e.getMessage() << endl;
306 throw(std::runtime_error(
"ODRunConfigInfo::fetchData(): " + e.getMessage()));
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
int fetchID() noexcept(false)
void setUsageStatus(std::string x)
void setDescription(std::string x)
void setNumberOfSequences(int n)
void setTriggerMode(std::string x)
oracle::occi::SQLException SQLException
void setTag(std::string x)
void setDBTime(const Tm &x)
void setNumberOfEvents(int x)
int ODRunConfigInfo::fetchID |
( |
| ) |
|
|
privatenoexcept |
Definition at line 65 of file ODRunConfigInfo.cc.
References cuy::dh, and alignCSCRings::e.
78 "SELECT config_id from ECAL_RUN_CONFIGURATION_DAT "
80 " and version = :version ");
81 stmt->setString(1,
m_tag);
84 ResultSet* rset = stmt->executeQuery();
86 m_ID = rset->getInt(1);
90 m_conn->terminateStatement(stmt);
92 throw(std::runtime_error(
"ODRunConfigInfo::fetchID: " + e.getMessage()));
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
void setByID(int id) noexcept(false)
oracle::occi::Statement Statement
oracle::occi::SQLException SQLException
int ODRunConfigInfo::fetchIDFromTagAndVersion |
( |
| ) |
|
|
privatenoexcept |
int ODRunConfigInfo::fetchIDLast |
( |
| ) |
|
|
privatenoexcept |
Definition at line 98 of file ODRunConfigInfo.cc.
References cuy::dh, and alignCSCRings::e.
105 stmt->setSQL(
"SELECT max(config_id) FROM ecal_run_configuration_dat ");
106 ResultSet* rset = stmt->executeQuery();
109 m_ID = rset->getInt(1);
113 m_conn->terminateStatement(stmt);
115 throw(std::runtime_error(
"ODRunConfigInfo::fetchIDLast: " + e.getMessage()));
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
void setByID(int id) noexcept(false)
oracle::occi::Statement Statement
oracle::occi::SQLException SQLException
int ODRunConfigInfo::fetchNextId |
( |
| ) |
|
|
privatenoexcept |
Definition at line 46 of file ODRunConfigInfo.cc.
References alignCSCRings::e, and mps_fire::result.
52 m_readStmt->setSQL(
"select ecal_run_sq.NextVal from dual");
54 while (rset->next()) {
55 result = rset->getInt(1);
61 throw(std::runtime_error(
"ODDCCConfig::fetchNextId(): " + e.getMessage()));
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
oracle::occi::SQLException SQLException
Tm ODRunConfigInfo::getDBTime |
( |
| ) |
const |
|
inline |
int ODRunConfigInfo::getDefaults |
( |
| ) |
const |
|
inline |
std::string ODRunConfigInfo::getDescription |
( |
| ) |
const |
|
inline |
int ODRunConfigInfo::getId |
( |
void |
| ) |
const |
|
inline |
int ODRunConfigInfo::getNumberOfEvents |
( |
| ) |
const |
|
inline |
int ODRunConfigInfo::getNumberOfSequences |
( |
| ) |
const |
|
inline |
RunModeDef ODRunConfigInfo::getRunModeDef |
( |
| ) |
const |
RunTypeDef ODRunConfigInfo::getRunTypeDef |
( |
| ) |
const |
std::string ODRunConfigInfo::getTable |
( |
| ) |
|
|
inlineoverridevirtual |
std::string ODRunConfigInfo::getTag |
( |
| ) |
const |
|
inline |
std::string ODRunConfigInfo::getTriggerMode |
( |
| ) |
const |
|
inline |
std::string ODRunConfigInfo::getUsageStatus |
( |
| ) |
const |
|
inline |
int ODRunConfigInfo::getVersion |
( |
| ) |
const |
|
inline |
void ODRunConfigInfo::prepareWrite |
( |
| ) |
|
|
overrideprivatevirtualnoexcept |
Implements IODConfig.
Definition at line 170 of file ODRunConfigInfo.cc.
References alignCSCRings::e.
178 "INSERT INTO ECAL_RUN_CONFIGURATION_DAT (CONFIG_ID, tag, version, run_type_def_id, "
179 " run_mode_def_id, num_of_sequences, defaults, trg_mode, num_of_events, description, usage_status ) "
180 " VALUES (:1, :2, :3 , :4, :5, :6 ,:7, :8, :9, :10 , :11)");
186 throw(std::runtime_error(
"ODRunConfigInfo::prepareWrite(): " + e.getMessage()));
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
int fetchNextId() noexcept(false)
oracle::occi::SQLException SQLException
void ODRunConfigInfo::setByID |
( |
int |
id | ) |
|
|
privatenoexcept |
Definition at line 128 of file ODRunConfigInfo.cc.
References DateHandler::dateToTm(), cuy::dh, alignCSCRings::e, and gpuClustering::id.
137 "SELECT tag, version, run_type_def_id, run_mode_def_id, num_of_sequences, description, defaults,"
138 " trg_mode,num_of_events, db_timestamp, usage_status"
139 " FROM ECAL_RUN_CONFIGURATION_DAT WHERE config_id = :1");
142 ResultSet* rset = stmt->executeQuery();
144 m_tag = rset->getString(1);
146 int run_type_id = rset->getInt(3);
147 int run_mode_id = rset->getInt(4);
153 Date dbdate = rset->getDate(10);
162 throw(std::runtime_error(
"ODRunConfigInfo::setByID: Given config_id is not in the database"));
164 m_conn->terminateStatement(stmt);
166 throw(std::runtime_error(
"ODRunConfigInfo::setByID: " + e.getMessage()));
std::string m_trigger_mode
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
uint16_t *__restrict__ id
void checkConnection() const noexcept(false)
std::string m_description
std::string m_usage_status
void setByID(int id) noexcept(false) override
oracle::occi::Statement Statement
void setByID(int id) noexcept(false) override
oracle::occi::SQLException SQLException
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
void ODRunConfigInfo::setDBTime |
( |
const Tm & |
x | ) |
|
|
inline |
void ODRunConfigInfo::setDefaults |
( |
int |
x | ) |
|
|
inline |
void ODRunConfigInfo::setDescription |
( |
std::string |
x | ) |
|
|
inline |
void ODRunConfigInfo::setId |
( |
int |
id | ) |
|
|
inline |
void ODRunConfigInfo::setNumberOfEvents |
( |
int |
x | ) |
|
|
inline |
void ODRunConfigInfo::setNumberOfSequences |
( |
int |
n | ) |
|
|
inline |
void ODRunConfigInfo::setRunModeDef |
( |
const RunModeDef & |
runModeDef | ) |
|
void ODRunConfigInfo::setRunTypeDef |
( |
const RunTypeDef & |
runTypeDef | ) |
|
void ODRunConfigInfo::setTag |
( |
std::string |
x | ) |
|
|
inline |
void ODRunConfigInfo::setTriggerMode |
( |
std::string |
x | ) |
|
|
inline |
void ODRunConfigInfo::setUsageStatus |
( |
std::string |
x | ) |
|
|
inline |
void ODRunConfigInfo::setVersion |
( |
int |
x | ) |
|
|
inline |
int ODRunConfigInfo::updateDefaultCycle |
( |
| ) |
|
|
privatenoexcept |
Definition at line 234 of file ODRunConfigInfo.cc.
References alignCSCRings::e.
245 stmt->setSQL(
"UPDATE ecal_run_configuration_dat set defaults=:1 where config_id=:2 ");
248 stmt->setInt(2,
m_ID);
250 stmt->executeUpdate();
252 m_conn->terminateStatement(stmt);
254 throw(std::runtime_error(
"ODRunConfigInfo::writeDB: " + e.getMessage()));
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
void writeDB() noexcept(false)
int fetchID() noexcept(false)
oracle::occi::Statement Statement
oracle::occi::SQLException SQLException
void ODRunConfigInfo::writeDB |
( |
| ) |
|
|
privatenoexcept |
Definition at line 190 of file ODRunConfigInfo.cc.
References gather_cfg::cout, cuy::dh, and alignCSCRings::e.
222 throw(std::runtime_error(
"ODRunConfigInfo::writeDB: " + e.getMessage()));
226 throw(std::runtime_error(
"ODRunConfigInfo::writeDB Failed to write"));
231 cout <<
"ODRunConfigInfo::writeDB>> done inserting ODRunConfigInfo with id=" <<
m_ID << endl;
std::string getTriggerMode() const
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
int fetchID() noexcept(false)
std::string getDescription() const
int fetchID() noexcept(false) override
void setByID(int id) noexcept(false)
int getNumberOfEvents() const
std::string getTag() const
int fetchID() noexcept(false) override
oracle::occi::SQLException SQLException
int getNumberOfSequences() const
std::string getUsageStatus() const
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
void checkPrepare() noexcept(false)
Tm ODRunConfigInfo::m_db_time |
|
private |
int ODRunConfigInfo::m_defaults |
|
private |
std::string ODRunConfigInfo::m_description |
|
private |
int ODRunConfigInfo::m_ID |
|
private |
int ODRunConfigInfo::m_num_events |
|
private |
int ODRunConfigInfo::m_num_seq |
|
private |
std::string ODRunConfigInfo::m_tag |
|
private |
std::string ODRunConfigInfo::m_trigger_mode |
|
private |
std::string ODRunConfigInfo::m_usage_status |
|
private |
int ODRunConfigInfo::m_version |
|
private |