#include <ODRunConfigInfo.h>
Definition at line 12 of file ODRunConfigInfo.h.
ODRunConfigInfo::ODRunConfigInfo |
( |
| ) |
|
Definition at line 12 of file ODRunConfigInfo.cc.
References NULL.
std::string m_trigger_mode
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
ODRunConfigInfo::~ODRunConfigInfo |
( |
| ) |
|
void ODRunConfigInfo::clear |
( |
void |
| ) |
|
|
private |
void ODRunConfigInfo::fetchData |
( |
ODRunConfigInfo * |
result | ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 303 of file ODRunConfigInfo.cc.
References gather_cfg::cout, DateHandler::dateToTm(), cuy::dh, alignCSCRings::e, and query::result.
310 if(result->
getId()==0){
315 m_readStmt->setSQL(
"SELECT config_id, tag, version, run_type_def_id, run_mode_def_id, \
316 num_of_sequences, description, defaults, trg_mode, num_of_events, db_timestamp, usage_status \
317 FROM ECAL_RUN_CONFIGURATION_DAT WHERE config_id = :1 ");
323 result->
setId( rset->getInt(1) );
324 result->
setTag( rset->getString(2) );
335 Date dbdate = rset->getDate(11);
340 cout <<
" ODRunConfigInfo::fetchData(): " << e.getMessage() << endl;
341 throw(std::runtime_error(
"ODRunConfigInfo::fetchData(): "+e.getMessage()));
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
void setUsageStatus(std::string x)
void setDescription(std::string x)
oracle::occi::ResultSet ResultSet
void setNumberOfSequences(int n)
void setTriggerMode(std::string x)
void setTag(std::string x)
void setDBTime(const Tm &x)
void checkConnection() const
void setNumberOfEvents(int x)
int ODRunConfigInfo::fetchID |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 75 of file ODRunConfigInfo.cc.
References cuy::dh, and alignCSCRings::e.
90 stmt->setSQL(
"SELECT config_id from ECAL_RUN_CONFIGURATION_DAT "
92 " and version = :version " );
93 stmt->setString(1,
m_tag);
98 m_ID = rset->getInt(1);
102 m_conn->terminateStatement(stmt);
104 throw(std::runtime_error(
"ODRunConfigInfo::fetchID: "+e.getMessage()));
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
oracle::occi::Statement Statement
oracle::occi::ResultSet ResultSet
void checkConnection() const
int ODRunConfigInfo::fetchIDFromTagAndVersion |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
int ODRunConfigInfo::fetchIDLast |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 112 of file ODRunConfigInfo.cc.
References cuy::dh, and alignCSCRings::e.
122 stmt->setSQL(
"SELECT max(config_id) FROM ecal_run_configuration_dat " );
126 m_ID = rset->getInt(1);
130 m_conn->terminateStatement(stmt);
132 throw(std::runtime_error(
"ODRunConfigInfo::fetchIDLast: "+e.getMessage()));
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
oracle::occi::Statement Statement
oracle::occi::ResultSet ResultSet
void checkConnection() const
int ODRunConfigInfo::fetchNextId |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 54 of file ODRunConfigInfo.cc.
References alignCSCRings::e, and query::result.
61 m_readStmt->setSQL(
"select ecal_run_sq.NextVal from dual");
63 while (rset->next ()){
64 result= rset->getInt(1);
70 throw(std::runtime_error(
"ODDCCConfig::fetchNextId(): "+e.getMessage()));
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
oracle::occi::ResultSet ResultSet
void checkConnection() const
Tm ODRunConfigInfo::getDBTime |
( |
| ) |
const |
|
inline |
int ODRunConfigInfo::getDefaults |
( |
| ) |
const |
|
inline |
std::string ODRunConfigInfo::getDescription |
( |
| ) |
const |
|
inline |
int ODRunConfigInfo::getId |
( |
| ) |
const |
|
inline |
int ODRunConfigInfo::getNumberOfEvents |
( |
| ) |
const |
|
inline |
int ODRunConfigInfo::getNumberOfSequences |
( |
| ) |
const |
|
inline |
RunModeDef ODRunConfigInfo::getRunModeDef |
( |
| ) |
const |
RunTypeDef ODRunConfigInfo::getRunTypeDef |
( |
| ) |
const |
std::string ODRunConfigInfo::getTable |
( |
| ) |
|
|
inlinevirtual |
std::string ODRunConfigInfo::getTag |
( |
void |
| ) |
const |
|
inline |
std::string ODRunConfigInfo::getTriggerMode |
( |
| ) |
const |
|
inline |
std::string ODRunConfigInfo::getUsageStatus |
( |
| ) |
const |
|
inline |
int ODRunConfigInfo::getVersion |
( |
| ) |
const |
|
inline |
void ODRunConfigInfo::prepareWrite |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
privatevirtual |
Implements IODConfig.
Definition at line 192 of file ODRunConfigInfo.cc.
References alignCSCRings::e.
204 m_writeStmt->setSQL(
"INSERT INTO ECAL_RUN_CONFIGURATION_DAT (CONFIG_ID, tag, version, run_type_def_id, "
205 " run_mode_def_id, num_of_sequences, defaults, trg_mode, num_of_events, description, usage_status ) "
206 " VALUES (:1, :2, :3 , :4, :5, :6 ,:7, :8, :9, :10 , :11)");
212 throw(std::runtime_error(
"ODRunConfigInfo::prepareWrite(): "+e.getMessage()));
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
void checkConnection() const
void ODRunConfigInfo::setByID |
( |
int |
id | ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 149 of file ODRunConfigInfo.cc.
References DateHandler::dateToTm(), cuy::dh, and alignCSCRings::e.
159 stmt->setSQL(
"SELECT tag, version, run_type_def_id, run_mode_def_id, num_of_sequences, description, defaults,"
160 " trg_mode,num_of_events, db_timestamp, usage_status"
161 " FROM ECAL_RUN_CONFIGURATION_DAT WHERE config_id = :1");
166 m_tag= rset->getString(1);
168 int run_type_id=rset->getInt(3);
169 int run_mode_id=rset->getInt(4);
175 Date dbdate = rset->getDate(10);
184 throw(std::runtime_error(
"ODRunConfigInfo::setByID: Given config_id is not in the database"));
186 m_conn->terminateStatement(stmt);
188 throw(std::runtime_error(
"ODRunConfigInfo::setByID: "+e.getMessage()));
std::string m_trigger_mode
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
std::string m_description
oracle::occi::SQLException SQLException
std::string m_usage_status
oracle::occi::Statement Statement
oracle::occi::ResultSet ResultSet
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
void checkConnection() const
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 |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 265 of file ODRunConfigInfo.cc.
References alignCSCRings::e.
279 stmt->setSQL(
"UPDATE ecal_run_configuration_dat set defaults=:1 where config_id=:2 " );
282 stmt->setInt(2,
m_ID);
284 stmt->executeUpdate();
286 m_conn->terminateStatement(stmt);
288 throw(std::runtime_error(
"ODRunConfigInfo::writeDB: "+e.getMessage()));
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
oracle::occi::Statement Statement
void checkConnection() const
void ODRunConfigInfo::writeDB |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 217 of file ODRunConfigInfo.cc.
References gather_cfg::cout, cuy::dh, and alignCSCRings::e.
252 throw(std::runtime_error(
"ODRunConfigInfo::writeDB: "+e.getMessage()));
256 throw(std::runtime_error(
"ODRunConfigInfo::writeDB Failed to write"));
261 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
std::string getDescription() const
oracle::occi::SQLException SQLException
int getNumberOfEvents() const
std::string getTag() const
int getNumberOfSequences() const
std::string getUsageStatus() const
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
void checkConnection() const
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 |