CMS 3D CMS Logo

RunCommentDat Class Reference

#include <OnlineDB/EcalCondDB/interface/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 (string x)
void setDBTime (Tm x)
void setSource (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 m_comment, IDBObject::m_conn, IDBObject::m_env, m_source, m_time, IDataItem::m_writeStmt, and NULL.

00017 {
00018   m_env = NULL;
00019   m_conn = NULL;
00020   m_writeStmt = NULL;
00021   m_source = "";
00022   m_comment = "";
00023   m_time = Tm();
00024 }

RunCommentDat::~RunCommentDat (  ) 

Definition at line 28 of file RunCommentDat.cc.

00029 {
00030 }


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.

00023 { return m_comment; }

Tm RunCommentDat::getDBTime (  )  const [inline]

Definition at line 25 of file RunCommentDat.h.

References m_time.

00025 {return m_time;}

std::string RunCommentDat::getSource (  )  const [inline]

Definition at line 21 of file RunCommentDat.h.

References m_source.

00021 { return m_source; }

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

Implements IDataItem.

Definition at line 18 of file RunCommentDat.h.

00018 { return "RUN_COMMENT_DAT"; }

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

Implements IDataItem.

Definition at line 34 of file RunCommentDat.cc.

References IDBObject::checkConnection(), e, IDBObject::m_conn, and IDataItem::m_writeStmt.

00036 {
00037   this->checkConnection();
00038 
00039   try {
00040     m_writeStmt = m_conn->createStatement();
00041     m_writeStmt->setSQL("INSERT INTO run_comment_dat (iov_id,  "
00042                         "source, user_comment) "
00043                         "VALUES (:iov_id,  "
00044                         ":source, :user_comment)");
00045   } catch (SQLException &e) {
00046     throw(runtime_error("RunCommentDat::prepareWrite():  "+e.getMessage()));
00047   }
00048 }

void RunCommentDat::setComment ( string  x  )  [inline]

Definition at line 22 of file RunCommentDat.h.

References m_comment.

00022 { m_comment = x; }

void RunCommentDat::setDBTime ( Tm  x  )  [inline]

Definition at line 24 of file RunCommentDat.h.

References m_time.

00024 {m_time=x;}

void RunCommentDat::setSource ( string  x  )  [inline]

Definition at line 20 of file RunCommentDat.h.

References m_source.

00020 { 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 IDBObject::checkConnection(), IDataItem::checkPrepare(), e, and IDataItem::m_writeStmt.

00054 {
00055   this->checkConnection();
00056   this->checkPrepare();
00057 
00058   int iovID = iov->fetchID();
00059   if (!iovID) { throw(runtime_error("RunCommentDat::writeDB:  IOV not in DB")); }
00060   
00061   try {
00062     m_writeStmt->setInt(1, iovID);
00063     m_writeStmt->setString(2, item->getSource());
00064     m_writeStmt->setString(3, item->getComment());
00065     
00066     m_writeStmt->executeUpdate();
00067   } catch (SQLException &e) {
00068     throw(runtime_error("RunCommentDat::writeDB():  "+e.getMessage()));
00069   }
00070 }


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

std::string RunCommentDat::m_source [private]

Definition at line 38 of file RunCommentDat.h.

Referenced by getSource(), RunCommentDat(), and setSource().

Tm RunCommentDat::m_time [private]

Definition at line 40 of file RunCommentDat.h.

Referenced by getDBTime(), RunCommentDat(), and setDBTime().


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