CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EventSetupRecordIntervalFinder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Framework
4 // Class : EventSetupRecordIntervalFinder
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Author: Chris Jones
10 // Created: Wed Mar 30 14:27:26 EST 2005
11 // $Id: EventSetupRecordIntervalFinder.cc,v 1.8 2008/06/04 20:20:48 chrjones Exp $
12 //
13 
14 // system include files
15 
16 // user include files
18 #include <cassert>
19 
20 //
21 // constants, enums and typedefs
22 //
23 using namespace edm::eventsetup;
24 namespace edm {
25 //
26 // static data member definitions
27 //
28 
29 //
30 // constructors and destructor
31 //
32 //EventSetupRecordIntervalFinder::EventSetupRecordIntervalFinder()
33 //{
34 //}
35 
36 // EventSetupRecordIntervalFinder::EventSetupRecordIntervalFinder(const EventSetupRecordIntervalFinder& rhs)
37 // {
38 // // do actual copying here;
39 // }
40 
42 {
43 }
44 
45 //
46 // assignment operators
47 //
48 // const EventSetupRecordIntervalFinder& EventSetupRecordIntervalFinder::operator=(const EventSetupRecordIntervalFinder& rhs)
49 // {
50 // //An exception safe implementation is
51 // EventSetupRecordIntervalFinder temp(rhs);
52 // swap(rhs);
53 //
54 // return *this;
55 // }
56 
57 //
58 // member functions
59 //
60 const ValidityInterval&
62  const IOVSyncValue& iInstance)
63 {
64  Intervals::iterator itFound = intervals_.find(iKey);
65  assert(itFound != intervals_.end()) ;
66  if(! itFound->second.validFor(iInstance)) {
67  setIntervalFor(iKey, iInstance, itFound->second);
68  }
69  return itFound->second;
70 }
71 
72 void
74  intervals_.insert(Intervals::value_type(iKey, ValidityInterval()));
75 }
76 
77 void
79 {
80 }
81 
82 //
83 // const member functions
84 //
85 std::set<EventSetupRecordKey>
87 {
88  if(intervals_.empty()) {
89  //we are delaying our reading
90  const_cast<EventSetupRecordIntervalFinder*>(this)->delaySettingRecords();
91  }
92 
93  std::set<EventSetupRecordKey> returnValue;
94 
95  for(Intervals::const_iterator itEntry = intervals_.begin(), itEntryEnd = intervals_.end();
96  itEntry != itEntryEnd;
97  ++itEntry) {
98  returnValue.insert(returnValue.end(), itEntry->first);
99  }
100  return returnValue;
101 }
102 
103 //
104 // static member functions
105 //
106 }
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
std::set< eventsetup::EventSetupRecordKey > findingForRecords() const
Container::value_type value_type
const ValidityInterval & findIntervalFor(const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
void findingRecordWithKey(const eventsetup::EventSetupRecordKey &)