CMS 3D CMS Logo

RunTTErrorsDat Class Reference

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

Inheritance diagram for RunTTErrorsDat:

IDataItem IDBObject

List of all members.

Public Member Functions

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

Private Member Functions

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

Private Attributes

uint64_t m_errorBits

Friends

class EcalCondDBInterface


Detailed Description

Definition at line 12 of file RunTTErrorsDat.h.


Constructor & Destructor Documentation

RunTTErrorsDat::RunTTErrorsDat (  ) 

Definition at line 12 of file RunTTErrorsDat.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  
00019   m_errorBits = 0;
00020 }

RunTTErrorsDat::~RunTTErrorsDat (  ) 

Definition at line 24 of file RunTTErrorsDat.cc.

00025 {
00026 }


Member Function Documentation

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

uint64_t RunTTErrorsDat::getErrorBits (  )  const [inline]

Definition at line 22 of file RunTTErrorsDat.h.

References m_errorBits.

00022 { return m_errorBits; }

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

Implements IDataItem.

Definition at line 19 of file RunTTErrorsDat.h.

00019 { return "RUN_TT_ERRORS_DAT"; }

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

Implements IDataItem.

Definition at line 30 of file RunTTErrorsDat.cc.

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

00032 {
00033   this->checkConnection();
00034 
00035   try {
00036     m_writeStmt = m_conn->createStatement();
00037     /* Using TO_NUMBER because OCCI does not support 64-bit integers well */
00038     m_writeStmt->setSQL("INSERT INTO run_tt_errors_dat (iov_id, logic_id, "
00039                         "error_bits) "
00040                         "VALUES (:iov_id, :logic_id, "
00041                         "to_number(:error_bits))");
00042   } catch (SQLException &e) {
00043     throw(runtime_error("RunTTErrorsDat::prepareWrite():  "+e.getMessage()));
00044   }
00045 }

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

Definition at line 21 of file RunTTErrorsDat.h.

References m_errorBits.

Referenced by EcalErrorMask::readFile().

00021 { m_errorBits = bits; }

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

Definition at line 49 of file RunTTErrorsDat.cc.

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

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


Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 14 of file RunTTErrorsDat.h.


Member Data Documentation

uint64_t RunTTErrorsDat::m_errorBits [private]

Definition at line 35 of file RunTTErrorsDat.h.

Referenced by getErrorBits(), RunTTErrorsDat(), 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