#include <ODBadTTDat.h>
Public Member Functions | |
int | getFedId () const |
int | getId () const |
int | getSMId () const |
int | getStatus () const |
std::string | getTable () |
int | getTRId () const |
int | getTTId () const |
ODBadTTDat () | |
void | setFedId (int dac) |
void | setId (int dac) |
void | setSMId (int dac) |
void | setStatus (int dac) |
void | setTRId (int dac) |
void | setTTId (int dac) |
~ODBadTTDat () | |
Private Member Functions | |
void | fetchData (std::vector< ODBadTTDat > *fillMap, ODBadTTInfo *iov) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeArrayDB (const std::vector< ODBadTTDat > data, ODBadTTInfo *iov) throw (std::runtime_error) |
void | writeDB (const ODBadTTDat *item, ODBadTTInfo *iov) throw (std::runtime_error) |
Private Attributes | |
int | m_fed |
int | m_ID |
int | m_sm |
int | m_t1 |
int | m_tt |
Friends | |
class | EcalCondDBInterface |
Definition at line 10 of file ODBadTTDat.h.
ODBadTTDat::ODBadTTDat | ( | ) |
Definition at line 10 of file ODBadTTDat.cc.
References NULL.
ODBadTTDat::~ODBadTTDat | ( | ) |
Definition at line 26 of file ODBadTTDat.cc.
{ }
void ODBadTTDat::fetchData | ( | std::vector< ODBadTTDat > * | fillMap, |
ODBadTTInfo * | iov | ||
) | throw (std::runtime_error) [private] |
Definition at line 68 of file ODBadTTDat.cc.
References o2o::iov, L1TEmulatorMonitor_cff::p, setFedId(), setStatus(), setTRId(), and setTTId().
{ this->checkConnection(); iov->setConnection(m_env, m_conn); int iovID = iov->fetchID(); if (!iovID) { // throw(std::runtime_error("ODBadTTDat::writeDB: IOV not in DB")); return; } try { m_readStmt->setSQL("SELECT * FROM " + getTable() + " WHERE rec_id = :rec_id order by tr_id, fed_id, tt_id "); m_readStmt->setInt(1, iovID); ResultSet* rset = m_readStmt->executeQuery(); // std::vector< ODBadTTDat > p; ODBadTTDat dat; while(rset->next()) { // dat.setId( rset->getInt(1) ); dat.setTRId( rset->getInt(2) ); dat.setFedId( rset->getInt(3) ); dat.setTTId( rset->getInt(4) ); dat.setStatus( rset->getInt(5) ); p->push_back( dat); } } catch (SQLException &e) { throw(std::runtime_error("ODBadTTDat::fetchData(): "+e.getMessage())); } }
int ODBadTTDat::getFedId | ( | ) | const [inline] |
Definition at line 29 of file ODBadTTDat.h.
References m_fed.
Referenced by writeArrayDB().
{ return m_fed; }
int ODBadTTDat::getId | ( | ) | const [inline] |
int ODBadTTDat::getSMId | ( | ) | const [inline] |
int ODBadTTDat::getStatus | ( | void | ) | const [inline] |
Definition at line 36 of file ODBadTTDat.h.
References m_t1.
Referenced by writeArrayDB().
{ return m_t1; }
std::string ODBadTTDat::getTable | ( | ) | [inline, virtual] |
int ODBadTTDat::getTRId | ( | ) | const [inline] |
Definition at line 26 of file ODBadTTDat.h.
References m_sm.
Referenced by writeArrayDB().
{ return m_sm; }
int ODBadTTDat::getTTId | ( | ) | const [inline] |
Definition at line 32 of file ODBadTTDat.h.
References m_tt.
Referenced by writeArrayDB().
{ return m_tt; }
void ODBadTTDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IODConfig.
Definition at line 32 of file ODBadTTDat.cc.
{ this->checkConnection(); try { m_writeStmt = m_conn->createStatement(); m_writeStmt->setSQL("INSERT INTO "+getTable()+" (rec_id, tr_id, fed_id, tt_id, status ) " "VALUES (:1, :2, :3, :4, :5 )"); } catch (SQLException &e) { throw(std::runtime_error("ODBadTTDat::prepareWrite(): "+e.getMessage())); } }
void ODBadTTDat::setFedId | ( | int | dac | ) | [inline] |
Definition at line 28 of file ODBadTTDat.h.
References m_fed.
Referenced by fetchData().
{ m_fed = dac; }
void ODBadTTDat::setId | ( | int | dac | ) | [inline] |
void ODBadTTDat::setSMId | ( | int | dac | ) | [inline] |
void ODBadTTDat::setStatus | ( | int | dac | ) | [inline] |
Definition at line 35 of file ODBadTTDat.h.
References m_t1.
Referenced by fetchData().
{ m_t1 = dac; }
void ODBadTTDat::setTRId | ( | int | dac | ) | [inline] |
Definition at line 25 of file ODBadTTDat.h.
References m_sm.
Referenced by fetchData().
{ m_sm = dac; }
void ODBadTTDat::setTTId | ( | int | dac | ) | [inline] |
Definition at line 31 of file ODBadTTDat.h.
References m_tt.
Referenced by fetchData().
{ m_tt = dac; }
void ODBadTTDat::writeArrayDB | ( | const std::vector< ODBadTTDat > | data, |
ODBadTTInfo * | iov | ||
) | throw (std::runtime_error) [private] |
Definition at line 104 of file ODBadTTDat.cc.
References prof2calltree::count, runTheMatrix::data, getFedId(), getStatus(), getTRId(), getTTId(), and o2o::iov.
{ this->checkConnection(); int iovID = iov->fetchID(); if (!iovID) { throw(std::runtime_error("ODDelays::writeArrayDB: ODBadTTInfo not in DB")); } int nrows=data.size(); int* ids= new int[nrows]; int* xx= new int[nrows]; int* yy= new int[nrows]; int* zz= new int[nrows]; int* st= new int[nrows]; ub2* ids_len= new ub2[nrows]; ub2* x_len= new ub2[nrows]; ub2* y_len= new ub2[nrows]; ub2* z_len= new ub2[nrows]; ub2* st_len= new ub2[nrows]; ODBadTTDat dataitem; for (size_t count = 0; count != data.size(); count++) { dataitem=data[count]; ids[count]=iovID; xx[count]=dataitem.getTRId(); yy[count]=dataitem.getFedId(); zz[count]=dataitem.getTTId(); st[count]=dataitem.getStatus(); ids_len[count]=sizeof(ids[count]); x_len[count]=sizeof(xx[count]); y_len[count]=sizeof(yy[count]); z_len[count]=sizeof(zz[count]); st_len[count]=sizeof(st[count]); } try { m_writeStmt->setDataBuffer(1, (dvoid*)ids, OCCIINT, sizeof(ids[0]),ids_len); m_writeStmt->setDataBuffer(2, (dvoid*)xx, OCCIINT , sizeof(xx[0]), x_len ); m_writeStmt->setDataBuffer(3, (dvoid*)yy, OCCIINT , sizeof(yy[0]), y_len ); m_writeStmt->setDataBuffer(4, (dvoid*)zz, OCCIINT , sizeof(zz[0]), z_len ); m_writeStmt->setDataBuffer(5, (dvoid*)st, OCCIINT , sizeof(st[0]), st_len ); m_writeStmt->executeArrayUpdate(nrows); delete [] ids; delete [] xx; delete [] yy; delete [] zz; delete [] st; delete [] ids_len; delete [] x_len; delete [] y_len; delete [] z_len; delete [] st_len; } catch (SQLException &e) { throw(std::runtime_error("ODBadTTDat::writeArrayDB(): "+e.getMessage())); } }
void ODBadTTDat::writeDB | ( | const ODBadTTDat * | item, |
ODBadTTInfo * | iov | ||
) | throw (std::runtime_error) [private] |
Definition at line 48 of file ODBadTTDat.cc.
{ this->checkConnection(); try { m_writeStmt->setInt(1, item->getId()); m_writeStmt->setInt(2, item->getTRId()); m_writeStmt->setInt(3, item->getFedId() ); m_writeStmt->setInt(4, item->getTTId() ); m_writeStmt->setInt(5, item->getStatus() ); m_writeStmt->executeUpdate(); } catch (SQLException &e) { throw(std::runtime_error("ODBadTTDat::writeDB(): "+e.getMessage())); } }
friend class EcalCondDBInterface [friend] |
Reimplemented from IDBObject.
Definition at line 12 of file ODBadTTDat.h.
int ODBadTTDat::m_fed [private] |
Definition at line 54 of file ODBadTTDat.h.
Referenced by getFedId(), and setFedId().
int ODBadTTDat::m_ID [private] |
Definition at line 57 of file ODBadTTDat.h.
int ODBadTTDat::m_sm [private] |
int ODBadTTDat::m_t1 [private] |
Definition at line 56 of file ODBadTTDat.h.
Referenced by getStatus(), and setStatus().
int ODBadTTDat::m_tt [private] |
Definition at line 55 of file ODBadTTDat.h.