#include <RunConfigDat.h>
Public Member Functions | |
std::string | getConfigTag () const |
int | getConfigVersion () const |
std::string | getTable () |
RunConfigDat () | |
void | setConfigTag (std::string tag) |
void | setConfigVersion (int ver) |
~RunConfigDat () | |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, RunConfigDat > *fillMap, RunIOV *iov) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const RunConfigDat *item, RunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
std::string | m_configTag |
int | m_configVer |
Friends | |
class | EcalCondDBInterface |
Definition at line 11 of file RunConfigDat.h.
RunConfigDat::RunConfigDat | ( | ) |
Definition at line 11 of file RunConfigDat.cc.
References NULL.
{ m_env = NULL; m_conn = NULL; m_writeStmt = NULL; m_readStmt = NULL; m_configTag = "none"; m_configVer = 0; }
RunConfigDat::~RunConfigDat | ( | ) |
Definition at line 24 of file RunConfigDat.cc.
{ }
void RunConfigDat::fetchData | ( | std::map< EcalLogicID, RunConfigDat > * | fillMap, |
RunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
std::string RunConfigDat::getConfigTag | ( | ) | const [inline] |
int RunConfigDat::getConfigVersion | ( | ) | const [inline] |
std::string RunConfigDat::getTable | ( | ) | [inline, virtual] |
void RunConfigDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 30 of file RunConfigDat.cc.
References ExpressReco_HICollisions_FallBack::e.
{ this->checkConnection(); try { m_writeStmt = m_conn->createStatement(); m_writeStmt->setSQL("INSERT INTO run_config_dat (iov_id, logic_id, " "config_tag, config_ver) " "VALUES (:iov_id, :logic_id, " ":config_tag, :config_ver)"); } catch (SQLException &e) { throw(std::runtime_error("RunConfigDat::prepareWrite(): "+e.getMessage())); } }
void RunConfigDat::setConfigTag | ( | std::string | tag | ) | [inline] |
Definition at line 21 of file RunConfigDat.h.
References m_configTag, and GlobalPosition_Frontier_DevDB_cff::tag.
{ m_configTag = tag; }
void RunConfigDat::setConfigVersion | ( | int | ver | ) | [inline] |
Definition at line 24 of file RunConfigDat.h.
References m_configVer, and cmsDownloadME::ver.
{ m_configVer = ver; }
void RunConfigDat::writeDB | ( | const EcalLogicID * | ecid, |
const RunConfigDat * | item, | ||
RunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
Definition at line 48 of file RunConfigDat.cc.
References ExpressReco_HICollisions_FallBack::e, and o2o::iov.
{ this->checkConnection(); this->checkPrepare(); int iovID = iov->fetchID(); if (!iovID) { throw(std::runtime_error("RunConfigDat::writeDB: IOV not in DB")); } int logicID = ecid->getLogicID(); if (!logicID) { throw(std::runtime_error("RunConfigDat::writeDB: Bad EcalLogicID")); } try { m_writeStmt->setInt(1, iovID); m_writeStmt->setInt(2, logicID); m_writeStmt->setString(3, item->getConfigTag()); m_writeStmt->setInt(4, item->getConfigVersion()); m_writeStmt->executeUpdate(); } catch (SQLException &e) { throw(std::runtime_error("RunConfigDat::writeDB(): "+e.getMessage())); } }
friend class EcalCondDBInterface [friend] |
Reimplemented from IDBObject.
Definition at line 13 of file RunConfigDat.h.
std::string RunConfigDat::m_configTag [private] |
Definition at line 37 of file RunConfigDat.h.
Referenced by getConfigTag(), and setConfigTag().
int RunConfigDat::m_configVer [private] |
Definition at line 38 of file RunConfigDat.h.
Referenced by getConfigVersion(), and setConfigVersion().