CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
edm::EventSetupImpl Class Reference

#include <EventSetupImpl.h>

Public Member Functions

 EventSetupImpl (EventSetupImpl const &)=delete
 
void fillAvailableRecordKeys (std::vector< eventsetup::EventSetupRecordKey > &oToFill) const
 clears the oToFill vector and then fills it with the keys for all available records More...
 
std::optional< eventsetup::EventSetupRecordGenericfind (const eventsetup::EventSetupRecordKey &, unsigned int iTransitionID, ESResolverIndex const *getTokenIndices, ESParentContext const &iParent) const
 
eventsetup::EventSetupRecordImpl const * findImpl (const eventsetup::EventSetupRecordKey &) const
 
eventsetup::EventSetupRecordImpl const * findImpl (ESRecordIndex) const
 
EventSetupImploperator= (EventSetupImpl const &)=delete
 
bool recordIsProvidedByAModule (eventsetup::EventSetupRecordKey const &) const
 
bool validRecord (eventsetup::EventSetupRecordKey const &iKey) const
 
 ~EventSetupImpl ()
 

Protected Member Functions

void addRecordImpl (const eventsetup::EventSetupRecordImpl &iRecord)
 

Private Member Functions

 EventSetupImpl ()
 
void insertRecordImpl (const eventsetup::EventSetupRecordKey &, const eventsetup::EventSetupRecordImpl *)
 
void setKeyIters (std::vector< eventsetup::EventSetupRecordKey >::const_iterator const &keysBegin, std::vector< eventsetup::EventSetupRecordKey >::const_iterator const &keysEnd)
 

Private Attributes

std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysBegin_
 
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysEnd_
 
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_
 

Friends

class ::testEventsetup
 
class ::testEventsetupRecord
 
class eventsetup::EventSetupProvider
 Only EventSetupProvider allowed to create an EventSetupImpl. More...
 
class eventsetup::EventSetupRecordProvider
 
class ProcessBlockTransitionInfo
 

Detailed Description

Description: Container for all Records dealing with non-RunState info

Usage: <usage>

Definition at line 48 of file EventSetupImpl.h.

Constructor & Destructor Documentation

◆ ~EventSetupImpl()

edm::EventSetupImpl::~EventSetupImpl ( )

Definition at line 28 of file EventSetupImpl.cc.

28 {}

◆ EventSetupImpl() [1/2]

edm::EventSetupImpl::EventSetupImpl ( EventSetupImpl const &  )
delete

◆ EventSetupImpl() [2/2]

edm::EventSetupImpl::EventSetupImpl ( )
explicitprivate

Definition at line 26 of file EventSetupImpl.cc.

26 {}

Member Function Documentation

◆ addRecordImpl()

void edm::EventSetupImpl::addRecordImpl ( const eventsetup::EventSetupRecordImpl iRecord)
protected

Definition at line 41 of file EventSetupImpl.cc.

References insertRecordImpl(), and edm::eventsetup::EventSetupRecordImpl::key().

Referenced by edm::eventsetup::EventSetupRecordProvider::continueIOV(), and edm::eventsetup::EventSetupRecordProvider::initializeForNewIOV().

41  {
42  insertRecordImpl(iRecord.key(), &iRecord);
43  }
void insertRecordImpl(const eventsetup::EventSetupRecordKey &, const eventsetup::EventSetupRecordImpl *)

◆ fillAvailableRecordKeys()

void edm::EventSetupImpl::fillAvailableRecordKeys ( std::vector< eventsetup::EventSetupRecordKey > &  oToFill) const

clears the oToFill vector and then fills it with the keys for all available records

Definition at line 76 of file EventSetupImpl.cc.

References recordImpls_.

Referenced by edm::EventSetup::fillAvailableRecordKeys().

76  {
77  oToFill.clear();
78  oToFill.reserve(recordImpls_.size());
79 
80  for (auto const& recordImpl : recordImpls_) {
81  if (recordImpl != nullptr) {
82  oToFill.push_back(recordImpl->key());
83  }
84  }
85  }
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_

◆ find()

std::optional< eventsetup::EventSetupRecordGeneric > edm::EventSetupImpl::find ( const eventsetup::EventSetupRecordKey iKey,
unsigned int  iTransitionID,
ESResolverIndex const *  getTokenIndices,
ESParentContext const &  iParent 
) const

Definition at line 45 of file EventSetupImpl.cc.

References HLT_2024v14_cff::distance, keysBegin_, keysEnd_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, and recordImpls_.

Referenced by edm::EventSetup::find().

48  {
49  auto lb = std::lower_bound(keysBegin_, keysEnd_, iKey);
50  if (lb == keysEnd_ || iKey != *lb) {
51  return std::nullopt;
52  }
53  auto index = std::distance(keysBegin_, lb);
54  if (recordImpls_[index] == nullptr) {
55  return std::nullopt;
56  }
57  return eventsetup::EventSetupRecordGeneric(recordImpls_[index], iTransitionID, getTokenIndices, this, &iParent);
58  }
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysBegin_
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysEnd_
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_

◆ findImpl() [1/2]

eventsetup::EventSetupRecordImpl const * edm::EventSetupImpl::findImpl ( const eventsetup::EventSetupRecordKey iKey) const

Definition at line 60 of file EventSetupImpl.cc.

References HLT_2024v14_cff::distance, keysBegin_, keysEnd_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, and recordImpls_.

