CMS 3D CMS Logo

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

RunCommentDat Class Reference

#include <RunCommentDat.h>

Inheritance diagram for RunCommentDat:
IDataItem IDBObject

List of all members.

Public Member Functions

std::string getComment () const
Tm getDBTime () const
std::string getSource () const
std::string getTable ()
 RunCommentDat ()
void setComment (std::string x)
void setDBTime (Tm x)
void setSource (std::string x)
 ~RunCommentDat ()

Private Member Functions

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

Private Attributes

std::string m_comment
std::string m_source
Tm m_time

Friends

class EcalCondDBInterface

Detailed Description

Definition at line 11 of file RunCommentDat.h.


Constructor & Destructor Documentation

RunCommentDat::RunCommentDat ( )

Definition at line 16 of file RunCommentDat.cc.

References NULL.

{
  m_env = NULL;
  m_conn = NULL;
  m_writeStmt = NULL;
  m_source = "";
  m_comment = "";
  m_time = Tm();
}
RunCommentDat::~RunCommentDat ( )

Definition at line 28 of file RunCommentDat.cc.

{
}

Member Function Documentation

void RunCommentDat::fetchData ( std::map< EcalLogicID, RunCommentDat > *  fillMap,
RunIOV iov 
) throw (std::runtime_error) [private]
std::string RunCommentDat::getComment ( ) const [inline]

Definition at line 23 of file RunCommentDat.h.

References m_comment.

{ return m_comment; }
Tm RunCommentDat::getDBTime ( ) const [inline]

Definition at line 25 of file RunCommentDat.h.

References m_time.

{return m_time;}
std::string RunCommentDat::getSource ( ) const [inline]

Definition at line 21 of file RunCommentDat.h.

References m_source.

{ return m_source; }
std::string RunCommentDat::getTable ( ) [inline, virtual]

Implements IDataItem.

Definition at line 18 of file RunCommentDat.h.

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

Implements IDataItem.

Definition at line 34 of file RunCommentDat.cc.

References alignCSCRings::e.

{
  this->checkConnection();

  try {
    m_writeStmt = m_conn->createStatement();
    m_writeStmt->setSQL("INSERT INTO run_comment_dat (iov_id,  "
                        "source, user_comment) "
                        "VALUES (:iov_id,  "
                        ":source, :user_comment)");
  } catch (SQLException &e) {
    throw(std::runtime_error("RunCommentDat::prepareWrite():  "+e.getMessage()));
  }
}
void RunCommentDat::setComment ( std::string  x) [inline]

Definition at line 22 of file RunCommentDat.h.

References m_comment, and x.

{ m_comment = x; }
void RunCommentDat::setDBTime ( Tm  x) [inline]

Definition at line 24 of file RunCommentDat.h.

References m_time, and x.

{m_time=x;}
void RunCommentDat::setSource ( std::string  x) [inline]

Definition at line 20 of file RunCommentDat.h.

References m_source, and x.

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

Definition at line 52 of file RunCommentDat.cc.

References alignCSCRings::e, and o2o::iov.

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

  int iovID = iov->fetchID();
  if (!iovID) { throw(std::runtime_error("RunCommentDat::writeDB:  IOV not in DB")); }
  
  try {
    m_writeStmt->setInt(1, iovID);
    m_writeStmt->setString(2, item->getSource());
    m_writeStmt->setString(3, item->getComment());
    
    m_writeStmt->executeUpdate();
  } catch (SQLException &e) {
    throw(std::runtime_error("RunCommentDat::writeDB():  "+e.getMessage()));
  }
}

Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 13 of file RunCommentDat.h.


Member Data Documentation

std::string RunCommentDat::m_comment [private]

Definition at line 39 of file RunCommentDat.h.

Referenced by getComment(), and setComment().

std::string RunCommentDat::m_source [private]

Definition at line 38 of file RunCommentDat.h.

Referenced by getSource(), and setSource().

Definition at line 40 of file RunCommentDat.h.

Referenced by getDBTime(), and setDBTime().