CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IOVElement.h
Go to the documentation of this file.
1 #ifndef Cond_IOVElement_h
2 #define Cond_IOVElement_h
3 
6 #include <string>
7 
8 namespace cond {
9 
13  class IOVElement {
14  public:
16  m_sinceTime(0),
17  m_wrapper(""),
18  m_oid(){}
19 
20  explicit IOVElement(cond::Time_t it) :
21  m_sinceTime(it),
22  m_wrapper(""),
23  m_oid(){}
24 
26  std::string const& itoken):
27  m_sinceTime(it),
28  m_wrapper(""),
29  m_oid(){
30  m_oid.fromString( itoken );
31  }
32 
34 
35  std::string token() const {
36  return m_oid.toString();
37  }
38 
39  bool operator==(IOVElement const & rh) const {
40  return sinceTime()==rh.sinceTime()
41  && token()==rh.token();
42  }
43 
45  if( !m_wrapper.empty() ){
46  const_cast<IOVElement*>(this)->m_oid = parser.parse( m_wrapper );
47  const_cast<IOVElement*>(this)->m_wrapper.clear();
48  }
49  }
50 
51  void swapOId( ora::ITokenWriter& writer ) const {
52  if( !m_oid.isInvalid() ){
53  const_cast<IOVElement*>(this)->m_wrapper = writer.write( m_oid );
54  }
55  }
56 
57  private:
61 };
62 
63 
64 } // ns cond
65 
66 
67 #endif
IOVElement(cond::Time_t it, std::string const &itoken)
Definition: IOVElement.h:25
virtual std::string write(const OId &oid)=0
std::string token() const
Definition: IOVElement.h:35
bool isInvalid() const
Definition: OId.cc:80
Definition: OId.h:8
bool operator==(IOVElement const &rh) const
Definition: IOVElement.h:39
void swapOId(ora::ITokenWriter &writer) const
Definition: IOVElement.h:51
unsigned long long Time_t
Definition: Time.h:16
cond::Time_t m_sinceTime
Definition: IOVElement.h:58
void swapToken(ora::ITokenParser &parser) const
Definition: IOVElement.h:44
ora::OId m_oid
Definition: IOVElement.h:60
IOVElement(cond::Time_t it)
Definition: IOVElement.h:20
virtual OId parse(const std::string &poolToken)=0
cond::Time_t sinceTime() const
Definition: IOVElement.h:33
std::string toString() const
Definition: OId.cc:58
std::string m_wrapper
Definition: IOVElement.h:59
bool fromString(const std::string &s)
Definition: OId.cc:64