CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/OnlineDB/EcalCondDB/interface/CaliIOV.h

Go to the documentation of this file.
00001 #ifndef CALIIOV_H
00002 #define CALIIOV_H
00003 
00004 #include <stdexcept>
00005 #include <iostream>
00006 
00007 #include "OnlineDB/EcalCondDB/interface/IIOV.h"
00008 #include "OnlineDB/EcalCondDB/interface/CaliTag.h"
00009 #include "OnlineDB/EcalCondDB/interface/Tm.h"
00010 
00011 typedef int run_t;
00012 
00013 class CaliIOV : public IIOV {
00014  public:
00015   friend class EcalCondDBInterface;
00016 
00017   CaliIOV();
00018   ~CaliIOV();
00019 
00020   // Methods for user data
00021 
00022   
00023   void setSince(Tm since);
00024   Tm getSince() const;
00025   void setTill(Tm till);
00026   Tm getTill() const;
00027   void setCaliTag(CaliTag tag);
00028   CaliTag getCaliTag() const;
00029 
00030   // Methods from IUniqueDBObject
00031   int getID(){ return m_ID;} ;
00032   int fetchID() throw(std::runtime_error);
00033   void setByID(int id) throw(std::runtime_error);
00034 
00035   // Operators
00036   inline bool operator==(const CaliIOV &m) const
00037     {
00038       return ( m_caliTag   == m.m_caliTag &&
00039                m_since == m.m_since &&
00040                m_till   == m.m_till );
00041     }
00042 
00043   inline bool operator!=(const CaliIOV &m) const { return !(*this == m); }
00044 
00045 
00046  private:
00047   // User data for this IOV
00048   Tm m_since;
00049   Tm m_till;
00050   CaliTag m_caliTag;
00051 
00052   int writeDB() throw(std::runtime_error);
00053   void setByTm(CaliTag* tag, Tm time) throw(std::runtime_error);
00054 };
00055 
00056 #endif