CMS 3D CMS Logo

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

LMFIOV Class Reference

#include <LMFIOV.h>

Inheritance diagram for LMFIOV:
LMFUnique IUniqueDBObject IDBObject

List of all members.

Public Member Functions

void dump () const
Tm getStart () const
Tm getStop () const
int getVmax () const
int getVmin () const
 LMFIOV ()
 LMFIOV (EcalDBConnection *c)
 LMFIOV (const oracle::occi::Environment *env, const oracle::occi::Connection *conn)
LMFIOVsetIOV (const Tm &start, const Tm &stop)
LMFIOVsetStart (const Tm &start)
LMFIOVsetStop (const Tm &stop)
LMFIOVsetVersions (int vmin, int vmax)
LMFIOVsetVmax (int vmax)
LMFIOVsetVmin (int vmin)
 ~LMFIOV ()

Private Member Functions

LMFUniquecreateObject () const
std::string fetchIdSql (Statement *stmt)
void fetchParentIDs ()
void getParameters (ResultSet *rset)
std::string setByIDSql (Statement *stmt, int id)
std::string writeDBSql (Statement *stmt)

Private Attributes

Tm m_iov_start
Tm m_iov_stop
int m_vmax
int m_vmin

Friends

class EcalCondDBInterface

Detailed Description

LMF IOV

Definition at line 17 of file LMFIOV.h.


Constructor & Destructor Documentation

LMFIOV::LMFIOV ( )

Definition at line 6 of file LMFIOV.cc.

References NULL.

{
  //standard
  m_env = NULL;
  m_conn = NULL;
  m_className = "LMFIOV";
  m_ID = 0;
  // custom
  m_iov_start = Tm();
  m_iov_stop  = Tm();
  m_vmin      = 0;
  m_vmax      = 0;
}
LMFIOV::LMFIOV ( EcalDBConnection c)

Definition at line 20 of file LMFIOV.cc.

References EcalDBConnection::getConn(), and EcalDBConnection::getEnv().

{
  //standard
  setConnection(c->getEnv(), c->getConn());
  m_className = "LMFIOV";
  m_ID = 0;
  // custom
  m_iov_start = Tm();
  m_iov_stop  = Tm();
  m_vmin      = 0;
  m_vmax      = 0;
}
LMFIOV::LMFIOV ( const oracle::occi::Environment *  env,
const oracle::occi::Connection *  conn 
)
LMFIOV::~LMFIOV ( )

Definition at line 33 of file LMFIOV.cc.

{
}

Member Function Documentation

LMFUnique * LMFIOV::createObject ( ) const [private, virtual]

Reimplemented from LMFUnique.

Definition at line 115 of file LMFIOV.cc.

References IDBObject::setConnection(), and matplotRender::t.

                                       {
  LMFIOV *t = new LMFIOV;
  t->setConnection(m_env, m_conn);
  return t;
}
void LMFIOV::dump ( void  ) const [virtual]

Reimplemented from LMFUnique.

Definition at line 121 of file LMFIOV.cc.

References gather_cfg::cout.

                        {
  cout << "################# LMFIOV ######################" << endl;
  cout << "id : " <<  m_ID << endl;
  cout << "Start: " <<  m_iov_start.str() << endl;
  cout << "Stop : " <<  m_iov_stop.str() << endl;
  cout << "Vers.: " <<  m_vmin << " - " << m_vmax << endl;
  cout << "################# LMFIOV ######################" << endl;
}
std::string LMFIOV::fetchIdSql ( Statement stmt) [private, virtual]

Reimplemented from LMFUnique.

Definition at line 83 of file LMFIOV.cc.

References DateHandler::tmToDate().

                                            {
  std::string sql = "SELECT IOV_ID FROM LMF_IOV "
    "WHERE IOV_START = :1 AND IOV_STOP = :2 AND "
    "VMIN = :3 AND VMIN = :4";
  DateHandler dm(m_env, m_conn);
  stmt->setSQL(sql);
  stmt->setDate(1, dm.tmToDate(m_iov_start));
  stmt->setDate(2, dm.tmToDate(m_iov_stop));
  stmt->setInt(3, m_vmin);
  stmt->setInt(4, m_vmax);
  return sql;
}
void LMFIOV::fetchParentIDs ( ) [inline, private, virtual]

