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, ESProxyIndex const *getTokenIndices) const
 
eventsetup::EventSetupRecordImpl const * findImpl (const eventsetup::EventSetupRecordKey &) 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 eventsetup::EventSetupProvider
 Only EventSetupProvider allowed to create an EventSetupImpl. More...
 
class eventsetup::EventSetupRecordProvider
 

Detailed Description

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

Usage: <usage>

Definition at line 44 of file EventSetupImpl.h.

Constructor & Destructor Documentation

edm::EventSetupImpl::~EventSetupImpl ( )

Definition at line 28 of file EventSetupImpl.cc.

28 {}
edm::EventSetupImpl::EventSetupImpl ( EventSetupImpl const &  )
delete
edm::EventSetupImpl::EventSetupImpl ( )
private

Definition at line 26 of file EventSetupImpl.cc.

Referenced by edm::eventsetup::EventSetupProvider::eventSetupForInstance().

26 {}

Member Function Documentation

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

Definition at line 41 of file EventSetupImpl.cc.

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

41  {
42  insertRecordImpl(iRecord.key(), &iRecord);
43  }
void insertRecordImpl(const eventsetup::EventSetupRecordKey &, const eventsetup::EventSetupRecordImpl *)
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 68 of file EventSetupImpl.cc.

References recordImpls_.

68  {
69  oToFill.clear();
70  oToFill.reserve(recordImpls_.size());
71 
72  for (auto const& recordImpl : recordImpls_) {
73  if (recordImpl != nullptr) {
74  oToFill.push_back(recordImpl->key());
75  }
76  }
77  }
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_
std::optional< eventsetup::EventSetupRecordGeneric > edm::EventSetupImpl::find ( const eventsetup::EventSetupRecordKey iKey,
unsigned int  iTransitionID,
ESProxyIndex const *  getTokenIndices 
) const

Definition at line 45 of file EventSetupImpl.cc.

References HLT_2018_cff::distance, keysBegin_, keysEnd_, and recordImpls_.

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

Definition at line 59 of file EventSetupImpl.cc.

References HLT_2018_cff::distance, keysBegin_, keysEnd_, and recordImpls_.

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

Definition at line 30 of file EventSetupImpl.cc.

References HLT_2018_cff::distance, Exception, keysBegin_, keysEnd_, 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_
EventSetupImpl& edm::EventSetupImpl::operator= ( EventSetupImpl const &  )
delete
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 79 of file EventSetupImpl.cc.

References keysBegin_, and keysEnd_.

Referenced by edm::eventsetup::recordDoesExist().

79  {
80  auto lb = std::lower_bound(keysBegin_, keysEnd_, iKey);
81  return lb != keysEnd_ && iKey == *lb;
82  }
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysBegin_
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysEnd_
void edm::EventSetupImpl::setKeyIters ( std::vector< eventsetup::EventSetupRecordKey >::const_iterator const &  keysBegin,
std::vector< eventsetup::EventSetupRecordKey >::const_iterator const &  keysEnd 
)
private

Definition at line 93 of file EventSetupImpl.cc.

References keysBegin_, keysEnd_, and recordImpls_.

94  {
95  keysBegin_ = keysBegin;
96  keysEnd_ = keysEnd;
97  recordImpls_.resize(keysEnd_ - keysBegin_, nullptr);
98  }
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysBegin_
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysEnd_
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_
bool edm::EventSetupImpl::validRecord ( eventsetup::EventSetupRecordKey const &  iKey) const

Definition at line 84 of file EventSetupImpl.cc.

References HLT_2018_cff::distance, keysBegin_, keysEnd_, and recordImpls_.

84  {
85  auto lb = std::lower_bound(keysBegin_, keysEnd_, iKey);
86  if (lb != keysEnd_ && iKey == *lb) {
87  auto index = std::distance(keysBegin_, lb);
88  return recordImpls_[index] != nullptr;
89  }
90  return false;
91  }
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

friend class ::testEventsetup
friend

Definition at line 70 of file EventSetupImpl.h.

friend class eventsetup::EventSetupProvider
friend

Only EventSetupProvider allowed to create an EventSetupImpl.

Definition at line 68 of file EventSetupImpl.h.

Definition at line 69 of file EventSetupImpl.h.

Member Data Documentation

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