#include <OnlineDB/EcalCondDB/interface/RunPTMTempDat.h>
Public Member Functions | |
std::string | getTable () |
float | getTemperature () const |
RunPTMTempDat () | |
void | setTemperature (float t) |
~RunPTMTempDat () | |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, RunPTMTempDat > *fillMap, RunIOV *iov) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const RunPTMTempDat *item, RunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
float | m_temperature |
Friends | |
class | EcalCondDBInterface |
Definition at line 11 of file RunPTMTempDat.h.
RunPTMTempDat::RunPTMTempDat | ( | ) |
Definition at line 11 of file RunPTMTempDat.cc.
References IDBObject::m_conn, IDBObject::m_env, IDataItem::m_readStmt, m_temperature, IDataItem::m_writeStmt, and NULL.
00012 { 00013 m_env = NULL; 00014 m_conn = NULL; 00015 m_writeStmt = NULL; 00016 m_readStmt = NULL; 00017 00018 m_temperature = 0; 00019 }
RunPTMTempDat::~RunPTMTempDat | ( | ) |
void RunPTMTempDat::fetchData | ( | std::map< EcalLogicID, RunPTMTempDat > * | fillMap, | |
RunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
std::string RunPTMTempDat::getTable | ( | ) | [inline, virtual] |
float RunPTMTempDat::getTemperature | ( | ) | const [inline] |
Definition at line 20 of file RunPTMTempDat.h.
References m_temperature.
00020 { return m_temperature; }
void RunPTMTempDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 29 of file RunPTMTempDat.cc.
References IDBObject::checkConnection(), e, IDBObject::m_conn, and IDataItem::m_writeStmt.
00031 { 00032 this->checkConnection(); 00033 00034 try { 00035 m_writeStmt = m_conn->createStatement(); 00036 m_writeStmt->setSQL("INSERT INTO run_temperature_ptm_dat (iov_id, logic_id, " 00037 "temperature) " 00038 "VALUES (:iov_id, :logic_id, " 00039 ":temperature)"); 00040 } catch (SQLException &e) { 00041 throw(runtime_error("RunPTMTempDat::prepareWrite(): "+e.getMessage())); 00042 } 00043 }
void RunPTMTempDat::setTemperature | ( | float | t | ) | [inline] |
Definition at line 19 of file RunPTMTempDat.h.
References m_temperature.
00019 { m_temperature = t; }
void RunPTMTempDat::writeDB | ( | const EcalLogicID * | ecid, | |
const RunPTMTempDat * | item, | |||
RunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
Definition at line 47 of file RunPTMTempDat.cc.
References IDBObject::checkConnection(), IDataItem::checkPrepare(), e, and IDataItem::m_writeStmt.
00049 { 00050 this->checkConnection(); 00051 this->checkPrepare(); 00052 00053 int iovID = iov->fetchID(); 00054 if (!iovID) { throw(runtime_error("RunPTMTempDat::writeDB: IOV not in DB")); } 00055 00056 int logicID = ecid->getLogicID(); 00057 if (!logicID) { throw(runtime_error("RunPTMTempDat::writeDB: Bad EcalLogicID")); } 00058 00059 try { 00060 m_writeStmt->setInt(1, iovID); 00061 m_writeStmt->setInt(2, logicID); 00062 m_writeStmt->setFloat(3, item->getTemperature()); 00063 00064 m_writeStmt->executeUpdate(); 00065 } catch (SQLException &e) { 00066 throw(runtime_error("RunPTMTempDat::writeDB(): "+e.getMessage())); 00067 } 00068 }
friend class EcalCondDBInterface [friend] |
float RunPTMTempDat::m_temperature [private] |
Definition at line 33 of file RunPTMTempDat.h.
Referenced by getTemperature(), RunPTMTempDat(), and setTemperature().