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
21 
22 namespace edm {
23 //
24 // constants, enums and typedefs
25 //
26 
27 //
28 // static data member definitions
29 //
30 
31 //
32 // constructors and destructor
33 //
34  EventSetup::EventSetup() : syncValue_(IOVSyncValue::invalidIOVSyncValue()), recordMap_()
35 {
36 }
37 
38 // EventSetup::EventSetup(EventSetup const& rhs)
39 // {
40 // // do actual copying here;
41 // }
42 
44 {
45 }
46 
47 //
48 // assignment operators
49 //
50 // EventSetup const& EventSetup::operator=(EventSetup const& rhs)
51 // {
52 // //An exception safe implementation is
53 // EventSetup temp(rhs);
54 // swap(rhs);
55 //
56 // return *this;
57 // }
58 
59 //
60 // member functions
61 //
62 void
64  //will ultimately build our list of records
65  syncValue_ = iTime;
66 }
67 
68 void
70  const eventsetup::EventSetupRecord* iRecord)
71 {
72  recordMap_[iKey]= iRecord;
73 }
74 
75 void
77 {
78  recordMap_.clear();
79 }
80 
81 void
83 {
84  insert(iRecord.key(), &iRecord);
85 }
86 
87 //
88 // const member functions
89 //
92 {
93  std::map<eventsetup::EventSetupRecordKey, eventsetup::EventSetupRecord const *>::const_iterator itFind
94  = recordMap_.find(iKey);
95  if(itFind == recordMap_.end()) {
96  return 0;
97  }
98  return itFind->second;
99 }
100 
101 void
102 EventSetup::fillAvailableRecordKeys(std::vector<eventsetup::EventSetupRecordKey>& oToFill) const
103 {
104  oToFill.clear();
105  oToFill.reserve(recordMap_.size());
106 
107  typedef std::map<eventsetup::EventSetupRecordKey, eventsetup::EventSetupRecord const *> KeyToRecordMap;
108  for(KeyToRecordMap::const_iterator it = recordMap_.begin(), itEnd=recordMap_.end();
109  it != itEnd;
110  ++it) {
111  oToFill.push_back(it->first);
112  }
113 }
114 
115 bool
117 {
118  return knownRecords_->isKnown(iKey);
119 }
120 
121 //
122 // static member functions
123 //
124 }
virtual EventSetupRecordKey key() const =0
void insert(const eventsetup::EventSetupRecordKey &, const eventsetup::EventSetupRecord *)
Definition: EventSetup.cc:69
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:91
eventsetup::EventSetupKnownRecordsSupplier const * knownRecords_
Definition: EventSetup.h:145
virtual bool isKnown(EventSetupRecordKey const &) const =0
IOVSyncValue syncValue_
Definition: EventSetup.h:141
virtual ~EventSetup()
Definition: EventSetup.cc:43
std::map< eventsetup::EventSetupRecordKey, eventsetup::EventSetupRecord const * > recordMap_
Definition: EventSetup.h:144
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:102
bool recordIsProvidedByAModule(eventsetup::EventSetupRecordKey const &) const
Definition: EventSetup.cc:116
void add(const eventsetup::EventSetupRecord &iRecord)
Definition: EventSetup.cc:82
void setIOVSyncValue(const IOVSyncValue &)
Definition: EventSetup.cc:63