CMS 3D CMS Logo

RunLaserRunDat Class Reference

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

Inheritance diagram for RunLaserRunDat:

IDataItem IDBObject

List of all members.

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


Detailed Description

Definition at line 11 of file RunLaserRunDat.h.


Constructor & Destructor Documentation

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 (  ) 

Definition at line 22 of file RunLaserRunDat.cc.

00023 {
00024 }


Member Function Documentation

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]

Implements IDataItem.

Definition at line 18 of file RunLaserRunDat.h.

00018 { return "RUN_LASERRUN_CONFIG_DAT"; }

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 }


Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 13 of file RunLaserRunDat.h.


Member Data Documentation

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().


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