Referenced by edm::EventSetup::get(), and edm::EventSetup::tryToGet().

60  {
61  auto lb = std::lower_bound(keysBegin_, keysEnd_, iKey);
62  if (lb == keysEnd_ || iKey != *lb) {
63  return nullptr;
64  }
65  auto index = std::distance(keysBegin_, lb);
66  return recordImpls_[index];
67  }
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysBegin_
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysEnd_
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_

◆ findImpl() [2/2]

eventsetup::EventSetupRecordImpl const * edm::EventSetupImpl::findImpl ( ESRecordIndex  iKey) const

Definition at line 69 of file EventSetupImpl.cc.

References edm::ESRecordIndex::invalidValue(), recordImpls_, UNLIKELY, and edm::ESRecordIndex::value().

69  {
70  if UNLIKELY (iKey.value() == ESRecordIndex::invalidValue()) {
71  return nullptr;
72  }
73  return recordImpls_[iKey.value()];
74  }
static constexpr Value_t invalidValue()
Definition: ESIndices.h:97
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_
#define UNLIKELY(x)
Definition: Likely.h:21

◆ insertRecordImpl()

void edm::EventSetupImpl::insertRecordImpl ( const eventsetup::EventSetupRecordKey iKey,
const eventsetup::EventSetupRecordImpl iRecord 
)
private

Definition at line 30 of file EventSetupImpl.cc.

References HLT_2024v14_cff::distance, Exception, keysBegin_, keysEnd_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, and recordImpls_.

Referenced by addRecordImpl().

31  {
32  auto lb = std::lower_bound(keysBegin_, keysEnd_, iKey);
33  if (lb == keysEnd_ || iKey != *lb) {
34  throw cms::Exception("LogicError") << "EventSetupImpl::insert Could not find key\n"
35  << "Should be impossible. Please contact Framework developer.\n";
36  }
37  auto index = std::distance(keysBegin_, lb);
38  recordImpls_[index] = iRecord;
39  }
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysBegin_
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysEnd_
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_

◆ operator=()

EventSetupImpl& edm::EventSetupImpl::operator= ( EventSetupImpl const &  )
delete

◆ recordIsProvidedByAModule()

bool edm::EventSetupImpl::recordIsProvidedByAModule ( eventsetup::EventSetupRecordKey const &  iKey) const

returns true if the Record is provided by a Source or a Producer a value of true does not mean this EventSetup object holds such a record

Definition at line 87 of file EventSetupImpl.cc.

References keysBegin_, keysEnd_, and pfDeepBoostedJetPreprocessParams_cfi::lower_bound.

Referenced by edm::eventsetup::recordDoesExist(), and edm::EventSetup::recordIsProvidedByAModule().

87  {
88  auto lb = std::lower_bound(keysBegin_, keysEnd_, iKey);
89  return lb != keysEnd_ && iKey == *lb;
90  }
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysBegin_
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysEnd_

◆ setKeyIters()

void edm::EventSetupImpl::setKeyIters ( std::vector< eventsetup::EventSetupRecordKey >::const_iterator const &  keysBegin,
std::vector< eventsetup::EventSetupRecordKey >::const_iterator const &  keysEnd 
)
private

Definition at line 101 of file EventSetupImpl.cc.

References keysBegin_, keysEnd_, and recordImpls_.

102  {
103  keysBegin_ = keysBegin;
104  keysEnd_ = keysEnd;
105  recordImpls_.resize(keysEnd_ - keysBegin_, nullptr);
106  }
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysBegin_
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysEnd_
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_

◆ validRecord()

bool edm::EventSetupImpl::validRecord ( eventsetup::EventSetupRecordKey const &  iKey) const

Definition at line 92 of file EventSetupImpl.cc.

References HLT_2024v14_cff::distance, keysBegin_, keysEnd_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, and recordImpls_.

92  {
93  auto lb = std::lower_bound(keysBegin_, keysEnd_, iKey);
94  if (lb != keysEnd_ && iKey == *lb) {
95  auto index = std::distance(keysBegin_, lb);
96  return recordImpls_[index] != nullptr;
97  }
98  return false;
99  }
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysBegin_
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysEnd_
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_

Friends And Related Function Documentation

◆ ::testEventsetup

friend class ::testEventsetup
friend

Definition at line 75 of file EventSetupImpl.h.

◆ ::testEventsetupRecord

friend class ::testEventsetupRecord
friend

Definition at line 76 of file EventSetupImpl.h.

◆ eventsetup::EventSetupProvider

friend class eventsetup::EventSetupProvider
friend

Only EventSetupProvider allowed to create an EventSetupImpl.

Definition at line 73 of file EventSetupImpl.h.

◆ eventsetup::EventSetupRecordProvider

Definition at line 74 of file EventSetupImpl.h.

◆ ProcessBlockTransitionInfo

friend class ProcessBlockTransitionInfo
friend

Definition at line 77 of file EventSetupImpl.h.

Member Data Documentation

◆ keysBegin_

std::vector<eventsetup::EventSetupRecordKey>::const_iterator edm::EventSetupImpl::keysBegin_
private

◆ keysEnd_

std::vector<eventsetup::EventSetupRecordKey>::const_iterator edm::EventSetupImpl::keysEnd_
private

◆ recordImpls_

std::vector<eventsetup::EventSetupRecordImpl const*> edm::EventSetupImpl::recordImpls_
private