/
EventSetup.cc
121 lines (104 loc) · 2.35 KB
/
EventSetup.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// -*- C++ -*-
//
// Package: Framework
// Module: EventSetup
//
// Description: <one line class summary>
//
// Implementation:
// <Notes on implementation>
//
// Author: Chris Jones
// Created: Thu Mar 24 16:27:10 EST 2005
//
// system include files
// user include files
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/EventSetupRecord.h"
#include "FWCore/Framework/interface/EventSetupKnownRecordsSupplier.h"
namespace edm {
//
// constants, enums and typedefs
//
//
// static data member definitions
//
//
// constructors and destructor
//
EventSetup::EventSetup(ActivityRegistry* activityRegistry) :
recordMap_(),
activityRegistry_(activityRegistry)
{
}
// EventSetup::EventSetup(EventSetup const& rhs)
// {
// // do actual copying here;
// }
EventSetup::~EventSetup()
{
}
//
// assignment operators
//
// EventSetup const& EventSetup::operator=(EventSetup const& rhs)
// {
// //An exception safe implementation is
// EventSetup temp(rhs);
// swap(rhs);
//
// return *this;
// }
//
// member functions
//
void
EventSetup::insert(const eventsetup::EventSetupRecordKey& iKey,
const eventsetup::EventSetupRecord* iRecord)
{
recordMap_[iKey]= iRecord;
}
void
EventSetup::clear()
{
recordMap_.clear();
}
void
EventSetup::add(const eventsetup::EventSetupRecord& iRecord)
{
insert(iRecord.key(), &iRecord);
}
//
// const member functions
//
const eventsetup::EventSetupRecord*
EventSetup::find(const eventsetup::EventSetupRecordKey& iKey) const
{
std::map<eventsetup::EventSetupRecordKey, eventsetup::EventSetupRecord const *>::const_iterator itFind
= recordMap_.find(iKey);
if(itFind == recordMap_.end()) {
return nullptr;
}
return itFind->second;
}
void
EventSetup::fillAvailableRecordKeys(std::vector<eventsetup::EventSetupRecordKey>& oToFill) const
{
oToFill.clear();
oToFill.reserve(recordMap_.size());
typedef std::map<eventsetup::EventSetupRecordKey, eventsetup::EventSetupRecord const *> KeyToRecordMap;
for(KeyToRecordMap::const_iterator it = recordMap_.begin(), itEnd=recordMap_.end();
it != itEnd;
++it) {
oToFill.push_back(it->first);
}
}
bool
EventSetup::recordIsProvidedByAModule( eventsetup::EventSetupRecordKey const& iKey) const
{
return knownRecords_->isKnown(iKey);
}
//
// static member functions
//
}