#include <OnlineDB/EcalCondDB/interface/RunLaserRunDat.h>
Public Member Functions | |
std::string | getLaserSequenceCond () const |
std::string | getLaserSequenceType () const |
std::string | getTable () |
RunLaserRunDat () | |
void | setLaserSequenceCond (std::string x) |
void | setLaserSequenceType (std::string x) |
~RunLaserRunDat () | |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, RunLaserRunDat > *fillMap, RunIOV *iov) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const RunLaserRunDat *item, RunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
std::string | m_laserSeqCond |
std::string | m_laserSeqType |
Friends | |
class | EcalCondDBInterface |
Definition at line 11 of file RunLaserRunDat.h.
RunLaserRunDat::RunLaserRunDat | ( | ) |
Definition at line 11 of file RunLaserRunDat.cc.
References IDBObject::m_conn, IDBObject::m_env, m_laserSeqCond, m_laserSeqType, IDataItem::m_writeStmt, and NULL.
00012 { 00013 m_env = NULL; 00014 m_conn = NULL; 00015 m_writeStmt = NULL; 00016 m_laserSeqType = ""; 00017 m_laserSeqCond = ""; 00018 }
RunLaserRunDat::~RunLaserRunDat | ( | ) |
void RunLaserRunDat::fetchData | ( | std::map< EcalLogicID, RunLaserRunDat > * | fillMap, | |
RunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
std::string RunLaserRunDat::getLaserSequenceCond | ( | ) | const [inline] |
Definition at line 24 of file RunLaserRunDat.h.
References m_laserSeqCond.
00024 { return m_laserSeqCond; }
std::string RunLaserRunDat::getLaserSequenceType | ( | ) | const [inline] |
Definition at line 21 of file RunLaserRunDat.h.
References m_laserSeqType.
00021 { return m_laserSeqType; }
std::string RunLaserRunDat::getTable | ( | ) | [inline, virtual] |
void RunLaserRunDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 28 of file RunLaserRunDat.cc.
References IDBObject::checkConnection(), e, IDBObject::m_conn, and IDataItem::m_writeStmt.
00030 { 00031 this->checkConnection(); 00032 00033 try { 00034 m_writeStmt = m_conn->createStatement(); 00035 m_writeStmt->setSQL("INSERT INTO run_laserrun_config_dat (iov_id, logic_id, " 00036 "laser_sequence_type, laser_sequence_cond) " 00037 "VALUES (:1, :2, " 00038 ":3, :4 )"); 00039 } catch (SQLException &e) { 00040 throw(runtime_error("RunLaserRunDat::prepareWrite(): "+e.getMessage())); 00041 } 00042 }
void RunLaserRunDat::setLaserSequenceCond | ( | std::string | x | ) | [inline] |
Definition at line 23 of file RunLaserRunDat.h.
References m_laserSeqCond.
00023 { m_laserSeqCond = x; }
void RunLaserRunDat::setLaserSequenceType | ( | std::string | x | ) | [inline] |
Definition at line 20 of file RunLaserRunDat.h.
References m_laserSeqType.
00020 { m_laserSeqType = x; }
void RunLaserRunDat::writeDB | ( | const EcalLogicID * | ecid, | |
const RunLaserRunDat * | item, | |||
RunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
Definition at line 46 of file RunLaserRunDat.cc.
References IDBObject::checkConnection(), IDataItem::checkPrepare(), e, and IDataItem::m_writeStmt.
00048 { 00049 this->checkConnection(); 00050 this->checkPrepare(); 00051 00052 int iovID = iov->fetchID(); 00053 if (!iovID) { throw(runtime_error("RunLaserRunDat::writeDB: IOV not in DB")); } 00054 00055 int logicID = ecid->getLogicID(); 00056 if (!logicID) { throw(runtime_error("RunLaserRunDat::writeDB: Bad EcalLogicID")); } 00057 00058 try { 00059 m_writeStmt->setInt(1, iovID); 00060 m_writeStmt->setInt(2, logicID); 00061 m_writeStmt->setString(3, item->getLaserSequenceType()); 00062 m_writeStmt->setString(4, item->getLaserSequenceCond()); 00063 00064 m_writeStmt->executeUpdate(); 00065 } catch (SQLException &e) { 00066 throw(runtime_error("RunLaserRunDat::writeDB(): "+e.getMessage())); 00067 } 00068 }
friend class EcalCondDBInterface [friend] |
std::string RunLaserRunDat::m_laserSeqCond [private] |
Definition at line 38 of file RunLaserRunDat.h.
Referenced by getLaserSequenceCond(), RunLaserRunDat(), and setLaserSequenceCond().
std::string RunLaserRunDat::m_laserSeqType [private] |
Definition at line 37 of file RunLaserRunDat.h.
Referenced by getLaserSequenceType(), RunLaserRunDat(), and setLaserSequenceType().