CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EventSetup.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Framework
4 // Module: EventSetup
5 //
6 // Description: <one line class summary>
7 //
8 // Implementation:
9 // <Notes on implementation>
10 //
11 // Author: Chris Jones
12 // Created: Thu Mar 24 16:27:10 EST 2005
13 //
14 
15 // system include files
16 
17 // user include files
20 
21 namespace edm {
22 //
23 // constants, enums and typedefs
24 //
25 
26 //
27 // static data member definitions
28 //
29 
30 //
31 // constructors and destructor
32 //
33  EventSetup::EventSetup() : syncValue_(IOVSyncValue::invalidIOVSyncValue()), recordMap_()
34 {
35 }
36 
37 // EventSetup::EventSetup(EventSetup const& rhs)
38 // {
39 // // do actual copying here;
40 // }
41 
43 {
44 }
45 
46 //
47 // assignment operators
48 //
49 // EventSetup const& EventSetup::operator=(EventSetup const& rhs)
50 // {
51 // //An exception safe implementation is
52 // EventSetup temp(rhs);
53 // swap(rhs);
54 //
55 // return *this;
56 // }
57 
58 //
59 // member functions
60 //
61 void
63  //will ultimately build our list of records
64  syncValue_ = iTime;
65 }
66 
67 void
69  const eventsetup::EventSetupRecord* iRecord)
70 {
71  recordMap_[iKey]= iRecord;
72 }
73 
74 void
76 {
77  recordMap_.clear();
78 }
79 
80 void
82 {
83  insert(iRecord.key(), &iRecord);
84 }
85 
86 //
87 // const member functions
88 //
91 {
92  std::map<eventsetup::EventSetupRecordKey, eventsetup::EventSetupRecord const *>::const_iterator itFind
93  = recordMap_.find(iKey);
94  if(itFind == recordMap_.end()) {
95  return 0;
96  }
97  return itFind->second;
98 }
99 
100 void
101 EventSetup::fillAvailableRecordKeys(std::vector<eventsetup::EventSetupRecordKey>& oToFill) const
102 {
103  oToFill.clear();
104  oToFill.reserve(recordMap_.size());
105 
106  typedef std::map<eventsetup::EventSetupRecordKey, eventsetup::EventSetupRecord const *> KeyToRecordMap;
107  for(KeyToRecordMap::const_iterator it = recordMap_.begin(), itEnd=recordMap_.end();
108  it != itEnd;
109  ++it) {
110  oToFill.push_back(it->first);
111  }
112 }
113 
114 //
115 // static member functions
116 //
117 }
virtual EventSetupRecordKey key() const =0
void insert(const eventsetup::EventSetupRecordKey &, const eventsetup::EventSetupRecord *)
Definition: EventSetup.cc:68
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
IOVSyncValue syncValue_
Definition: EventSetup.h:123
virtual ~EventSetup()
Definition: EventSetup.cc:42
std::map< eventsetup::EventSetupRecordKey, eventsetup::EventSetupRecord const * > recordMap_
Definition: EventSetup.h:126
void fillAvailableRecordKeys(std::vector< eventsetup::EventSetupRecordKey > &oToFill) const
clears the oToFill vector and then fills it with the keys for all available records ...
Definition: EventSetup.cc:101
void add(const eventsetup::EventSetupRecord &iRecord)
Definition: EventSetup.cc:81
void setIOVSyncValue(const IOVSyncValue &)
Definition: EventSetup.cc:62