Reimplemented from LMFUnique.

Definition at line 50 of file LMFIOV.h.

{}
void LMFIOV::getParameters ( ResultSet rset) [private, virtual]

Reimplemented from LMFUnique.

Definition at line 105 of file LMFIOV.cc.

References DateHandler::dateToTm().

                                          {
  Date d = rset->getDate(1);
  DateHandler dh(m_env, m_conn);
  m_iov_start = dh.dateToTm(d);
  d = rset->getDate(2);
  m_iov_stop = dh.dateToTm(d);
  m_vmin = rset->getInt(3);
  m_vmax = rset->getInt(4);
}
Tm LMFIOV::getStart ( ) const

Definition at line 67 of file LMFIOV.cc.

                          {
  return m_iov_start;
}
Tm LMFIOV::getStop ( ) const

Definition at line 71 of file LMFIOV.cc.

                         {
  return m_iov_stop;
}
int LMFIOV::getVmax ( ) const

Definition at line 79 of file LMFIOV.cc.

                          {
  return m_vmax;
}
int LMFIOV::getVmin ( ) const

Definition at line 75 of file LMFIOV.cc.

                          {
  return m_vmin;
}
std::string LMFIOV::setByIDSql ( Statement stmt,
int  id 
) [private, virtual]

Reimplemented from LMFUnique.

Definition at line 96 of file LMFIOV.cc.

{
  std::string sql = "SELECT IOV_START, IOV_STOP, VMIN, VMAX FROM LMF_IOV "
    "WHERE IOV_ID = :1";
  stmt->setSQL(sql);
  stmt->setInt(1, id);
  return sql;
}
LMFIOV & LMFIOV::setIOV ( const Tm start,
const Tm stop 
)

Definition at line 47 of file LMFIOV.cc.

                                                      {
  setStart(start);
  return setStop(stop);
}
LMFIOV & LMFIOV::setStart ( const Tm start)

Definition at line 37 of file LMFIOV.cc.

                                        {
  m_iov_start = start; 
  return *this;
}
LMFIOV & LMFIOV::setStop ( const Tm stop)

Definition at line 42 of file LMFIOV.cc.

                                      {
  m_iov_stop = stop;
  return *this;
}
LMFIOV & LMFIOV::setVersions ( int  vmin,
int  vmax 
)

Definition at line 62 of file LMFIOV.cc.

                                              {
  setVmin(vmin);
  return setVmax(vmax);
}
LMFIOV & LMFIOV::setVmax ( int  vmax)

Definition at line 57 of file LMFIOV.cc.

                                {
  m_vmax = vmax;
  return *this;
}
LMFIOV & LMFIOV::setVmin ( int  vmin)

Definition at line 52 of file LMFIOV.cc.

                                {
  m_vmin = vmin;
  return *this;
}
std::string LMFIOV::writeDBSql ( Statement stmt) [private, virtual]

Reimplemented from LMFUnique.

Definition at line 130 of file LMFIOV.cc.

References ExpressReco_HICollisions_FallBack::dump, and DateHandler::tmToDate().

{
  // check that everything has been setup
  std::string seqName = sequencePostfix(m_iov_start);
  std::string sql = "INSERT INTO LMF_IOV (IOV_ID, IOV_START, IOV_STOP, "
    "VMIN, VMAX) VALUES "
    "(lmf_iov_" + seqName + "_sq.NextVal, :1, :2, :3, :4)";
  stmt->setSQL(sql);
  DateHandler dm(m_env, m_conn);
  stmt->setDate(1, dm.tmToDate(m_iov_start));
  stmt->setDate(2, dm.tmToDate(m_iov_stop));
  stmt->setInt(3, m_vmin);
  stmt->setInt(4, m_vmax);
  if (m_debug) {
    dump();
  }
  return sql;
}

Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from LMFUnique.

Definition at line 19 of file LMFIOV.h.


Member Data Documentation

Definition at line 53 of file LMFIOV.h.

Definition at line 54 of file LMFIOV.h.

int LMFIOV::m_vmax [private]

Definition at line 56 of file LMFIOV.h.

int LMFIOV::m_vmin [private]

Definition at line 55 of file LMFIOV.h.