CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ()=delete
 
 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::EventSetupRecordGeneric
find (const eventsetup::EventSetupRecordKey &, unsigned int iTransitionID, ESProxyIndex 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
 
tbb::task_arena * taskArena () const
 
bool validRecord (eventsetup::EventSetupRecordKey const &iKey) const
 
 ~EventSetupImpl ()
 

Protected Member Functions

void addRecordImpl (const eventsetup::EventSetupRecordImpl &iRecord)
 

Private Member Functions

 EventSetupImpl (tbb::task_arena *)
 
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_
 
tbb::task_arena * taskArena_ = nullptr
 

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 49 of file EventSetupImpl.h.

Constructor & Destructor Documentation

edm::EventSetupImpl::~EventSetupImpl ( )

Definition at line 28 of file EventSetupImpl.cc.

28 {}
edm::EventSetupImpl::EventSetupImpl ( )
delete
edm::EventSetupImpl::EventSetupImpl ( EventSetupImpl const &  )
delete
edm::EventSetupImpl::EventSetupImpl ( tbb::task_arena *  iArena)
explicitprivate

Definition at line 26 of file EventSetupImpl.cc.

26 : taskArena_{iArena} {}
tbb::task_arena * taskArena_

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().

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 *)
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_
std::optional< eventsetup::EventSetupRecordGeneric > edm::EventSetupImpl::find ( const eventsetup::EventSetupRecordKey iKey,
unsigned int  iTransitionID,
ESProxyIndex const *  getTokenIndices,
ESParentContext const &  iParent 
) const

Definition at line 45 of file EventSetupImpl.cc.

References HLT_FULL_cff::distance, keysBegin_, keysEnd_, cuda_std::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_
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_
eventsetup::EventSetupRecordImpl const * edm::EventSetupImpl::findImpl ( const eventsetup::EventSetupRecordKey iKey) const

Definition at line 60 of file EventSetupImpl.cc.

References HLT_FULL_cff::distance, keysBegin_, keysEnd_, cuda_std::lower_bound(), and recordImpls_.

Referenced by edm::EDLooperBase::esPrefetchAsync(), edm::Worker::esPrefetchAsync(), edm::EventSetup::get(), edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::prefetchNeededDataAsync(), 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_
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_
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
void edm::EventSetupImpl::insertRecordImpl ( const eventsetup::EventSetupRecordKey iKey,
const eventsetup::EventSetupRecordImpl iRecord 
)
private

Definition at line 30 of file EventSetupImpl.cc.

References HLT_FULL_cff::distance, Exception, keysBegin_, keysEnd_, cuda_std::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_
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
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 87 of file EventSetupImpl.cc.

References keysBegin_, keysEnd_, and cuda_std::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_
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
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_
tbb::task_arena* edm::EventSetupImpl::taskArena ( ) const
inline

Definition at line 74 of file EventSetupImpl.h.

References taskArena_.

Referenced by edm::EDLooperBase::esPrefetchAsync(), edm::Worker::esPrefetchAsync(), and edm::eventsetup::DataProxy::get().

74 { return taskArena_; }
tbb::task_arena * taskArena_
bool edm::EventSetupImpl::validRecord ( eventsetup::EventSetupRecordKey const &  iKey) const

Definition at line 92 of file EventSetupImpl.cc.

References HLT_FULL_cff::distance, keysBegin_, keysEnd_, cuda_std::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_
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_

Friends And Related Function Documentation

friend class ::testEventsetup
friend

Definition at line 78 of file EventSetupImpl.h.

friend class ::testEventsetupRecord
friend

Definition at line 79 of file EventSetupImpl.h.

friend class eventsetup::EventSetupProvider
friend

Only EventSetupProvider allowed to create an EventSetupImpl.

Definition at line 76 of file EventSetupImpl.h.

Definition at line 77 of file EventSetupImpl.h.

friend class ProcessBlockTransitionInfo
friend

Definition at line 80 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
tbb::task_arena* edm::EventSetupImpl::taskArena_ = nullptr
private

Definition at line 98 of file EventSetupImpl.h.

Referenced by taskArena().