CMS 3D CMS Logo

RunConfigDat Class Reference

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

Inheritance diagram for RunConfigDat:

IDataItem IDBObject

List of all members.

Public Member Functions

std::string getConfigTag () const
int getConfigVersion () const
std::string getTable ()
 RunConfigDat ()
void setConfigTag (std::string tag)
void setConfigVersion (int ver)
 ~RunConfigDat ()

Private Member Functions

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

Private Attributes

std::string m_configTag
int m_configVer

Friends

class EcalCondDBInterface


Detailed Description

Definition at line 11 of file RunConfigDat.h.


Constructor & Destructor Documentation

RunConfigDat::RunConfigDat (  ) 

Definition at line 11 of file RunConfigDat.cc.

References m_configTag, m_configVer, IDBObject::m_conn, IDBObject::m_env, IDataItem::m_readStmt, 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_configTag = "none";
00019   m_configVer = 0;
00020 }

RunConfigDat::~RunConfigDat (  ) 

Definition at line 24 of file RunConfigDat.cc.

00025 {
00026 }


Member Function Documentation

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

std::string RunConfigDat::getConfigTag (  )  const [inline]

Definition at line 20 of file RunConfigDat.h.

References m_configTag.

00020 { return m_configTag; }

int RunConfigDat::getConfigVersion (  )  const [inline]

Definition at line 23 of file RunConfigDat.h.

References m_configVer.

00023 { return m_configVer; }

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

Implements IDataItem.

Definition at line 18 of file RunConfigDat.h.

00018 { return "RUN_CONFIG_DAT"; }

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

Implements IDataItem.

Definition at line 30 of file RunConfigDat.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     m_writeStmt->setSQL("INSERT INTO run_config_dat (iov_id, logic_id, "
00038                         "config_tag, config_ver) "
00039                         "VALUES (:iov_id, :logic_id, "
00040                         ":config_tag, :config_ver)");
00041   } catch (SQLException &e) {
00042     throw(runtime_error("RunConfigDat::prepareWrite():  "+e.getMessage()));
00043   }
00044 }

void RunConfigDat::setConfigTag ( std::string  tag  )  [inline]

Definition at line 21 of file RunConfigDat.h.

References m_configTag.

00021 { m_configTag = tag; }

void RunConfigDat::setConfigVersion ( int  ver  )  [inline]

Definition at line 24 of file RunConfigDat.h.

References m_configVer.

00024 { m_configVer = ver; }

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

Definition at line 48 of file RunConfigDat.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("RunConfigDat::writeDB:  IOV not in DB")); }
00056 
00057   int logicID = ecid->getLogicID();
00058   if (!logicID) { throw(runtime_error("RunConfigDat::writeDB:  Bad EcalLogicID")); }
00059   
00060   try {
00061     m_writeStmt->setInt(1, iovID);
00062     m_writeStmt->setInt(2, logicID);
00063     m_writeStmt->setString(3, item->getConfigTag());
00064     m_writeStmt->setInt(4, item->getConfigVersion());
00065 
00066     m_writeStmt->executeUpdate();
00067   } catch (SQLException &e) {
00068     throw(runtime_error("RunConfigDat::writeDB():  "+e.getMessage()));
00069   }
00070 }


Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 13 of file RunConfigDat.h.


Member Data Documentation

std::string RunConfigDat::m_configTag [private]

Definition at line 37 of file RunConfigDat.h.

Referenced by getConfigTag(), RunConfigDat(), and setConfigTag().

int RunConfigDat::m_configVer [private]

Definition at line 38 of file RunConfigDat.h.

Referenced by getConfigVersion(), RunConfigDat(), and setConfigVersion().


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