#include <RunDat.h>
Public Member Functions | |
int | getNumEvents () const |
std::string | getTable () |
RunDat () | |
void | setNumEvents (int num) |
~RunDat () | |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, RunDat > *fillMap, RunIOV *iov) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const RunDat *item, RunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
int | m_numEvents |
Friends | |
class | EcalCondDBInterface |
RunDat::RunDat | ( | ) |
Definition at line 11 of file RunDat.cc.
References NULL.
{ m_env = NULL; m_conn = NULL; m_writeStmt = NULL; m_numEvents = 0; }
void RunDat::fetchData | ( | std::map< EcalLogicID, RunDat > * | fillMap, |
RunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
int RunDat::getNumEvents | ( | ) | const [inline] |
std::string RunDat::getTable | ( | ) | [inline, virtual] |
void RunDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 27 of file RunDat.cc.
{ this->checkConnection(); try { m_writeStmt = m_conn->createStatement(); m_writeStmt->setSQL("INSERT INTO run_dat (iov_id, logic_id, " "num_events) " "VALUES (:iov_id, :logic_id, " ":num_events)"); } catch (SQLException &e) { throw(std::runtime_error("RunDat::prepareWrite(): "+e.getMessage())); } }
void RunDat::setNumEvents | ( | int | num | ) | [inline] |
Definition at line 20 of file RunDat.h.
References m_numEvents.
Referenced by EcalBarrelMonitorClient::endRunDb(), and EcalEndcapMonitorClient::endRunDb().
{ m_numEvents = num; }
void RunDat::writeDB | ( | const EcalLogicID * | ecid, |
const RunDat * | item, | ||
RunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
Definition at line 45 of file RunDat.cc.
References o2o::iov.
{ this->checkConnection(); this->checkPrepare(); int iovID = iov->fetchID(); if (!iovID) { throw(std::runtime_error("RunDat::writeDB: IOV not in DB")); } int logicID = ecid->getLogicID(); if (!logicID) { throw(std::runtime_error("RunDat::writeDB: Bad EcalLogicID")); } try { m_writeStmt->setInt(1, iovID); m_writeStmt->setInt(2, logicID); m_writeStmt->setInt(3, item->getNumEvents()); m_writeStmt->executeUpdate(); } catch (SQLException &e) { throw(std::runtime_error("RunDat::writeDB(): "+e.getMessage())); } }
friend class EcalCondDBInterface [friend] |
int RunDat::m_numEvents [private] |
Definition at line 34 of file RunDat.h.
Referenced by getNumEvents(), and setNumEvents().