CMS 3D CMS Logo

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

RunFEConfigDat Class Reference

#include <RunFEConfigDat.h>

Inheritance diagram for RunFEConfigDat:
IDataItem IDBObject

List of all members.

Public Member Functions

int getConfigId () const
std::string getTable ()
 RunFEConfigDat ()
void setConfigId (int x)
 ~RunFEConfigDat ()

Private Member Functions

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

Private Attributes

int m_config

Friends

class EcalCondDBInterface

Detailed Description

Definition at line 11 of file RunFEConfigDat.h.


Constructor & Destructor Documentation

RunFEConfigDat::RunFEConfigDat ( )

Definition at line 11 of file RunFEConfigDat.cc.

References NULL.

RunFEConfigDat::~RunFEConfigDat ( )

Definition at line 24 of file RunFEConfigDat.cc.

{
}

Member Function Documentation

void RunFEConfigDat::fetchData ( std::map< EcalLogicID, RunFEConfigDat > *  fillMap,
RunIOV iov 
) throw (std::runtime_error) [private]
int RunFEConfigDat::getConfigId ( ) const [inline]

Definition at line 20 of file RunFEConfigDat.h.

References m_config.

Referenced by popcon::EcalChannelStatusHandler::daqOut(), and popcon::EcalDAQHandler::getNewObjects().

{ return m_config; }
std::string RunFEConfigDat::getTable ( ) [inline, virtual]

Implements IDataItem.

Definition at line 18 of file RunFEConfigDat.h.

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

Implements IDataItem.

Definition at line 30 of file RunFEConfigDat.cc.

{
  this->checkConnection();

  try {
    m_writeStmt = m_conn->createStatement();
    m_writeStmt->setSQL("INSERT INTO run_FEConfig_dat (iov_id, logic_id, "
                        "Config_id ) "
                        "VALUES (:iov_id, :logic_id, "
                        ":Config_id ) ");
  } catch (SQLException &e) {
    throw(std::runtime_error("RunFEConfigDat::prepareWrite():  "+e.getMessage()));
  }
}
void RunFEConfigDat::setConfigId ( int  x) [inline]

Definition at line 21 of file RunFEConfigDat.h.

References m_config, and x.

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

Definition at line 48 of file RunFEConfigDat.cc.

References o2o::iov.

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

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

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


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

Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 13 of file RunFEConfigDat.h.


Member Data Documentation

int RunFEConfigDat::m_config [private]

Definition at line 36 of file RunFEConfigDat.h.

Referenced by getConfigId(), and setConfigId().