CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes | Friends

RunTPGConfigDat Class Reference

#include <RunTPGConfigDat.h>

Inheritance diagram for RunTPGConfigDat:
IDataItem IDBObject

List of all members.

Public Member Functions

std::string getConfigTag () const
std::string getTable ()
int getVersion () const
 RunTPGConfigDat ()
void setConfigTag (std::string x)
void setVersion (int x)
 ~RunTPGConfigDat ()

Private Member Functions

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

Private Attributes

std::string m_config
int m_version

Friends

class EcalCondDBInterface

Detailed Description

Definition at line 11 of file RunTPGConfigDat.h.


Constructor & Destructor Documentation

RunTPGConfigDat::RunTPGConfigDat ( )

Definition at line 11 of file RunTPGConfigDat.cc.

References NULL.

RunTPGConfigDat::~RunTPGConfigDat ( )

Definition at line 24 of file RunTPGConfigDat.cc.

{
}

Member Function Documentation

void RunTPGConfigDat::fetchData ( std::map< EcalLogicID, RunTPGConfigDat > *  fillMap,
RunIOV iov 
) throw (std::runtime_error) [private]
std::string RunTPGConfigDat::getConfigTag ( ) const [inline]
std::string RunTPGConfigDat::getTable ( ) [inline, virtual]

Implements IDataItem.

Definition at line 18 of file RunTPGConfigDat.h.

{ return "RUN_TPGCONFIG_DAT"; }
int RunTPGConfigDat::getVersion ( ) const [inline]
void RunTPGConfigDat::prepareWrite ( ) throw (std::runtime_error) [private, virtual]

Implements IDataItem.

Definition at line 30 of file RunTPGConfigDat.cc.

{
  this->checkConnection();

  try {
    m_writeStmt = m_conn->createStatement();
    m_writeStmt->setSQL("INSERT INTO run_TPGConfig_dat (iov_id, logic_id, "
                        "Config_tag , version ) "
                        "VALUES (:iov_id, :logic_id, "
                        ":Config_tag , :version ) ");
  } catch (SQLException &e) {
    throw(std::runtime_error("RunTPGConfigDat::prepareWrite():  "+e.getMessage()));
  }
}
void RunTPGConfigDat::setConfigTag ( std::string  x) [inline]

Definition at line 21 of file RunTPGConfigDat.h.

References m_config, and x.

{ m_config = x; }
void CaliTag::setVersion ( int  x) [inline]

Definition at line 23 of file RunTPGConfigDat.h.

References m_version, and x.

{ m_version = x; }
void RunTPGConfigDat::writeDB ( const EcalLogicID ecid,
const RunTPGConfigDat item,
RunIOV iov 
) throw (std::runtime_error) [private]

Definition at line 48 of file RunTPGConfigDat.cc.

References o2o::iov.

{
  this->checkConnection();
  this->checkPrepare();

  int iovID = iov->fetchID();
  if (!iovID) { throw(std::runtime_error("RunTPGConfigDat::writeDB:  IOV not in DB")); }

  int logicID = ecid->getLogicID();
  if (!logicID) { throw(std::runtime_error("RunTPGConfigDat::writeDB:  Bad EcalLogicID")); }
  
  try {
    m_writeStmt->setInt(1, iovID);
    m_writeStmt->setInt(2, logicID);
    m_writeStmt->setString(3, item->getConfigTag());
    m_writeStmt->setInt(4, item->getVersion());


    m_writeStmt->executeUpdate();
  } catch (SQLException &e) {
    throw(std::runtime_error("RunTPGConfigDat::writeDB():  "+e.getMessage()));
  }
}

Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 13 of file RunTPGConfigDat.h.


Member Data Documentation

std::string RunTPGConfigDat::m_config [private]

Definition at line 38 of file RunTPGConfigDat.h.

Referenced by getConfigTag(), and setConfigTag().

Definition at line 37 of file RunTPGConfigDat.h.

Referenced by getVersion(), and setVersion().