CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IOV.h
Go to the documentation of this file.
1 #ifndef IOVService_IOV_h
2 #define IOVService_IOV_h
4 #include <vector>
5 #include <string>
6 #include <algorithm>
7 #include <boost/bind.hpp>
8 
9 namespace cond {
10 
11  // old IOV (till cmssw 3.0.X)
12  class IOV {
13  public:
14  typedef std::pair<cond::Time_t, std::string> Item;
15  typedef std::vector<Item> Container;
18 
19  IOV(){}
20  IOV(int type, cond::Time_t since) :
21  timetype(type), firstsince(since){}
22 
23  virtual ~IOV(){}
24 
25 
26  size_t add(cond::Time_t time, std::string const & token) {
27  iov.push_back(Item(time, token));
28  return iov.size()-1;
29  }
30 
32  return std::lower_bound(iov.begin(),iov.end(),Item(time,""),
33  boost::bind(std::less<cond::Time_t>(),
34  boost::bind(&Item::first,_1),
35  boost::bind(&Item::first,_2)
36  )
37  );
38  }
39 
41  return std::lower_bound(iov.begin(),iov.end(),Item(time,""),
42  boost::bind(std::less<cond::Time_t>(),
43  boost::bind(&Item::first,_1),
44  boost::bind(&Item::first,_2)
45  )
46  );
47  }
48 
49 
51 
52  //std::map<unsigned long long,std::string> iov;
54  int timetype;
56  };
57 
58 }//ns cond
59 #endif
const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:22
void push_back(const Tp &x)
Definition: PVector.h:177
type
Definition: HCALResponse.h:22
iterator end()
Definition: PVector.h:67
cond::TimeType timeType() const
Definition: IOV.h:50
iterator begin()
Definition: PVector.h:62
Definition: IOV.h:12
Container iov
Definition: IOV.h:53
size_t add(cond::Time_t time, std::string const &token)
Definition: IOV.h:26
virtual ~IOV()
Definition: IOV.h:23
std::pair< cond::Time_t, std::string > Item
Definition: IOV.h:14
TimeType
Definition: Time.h:21
unsigned long long Time_t
Definition: Time.h:16
iterator find(cond::Time_t time)
Definition: IOV.h:31
IOV()
Definition: IOV.h:19
Container::iterator iterator
Definition: IOV.h:16
TimeType type
Definition: Time.h:41
int timetype
Definition: IOV.h:54
std::vector< Item > Container
Definition: IOV.h:15
IOV(int type, cond::Time_t since)
Definition: IOV.h:20
bool first
Definition: L1TdeRCT.cc:79
std::vector< Item >::iterator iterator
Definition: PVector.h:31
const_iterator find(cond::Time_t time) const
Definition: IOV.h:40
size_type size() const
Definition: PVector.h:102
std::vector< Item >::const_iterator const_iterator
Definition: PVector.h:29
Container::const_iterator const_iterator
Definition: IOV.h:17
cond::Time_t firstsince
Definition: IOV.h:55