CMS 3D CMS Logo

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

RunConfigDat Class Reference

#include <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 NULL.

RunConfigDat::~RunConfigDat ( )

Definition at line 24 of file RunConfigDat.cc.

{
}

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.

Referenced by popcon::EcalSRPHandler::getNewObjects().

{ return m_configTag; }
int RunConfigDat::getConfigVersion ( ) const [inline]

Definition at line 23 of file RunConfigDat.h.

References m_configVer.

Referenced by popcon::EcalSRPHandler::getNewObjects().

{ return m_configVer; }
std::string RunConfigDat::getTable ( ) [inline, virtual]

Implements IDataItem.

Definition at line 18 of file RunConfigDat.h.

{ return "RUN_CONFIG_DAT"; }
void RunConfigDat::prepareWrite ( ) throw (std::runtime_error) [private, virtual]

Implements IDataItem.

Definition at line 30 of file RunConfigDat.cc.

References alignCSCRings::e.

{
  this->checkConnection();

  try {
    m_writeStmt = m_conn->createStatement();
    m_writeStmt->setSQL("INSERT INTO run_config_dat (iov_id, logic_id, "
                        "config_tag, config_ver) "
                        "VALUES (:iov_id, :logic_id, "
                        ":config_tag, :config_ver)");
  } catch (SQLException &e) {
    throw(std::runtime_error("RunConfigDat::prepareWrite():  "+e.getMessage()));
  }
}
void RunConfigDat::setConfigTag ( std::string  tag) [inline]

Definition at line 21 of file RunConfigDat.h.

References m_configTag, and GlobalPosition_Frontier_DevDB_cff::tag.

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

Definition at line 24 of file RunConfigDat.h.

References m_configVer, and cmsDownloadME::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 alignCSCRings::e, and o2o::iov.

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

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

  int logicID = ecid->getLogicID();
  if (!logicID) { throw(std::runtime_error("RunConfigDat::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->getConfigVersion());

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

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(), and setConfigTag().

Definition at line 38 of file RunConfigDat.h.

Referenced by getConfigVersion(), and setConfigVersion().