Skip to content

Commit b5facf1

Browse files
committed
Delete unused code related to EventSetup
1 parent 3a272a9 commit b5facf1

File tree

10 files changed

+15
-192
lines changed

10 files changed

+15
-192
lines changed

FWCore/Concurrency/interface/include_first_syncWait.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//
44
// syncWait.h
55
//
6-
// This file must be included before any other file that include tbb headers
7-
//
86
// Created by Chris Jones on 2/24/21.
97
//
108
#include "FWCore/Concurrency/interface/WaitingTaskHolder.h"

FWCore/Framework/interface/DataProxy.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,13 @@
2121

2222
// system include files
2323
#include <atomic>
24-
#include <memory>
2524

2625
// user include files
2726
#include "FWCore/Utilities/interface/thread_safety_macros.h"
2827
#include "FWCore/Concurrency/interface/WaitingTaskHolder.h"
2928

3029
// forward declarations
3130
namespace edm {
32-
class ActivityRegistry;
3331
class EventSetupImpl;
3432
class ServiceToken;
3533
class ESParentContext;
@@ -56,12 +54,6 @@ namespace edm {
5654
ServiceToken const&,
5755
ESParentContext const&) const;
5856

59-
void const* get(EventSetupRecordImpl const&,
60-
DataKey const&,
61-
bool iTransiently,
62-
ActivityRegistry const*,
63-
EventSetupImpl const*,
64-
ESParentContext const&) const;
6557
void const* getAfterPrefetch(const EventSetupRecordImpl& iRecord, const DataKey& iKey, bool iTransiently) const;
6658

6759
///returns the description of the DataProxyProvider which owns this Proxy

FWCore/Framework/interface/ESSourceDataProxyBase.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "FWCore/Framework/interface/DataProxy.h"
2929
#include "FWCore/Framework/interface/EventSetupRecordDetails.h"
3030
#include "FWCore/Concurrency/interface/WaitingTaskList.h"
31+
#include "FWCore/ServiceRegistry/interface/ESParentContext.h"
3132

3233
// forward declarations
3334

FWCore/Framework/interface/EventSetupRecord.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,9 @@
5151

5252
// system include files
5353
#include <exception>
54-
#include <map>
5554
#include <memory>
5655
#include <utility>
5756
#include <vector>
58-
#include <atomic>
5957
#include <cassert>
6058
#include <limits>
6159

@@ -69,12 +67,11 @@ class testEventsetupRecord;
6967

7068
namespace edm {
7169
class ESHandleExceptionFactory;
72-
class ESInputTag;
70+
class ESParentContext;
7371
class EventSetupImpl;
7472

7573
namespace eventsetup {
7674
struct ComponentDescription;
77-
class DataProxy;
7875
class EventSetupRecordKey;
7976

8077
class EventSetupRecord {
@@ -174,7 +171,7 @@ namespace edm {
174171
ComponentDescription const* desc = nullptr;
175172
std::shared_ptr<ESHandleExceptionFactory> whyFailedFactory;
176173

177-
impl_->getImplementation(value, proxyIndex, H<T>::transientAccessOnly, desc, whyFailedFactory, eventSetupImpl_);
174+
impl_->getImplementation(value, proxyIndex, H<T>::transientAccessOnly, desc, whyFailedFactory);
178175

179176
if UNLIKELY (not value) {
180177
return H<T>(std::move(whyFailedFactory));
@@ -188,8 +185,6 @@ namespace edm {
188185

189186
ESParentContext const* esParentContext() const noexcept { return context_; }
190187

191-
void validate(ComponentDescription const*, ESInputTag const&) const;
192-
193188
void addTraceInfoToCmsException(cms::Exception& iException,
194189
char const* iName,
195190
ComponentDescription const*,
@@ -218,10 +213,6 @@ namespace edm {
218213
})};
219214
}
220215

221-
void const* getFromProxy(DataKey const& iKey,
222-
ComponentDescription const*& iDesc,
223-
bool iTransientAccessOnly) const;
224-
225216
static std::exception_ptr makeUninitializedTokenException(EventSetupRecordKey const&, TypeTag const&);
226217
static std::exception_ptr makeInvalidTokenException(EventSetupRecordKey const&, TypeTag const&, unsigned int);
227218
void throwWrongTransitionID() const;

FWCore/Framework/interface/EventSetupRecordImpl.h

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,13 @@ through the 'validityInterval' method.
4242
#include "FWCore/Framework/interface/EventSetupRecordKey.h"
4343
#include "FWCore/Concurrency/interface/WaitingTaskHolder.h"
4444
#include "FWCore/Utilities/interface/thread_safety_macros.h"
45-
#include "FWCore/ServiceRegistry/interface/ESParentContext.h"
4645
#include "FWCore/Utilities/interface/propagate_const.h"
47-
#include "FWCore/Utilities/interface/ESInputTag.h"
4846
#include "FWCore/Utilities/interface/ESIndices.h"
4947

5048
// system include files
5149
#include <exception>
52-
#include <map>
50+
#include <limits>
5351
#include <memory>
54-
#include <utility>
5552
#include <vector>
5653
#include <atomic>
5754
#include <cassert>
@@ -65,7 +62,6 @@ namespace edm {
6562

6663
class ActivityRegistry;
6764
class ESHandleExceptionFactory;
68-
class ESInputTag;
6965
class EventSetupImpl;
7066
class ServiceToken;
7167
class ESParentContext;
@@ -147,8 +143,6 @@ namespace edm {
147143

148144
DataProxy const* find(DataKey const& aKey) const;
149145

150-
void validate(ComponentDescription const*, ESInputTag const&) const;
151-
152146
ActivityRegistry const* activityRegistry() const noexcept { return activityRegistry_; }
153147

154148
void addTraceInfoToCmsException(cms::Exception& iException,
@@ -160,51 +154,17 @@ namespace edm {
160154
void resetIfTransientInProxies();
161155

162156
private:
163-
void const* getFromProxy(DataKey const& iKey,
164-
ComponentDescription const*& iDesc,
165-
bool iTransientAccessOnly,
166-
ESParentContext const&,
167-
EventSetupImpl const* = nullptr) const;
168-
169-
void const* getFromProxy(ESProxyIndex iProxyIndex,
170-
bool iTransientAccessOnly,
171-
ComponentDescription const*& iDesc,
172-
DataKey const*& oGottenKey,
173-
ESParentContext const&,
174-
EventSetupImpl const* = nullptr) const;
175-
176157
void const* getFromProxyAfterPrefetch(ESProxyIndex iProxyIndex,
177158
bool iTransientAccessOnly,
178159
ComponentDescription const*& iDesc,
179160
DataKey const*& oGottenKey) const;
180161

181-
template <typename DataT>
182-
void getImplementation(DataT const*& iData,
183-
char const* iName,
184-
ComponentDescription const*& iDesc,
185-
bool iTransientAccessOnly,
186-
std::shared_ptr<ESHandleExceptionFactory>& whyFailedFactory,
187-
ESParentContext const& iParent,
188-
EventSetupImpl const* iEventSetupImpl) const {
189-
DataKey dataKey(DataKey::makeTypeTag<DataT>(), iName, DataKey::kDoNotCopyMemory);
190-
191-
void const* pValue = this->getFromProxy(dataKey, iDesc, iTransientAccessOnly, iParent, iEventSetupImpl);
192-
if (nullptr == pValue) {
193-
whyFailedFactory = makeESHandleExceptionFactory([=] {
194-
NoProxyException<DataT> ex(this->key(), dataKey);
195-
return std::make_exception_ptr(ex);
196-
});
197-
}
198-
iData = reinterpret_cast<DataT const*>(pValue);
199-
}
200-
201162
template <typename DataT>
202163
void getImplementation(DataT const*& iData,
203164
ESProxyIndex iProxyIndex,
204165
bool iTransientAccessOnly,
205166
ComponentDescription const*& oDesc,
206-
std::shared_ptr<ESHandleExceptionFactory>& whyFailedFactory,
207-
EventSetupImpl const* iEventSetupImpl) const {
167+
std::shared_ptr<ESHandleExceptionFactory>& whyFailedFactory) const {
208168
DataKey const* dataKey = nullptr;
209169
if (iProxyIndex.value() == std::numeric_limits<int>::max()) {
210170
whyFailedFactory = makeESHandleExceptionFactory([=] {

FWCore/Framework/src/DataProxy.cc

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,11 @@
1010
// Created: Thu Mar 31 12:49:19 EST 2005
1111
//
1212

13-
// system include files
14-
#include <mutex>
15-
16-
// user include files
17-
#include "FWCore/Concurrency/interface/include_first_syncWait.h"
18-
1913
#include "FWCore/Framework/interface/DataProxy.h"
2014
#include "FWCore/Framework/interface/ComponentDescription.h"
2115
#include "FWCore/Framework/interface/MakeDataException.h"
22-
#include "FWCore/Framework/interface/EventSetupRecord.h"
23-
#include "FWCore/Framework/interface/EventSetupImpl.h"
24-
#include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
25-
#include "FWCore/ServiceRegistry/interface/ServiceRegistry.h"
26-
#include "FWCore/ServiceRegistry/interface/ESParentContext.h"
27-
#include "FWCore/Concurrency/interface/WaitingTaskList.h"
28-
#include "FWCore/Concurrency/interface/WaitingTaskHolder.h"
16+
#include "FWCore/Framework/interface/EventSetupRecordImpl.h"
17+
#include "FWCore/Utilities/interface/Likely.h"
2918

3019
namespace edm {
3120
namespace eventsetup {
@@ -96,18 +85,5 @@ namespace edm {
9685
return cache_;
9786
}
9887

99-
const void* DataProxy::get(const EventSetupRecordImpl& iRecord,
100-
const DataKey& iKey,
101-
bool iTransiently,
102-
ActivityRegistry const* activityRegistry,
103-
EventSetupImpl const* iEventSetupImpl,
104-
ESParentContext const& iParent) const {
105-
if (!cacheIsValid()) {
106-
throw edm::Exception(errors::LogicError) << "DataProxy::get called without first doing prefetch.\nThis should "
107-
"not be able to happen.\nPlease contact framework developers";
108-
}
109-
return getAfterPrefetch(iRecord, iKey, iTransiently);
110-
}
111-
11288
} // namespace eventsetup
11389
} // namespace edm

FWCore/Framework/src/EventSetupRecord.cc

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
#include <sstream>
1515

1616
// user include files
17+
#include "FWCore/Framework/interface/DataKeyTags.h"
1718
#include "FWCore/Framework/interface/EventSetupRecord.h"
1819
#include "FWCore/Framework/interface/EventSetupRecordKey.h"
1920
#include "FWCore/Framework/interface/ComponentDescription.h"
2021

21-
#include "FWCore/Utilities/interface/ESInputTag.h"
2222
#include "FWCore/Utilities/interface/Exception.h"
23+
#include "FWCore/Utilities/interface/TypeIDBase.h"
2324

2425
namespace {
2526
void throwWrongRecordType(const edm::TypeIDBase& aFromToken, const edm::eventsetup::EventSetupRecordKey& aRecord) {
@@ -31,8 +32,6 @@ namespace {
3132
namespace edm {
3233
namespace eventsetup {
3334

34-
typedef std::map<DataKey, const DataProxy*> Proxies;
35-
3635
EventSetupRecord::EventSetupRecord() {}
3736

3837
EventSetupRecord::~EventSetupRecord() {}
@@ -60,27 +59,6 @@ namespace edm {
6059
return impl_->providerDescription(aKey);
6160
}
6261

63-
void EventSetupRecord::validate(const ComponentDescription* iDesc, const ESInputTag& iTag) const {
64-
if (iDesc && !iTag.module().empty()) {
65-
bool matched = false;
66-
if (iDesc->label_.empty()) {
67-
matched = iDesc->type_ == iTag.module();
68-
} else {
69-
matched = iDesc->label_ == iTag.module();
70-
}
71-
if (!matched) {
72-
throw cms::Exception("EventSetupWrongModule")
73-
<< "EventSetup data was retrieved using an ESInputTag with the values\n"
74-
<< " moduleLabel = '" << iTag.module() << "'\n"
75-
<< " dataLabel = '" << iTag.data() << "'\n"
76-
<< "but the data matching the C++ class type and dataLabel comes from module type=" << iDesc->type_
77-
<< " label='" << iDesc->label_ << "'.\n Please either change the ESInputTag's 'module' label to be "
78-
<< (iDesc->label_.empty() ? iDesc->type_ : iDesc->label_) << "\n or add the EventSetup module "
79-
<< iTag.module() << " to the configuration.";
80-
}
81-
}
82-
}
83-
8462
void EventSetupRecord::addTraceInfoToCmsException(cms::Exception& iException,
8563
const char* iName,
8664
const ComponentDescription* iDescription,

FWCore/Framework/src/EventSetupRecordImpl.cc

Lines changed: 3 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@
1111
//
1212

1313
// system include files
14+
#include <algorithm>
1415
#include <cassert>
16+
#include <iterator>
1517
#include <sstream>
18+
#include <utility>
1619

1720
// user include files
1821
#include "FWCore/Framework/interface/EventSetupRecordImpl.h"
1922
#include "FWCore/Framework/interface/DataProxy.h"
2023
#include "FWCore/Framework/interface/ComponentDescription.h"
2124
#include "FWCore/ServiceRegistry/interface/ESParentContext.h"
2225

23-
#include "FWCore/Concurrency/interface/WaitingTaskHolder.h"
2426
#include "FWCore/Utilities/interface/ConvertException.h"
2527
#include "FWCore/Utilities/interface/Exception.h"
2628

@@ -179,60 +181,6 @@ namespace edm {
179181
}
180182
}
181183

182-
const void* EventSetupRecordImpl::getFromProxy(DataKey const& iKey,
183-
const ComponentDescription*& iDesc,
184-
bool iTransientAccessOnly,
185-
ESParentContext const& iParent,
186-
EventSetupImpl const* iEventSetupImpl) const {
187-
const DataProxy* proxy = this->find(iKey);
188-
189-
const void* hold = nullptr;
190-
191-
if (nullptr != proxy) {
192-
try {
193-
convertException::wrap([&]() {
194-
hold = proxy->get(*this, iKey, iTransientAccessOnly, activityRegistry_, iEventSetupImpl, iParent);
195-
iDesc = proxy->providerDescription();
196-
});
197-
} catch (cms::Exception& e) {
198-
addTraceInfoToCmsException(e, iKey.name().value(), proxy->providerDescription(), iKey);
199-
//NOTE: the above function can't do the 'throw' since it causes the C++ class type
200-
// of the throw to be changed, a 'rethrow' does not have that problem
201-
throw;
202-
}
203-
}
204-
return hold;
205-
}
206-
207-
const void* EventSetupRecordImpl::getFromProxy(ESProxyIndex iProxyIndex,
208-
bool iTransientAccessOnly,
209-
const ComponentDescription*& iDesc,
210-
DataKey const*& oGottenKey,
211-
ESParentContext const& iParent,
212-
EventSetupImpl const* iEventSetupImpl) const {
213-
if (iProxyIndex.value() >= static_cast<ESProxyIndex::Value_t>(proxies_.size())) {
214-
return nullptr;
215-
}
216-
217-
const DataProxy* proxy = proxies_[iProxyIndex.value()];
218-
assert(nullptr != proxy);
219-
iDesc = proxy->providerDescription();
220-
221-
const void* hold = nullptr;
222-
223-
auto const& key = keysForProxies_[iProxyIndex.value()];
224-
oGottenKey = &key;
225-
try {
226-
convertException::wrap([&]() {
227-
hold = proxy->get(*this, key, iTransientAccessOnly, activityRegistry_, iEventSetupImpl, iParent);
228-
});
229-
} catch (cms::Exception& e) {
230-
addTraceInfoToCmsException(e, key.name().value(), proxy->providerDescription(), key);
231-
throw;
232-
}
233-
return hold;
234-
}
235-
236184
void const* EventSetupRecordImpl::getFromProxyAfterPrefetch(ESProxyIndex iProxyIndex,
237185
bool iTransientAccessOnly,
238186
ComponentDescription const*& iDesc,
@@ -298,27 +246,6 @@ namespace edm {
298246
oToFill = keysForProxies_;
299247
}
300248

301-
void EventSetupRecordImpl::validate(const ComponentDescription* iDesc, const ESInputTag& iTag) const {
302-
if (iDesc && !iTag.module().empty()) {
303-
bool matched = false;
304-
if (iDesc->label_.empty()) {
305-
matched = iDesc->type_ == iTag.module();
306-
} else {
307-
matched = iDesc->label_ == iTag.module();
308-
}
309-
if (!matched) {
310-
throw cms::Exception("EventSetupWrongModule")
311-
<< "EventSetup data was retrieved using an ESInputTag with the values\n"
312-
<< " moduleLabel = '" << iTag.module() << "'\n"
313-
<< " dataLabel = '" << iTag.data() << "'\n"
314-
<< "but the data matching the C++ class type and dataLabel comes from module type=" << iDesc->type_
315-
<< " label='" << iDesc->label_ << "'.\n Please either change the ESInputTag's 'module' label to be "
316-
<< (iDesc->label_.empty() ? iDesc->type_ : iDesc->label_) << "\n or add the EventSetup module "
317-
<< iTag.module() << " to the configuration.";
318-
}
319-
}
320-
}
321-
322249
void EventSetupRecordImpl::addTraceInfoToCmsException(cms::Exception& iException,
323250
const char* iName,
324251
const ComponentDescription* iDescription,

0 commit comments

Comments
 (0)