CMS 3D CMS Logo

RunMemChErrorsDat Class Reference

#include <OnlineDB/EcalCondDB/interface/RunMemChErrorsDat.h>

Inheritance diagram for RunMemChErrorsDat:

IDataItem IDBObject

List of all members.

Public Member Functions

uint64_t getErrorBits () const
std::string getTable ()
 RunMemChErrorsDat ()
void setErrorBits (uint64_t bits)
 ~RunMemChErrorsDat ()

Private Member Functions

void fetchData (std::map< EcalLogicID, RunMemChErrorsDat > *fillMap, RunIOV *iov) throw (std::runtime_error)
void prepareWrite () throw (std::runtime_error)
void writeDB (const EcalLogicID *ecid, const RunMemChErrorsDat *item, RunIOV *iov) throw (std::runtime_error)

Private Attributes

uint64_t m_errorBits

Friends

class EcalCondDBInterface


Detailed Description

Definition at line 12 of file RunMemChErrorsDat.h.


Constructor & Destructor Documentation

RunMemChErrorsDat::RunMemChErrorsDat (  ) 

Definition at line 12 of file RunMemChErrorsDat.cc.

References IDBObject::m_conn, IDBObject::m_env, m_errorBits, IDataItem::m_readStmt, IDataItem::m_writeStmt, and NULL.

00013 {
00014   m_env = NULL;
00015   m_conn = NULL;
00016   m_writeStmt = NULL;
00017   m_readStmt = NULL;
00018   m_errorBits = 0;
00019 }

RunMemChErrorsDat::~RunMemChErrorsDat (  ) 

Definition at line 23 of file RunMemChErrorsDat.cc.

00024 {
00025 }


Member Function Documentation

void RunMemChErrorsDat::fetchData ( std::map< EcalLogicID, RunMemChErrorsDat > *  fillMap,
RunIOV iov 
) throw (std::runtime_error) [private]

uint64_t RunMemChErrorsDat::getErrorBits (  )  const [inline]

Definition at line 22 of file RunMemChErrorsDat.h.

References m_errorBits.

00022 { return m_errorBits; }

std::string RunMemChErrorsDat::getTable (  )  [inline, virtual]

Implements IDataItem.

Definition at line 19 of file RunMemChErrorsDat.h.

00019 { return "RUN_MEM_CH_ERRORS_DAT"; }

void RunMemChErrorsDat::prepareWrite (  )  throw (std::runtime_error) [private, virtual]

Implements IDataItem.

Definition at line 29 of file RunMemChErrorsDat.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     /* Using TO_NUMBER because OCCI does not support 64-bit integers well */
00037     m_writeStmt->setSQL("INSERT INTO run_mem_ch_errors_dat (iov_id, logic_id, "
00038                         "error_bits) "
00039                         "VALUES (:iov_id, :logic_id, "
00040                         "to_number(:error_bits))");
00041   } catch (SQLException &e) {
00042     throw(runtime_error("RunMemChErrorsDat::prepareWrite():  "+e.getMessage()));
00043   }
00044 }

void RunMemChErrorsDat::setErrorBits ( uint64_t  bits  )  [inline]

Definition at line 21 of file RunMemChErrorsDat.h.

References m_errorBits.

Referenced by EcalErrorMask::readFile().

00021 { m_errorBits = bits; }

void RunMemChErrorsDat::writeDB ( const EcalLogicID ecid,
const RunMemChErrorsDat item,
RunIOV iov 
) throw (std::runtime_error) [private]

Definition at line 48 of file RunMemChErrorsDat.cc.

References IDBObject::checkConnection(), IDataItem::checkPrepare(), e, and IDataItem::m_writeStmt.

00050 {
00051   this->checkConnection();
00052   this->checkPrepare();
00053 
00054   int iovID = iov->fetchID();
00055   if (!iovID) { throw(runtime_error("RunMemChErrorsDat::writeDB:  IOV not in DB")); }
00056 
00057   int logicID = ecid->getLogicID();
00058   if (!logicID) { throw(runtime_error("RunMemChErrorsDat::writeDB:  Bad EcalLogicID")); }
00059   
00060   try {
00061     m_writeStmt->setInt(1, iovID);
00062     m_writeStmt->setInt(2, logicID);
00063     m_writeStmt->setString(3, ( boost::lexical_cast<std::string>(item->getErrorBits()) ).c_str());
00064     m_writeStmt->executeUpdate();
00065   } catch (SQLException &e) {
00066     throw(runtime_error("RunMemChErrorsDat::writeDB():  "+e.getMessage()));
00067   }
00068 }


Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 14 of file RunMemChErrorsDat.h.


Member Data Documentation

uint64_t RunMemChErrorsDat::m_errorBits [private]

Definition at line 35 of file RunMemChErrorsDat.h.

Referenced by getErrorBits(), RunMemChErrorsDat(), and setErrorBits().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:31:14 2009 for CMSSW by  doxygen 1.5.4