29 namespace eventsetup {
47 transientAccessRequested_(
false) {}
56 esproducers.reserve(proxies_.size());
57 for (
auto const& iData : proxies_) {
60 esproducers.push_back(componentDescription);
66 std::vector<ComponentDescription const*> ret;
67 ret.reserve(proxies_.size());
68 for (
auto const& proxy : proxies_) {
69 ret.push_back(proxy->providerDescription());
77 if (
nullptr != proxy) {
91 std::lower_bound(keysForProxies_.begin(), keysForProxies_.end(), iKey))] = iProxy;
99 <<
" want to deliver type=\"" << iKey.
type().
name() <<
"\" label=\"" << iKey.
name().
value() <<
"\"\n" 100 <<
" from record " <<
key().
type().
name() <<
". The two providers are \n" 105 <<
"Please either\n remove one of these " 107 <<
"\n or find a way of configuring one of them so it does not deliver this data" 108 <<
"\n or use an es_prefer statement in the configuration to choose one.";
111 std::lower_bound(keysForProxies_.begin(), keysForProxies_.end(), iKey))] = iProxy;
116 auto lb =
std::lower_bound(keysForProxies_.begin(), keysForProxies_.end(), iKey);
118 keysForProxies_.insert(lb, iKey);
119 proxies_.insert(proxies_.begin() +
index, iProxy);
125 keysForProxies_.clear();
130 transientAccessRequested_ =
false;
135 bool returnValue = transientAccessRequested_;
136 transientAccessRequested_ =
false;
146 bool iTransientAccessOnly)
const {
147 if (iTransientAccessOnly) {
148 this->transientAccessRequested();
153 const void* hold =
nullptr;
155 if (
nullptr != proxy) {
158 hold = proxy->
get(*
this, iKey, iTransientAccessOnly, eventSetup_->activityRegistry());
172 bool iTransientAccessOnly,
174 DataKey const*& oGottenKey)
const {
178 if (iTransientAccessOnly) {
179 this->transientAccessRequested();
183 assert(
nullptr != proxy);
186 const void* hold =
nullptr;
188 auto const&
key = keysForProxies_[iProxyIndex.
value()];
192 [&]() { hold = proxy->
get(*
this,
key, iTransientAccessOnly, eventSetup_->activityRegistry()); });
203 auto lb =
std::lower_bound(keysForProxies_.begin(), keysForProxies_.end(), iKey);
204 if ((lb == keysForProxies_.end())
or (*lb != iKey)) {
212 if (
nullptr != proxy) {
215 [&]() { proxy->
doGet(*
this, aKey, aGetTransiently, eventSetup_->activityRegistry()); });
223 return nullptr != proxy;
228 if (
nullptr != proxy) {
236 if (
nullptr != proxy) {
243 oToFill = keysForProxies_;
247 if (iDesc && !iTag.
module().empty()) {
249 if (iDesc->
label_.empty()) {
256 <<
"EventSetup data was retrieved using an ESInputTag with the values\n" 257 <<
" moduleLabel = '" << iTag.
module() <<
"'\n" 258 <<
" dataLabel = '" << iTag.
data() <<
"'\n" 259 <<
"but the data matching the C++ class type and dataLabel comes from module type=" << iDesc->
type_ 260 <<
" label='" << iDesc->
label_ <<
"'.\n Please either change the ESInputTag's 'module' label to be " 261 << (iDesc->
label_.empty() ? iDesc->
type_ : iDesc->
label_) <<
"\n or add the EventSetup module " 262 << iTag.
module() <<
" to the configuration.";
271 std::ostringstream ost;
272 ost <<
"Using EventSetup component " << iDescription->
type_ <<
"/'" << iDescription->
label_ <<
"' to make data "
void getESProducers(std::vector< ComponentDescription const * > &esproducers)
bool cacheIsValid() const
virtual EventSetupRecordKey key() const =0
void const * get(EventSetupRecordImpl const &, DataKey const &iKey, bool iTransiently, ActivityRegistry const *) const
void addTraceInfoToCmsException(cms::Exception &iException, char const *iName, ComponentDescription const *, DataKey const &) const
DataProxy const * find(DataKey const &aKey) const
char const * name() const
std::vector< ComponentDescription const * > componentsForRegisteredDataKeys() const
there is a 1-to-1 correspondence between elements returned and the elements returned from fillRegiste...
void addTraceInfoToCmsException(cms::Exception &iException, char const *iName, ComponentDescription const *, DataKey const &) const
void validate(ComponentDescription const *, ESInputTag const &) const
void doGet(EventSetupRecordImpl const &iRecord, DataKey const &iKey, bool iTransiently, ActivityRegistry const *) const
void const * getFromProxy(DataKey const &iKey, ComponentDescription const *&iDesc, bool iTransientAccessOnly) const
ComponentDescription const * providerDescription(DataKey const &aKey) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
bool add(DataKey const &iKey, DataProxy const *iProxy)
const char * name() const
void set(ValidityInterval const &)
bool wasGotten(DataKey const &aKey) const
ComponentDescription const * providerDescription() const
returns the description of the DataProxyProvider which owns this Proxy
const TypeTag & type() const
void addContext(std::string const &context)
bool transientReset()
returns 'true' if a transient request has occurred since the last call to transientReset.
EventSetupRecordImpl(const EventSetupRecordKey &iKey)
constexpr Value_t value() const noexcept
const TypeTag & type() const
const NameTag & name() const
const char * value() const
auto wrap(F iFunc) -> decltype(iFunc())
void fillRegisteredDataKeys(std::vector< DataKey > &oToFill) const
clears the oToFill vector and then fills it with the keys for all registered data keys ...
DataProxy const * find(DataKey const &aKey) const
bool doGet(DataKey const &aKey, bool aGetTransiently=false) const
returns false if no data available for key