CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/OnlineDB/EcalCondDB/interface/RunIOV.h

Go to the documentation of this file.
00001 #ifndef RUNIOV_H
00002 #define RUNIOV_H
00003 
00004 #include <stdexcept>
00005 #include <iostream>
00006 
00007 #include "OnlineDB/EcalCondDB/interface/IIOV.h"
00008 #include "OnlineDB/EcalCondDB/interface/RunTag.h"
00009 #include "OnlineDB/EcalCondDB/interface/Tm.h"
00010 
00011 typedef int run_t;
00012 
00013 class RunIOV : public IIOV {
00014  public:
00015   friend class EcalCondDBInterface;
00016 
00017   RunIOV();
00018   ~RunIOV();
00019 
00020   // Methods for user data
00021   void setRunNumber(run_t run);
00022   run_t getRunNumber() const;
00023   void setRunStart(Tm start);
00024   Tm getRunStart() const;
00025   void setRunEnd(Tm end);
00026   Tm getRunEnd() const;
00027   void setRunTag(RunTag tag);
00028   RunTag getRunTag() const;
00029   void setID(int id);
00030 
00031   void setDBInsertionTime(Tm dbtime){m_dbtime=dbtime;}
00032   Tm getDBInsertionTime(){return m_dbtime;}
00033  
00034 
00035   // Methods from IUniqueDBObject
00036   int getID(){ return m_ID;} ;
00037 
00038   int fetchID() throw(std::runtime_error);
00039   int fetchIDByRunAndTag() throw(std::runtime_error);
00040   void setByID(int id) throw(std::runtime_error);
00041 
00042   // operators
00043   inline bool operator==(const RunIOV &r) const
00044     {
00045       return (m_runNum   == r.m_runNum &&
00046               m_runStart == r.m_runStart &&
00047               m_runEnd   == r.m_runEnd &&
00048               m_runTag   == r.m_runTag);
00049     }
00050 
00051   inline bool operator!=(const RunIOV &r) const { return !(*this == r); }
00052 
00053  private:
00054   // User data for this IOV
00055   run_t m_runNum;
00056   Tm m_runStart;
00057   Tm m_runEnd;
00058   RunTag m_runTag;
00059   Tm m_dbtime;
00060 
00061   int writeDB() throw(std::runtime_error);
00062   int updateEndTimeDB() throw(std::runtime_error);
00063   int updateStartTimeDB() throw(std::runtime_error);
00064 
00065   void setByRun(RunTag* tag, run_t run) throw(std::runtime_error);
00066   void setByRun(std::string location, run_t run) throw(std::runtime_error);
00067   void setByRecentData(std::string dataTable, RunTag* tag, run_t run = (unsigned int)-1) throw(std::runtime_error);
00068   void setByRecentData(std::string dataTable, std::string location, run_t run) throw(std::runtime_error);
00069 
00070 
00071 /*   void fetchEarliest(RunIOV* fillIOV, RunTag* tag) const throw(std::runtime_error); */
00072 /*   void fetchLatest(RunIOV* fillIOV, RunTag* tag) const throw(std::runtime_error); */
00073 /*   oracle::occi::Statement* prepareFetch(const std::string sql, RunTag* tag) const throw(std::runtime_error); */
00074 /*   void fill(RunIOV* target, oracle::occi::ResultSet* rset) const throw(std::runtime_error); */
00075 
00076 /*   // Methods for fetching by Tm */
00077 /*   void fetchAt(RunIOV* iov, const Tm eventTm, RunTag* tag) const throw(std::runtime_error); */
00078 /*   void fetchWithin(std::vector<RunIOV>* fillVec, const Tm beginTm, const Tm endTm, RunTag* tag) const throw(std::runtime_error); */
00079 
00080 /*   // Methods for fetching by run_t */
00081 /*   void fetchAt(RunIOV* fillIOV, const run_t run, RunTag* tag) const throw(std::runtime_error); */
00082 /*   void fetchWithin(std::vector<RunIOV>* fillVec, const run_t beginRun, const run_t endRun, RunTag* tag) const throw(std::runtime_error); */
00083 };
00084 
00085 #endif