CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
edm::test::EventSetupTestHelper Class Reference

#include <EventSetupTestHelper.h>

Inheritance diagram for edm::test::EventSetupTestHelper:
edm::eventsetup::DataProxyProvider edm::EventSetupRecordIntervalFinder

Public Member Functions

 EventSetupTestHelper (std::vector< ESProduceEntry >)
 
 EventSetupTestHelper (const EventSetupTestHelper &)=delete
 
std::shared_ptr< eventsetup::DataProxygetProxy (unsigned int index)
 
const EventSetupTestHelperoperator= (const EventSetupTestHelper &)=delete
 
void resetAllProxies ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
virtual void updateLookup (ESRecordsToProxyIndices const &)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
bool concurrentFinder () const
 
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
 EventSetupRecordIntervalFinder (const EventSetupRecordIntervalFinder &)=delete
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
bool nonconcurrentAndIOVNeedsUpdate (const eventsetup::EventSetupRecordKey &key, const IOVSyncValue &syncValue) const
 
const EventSetupRecordIntervalFinderoperator= (const EventSetupRecordIntervalFinder &)=delete
 
void resetInterval (const eventsetup::EventSetupRecordKey &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Protected Member Functions

KeyedProxiesVector registerProxies (const eventsetup::EventSetupRecordKey &, unsigned int iovIndex) final
 
void setIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &, ValidityInterval &) final
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Private Attributes

std::vector< ESProduceEntryproxies_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 

Detailed Description

Definition at line 34 of file EventSetupTestHelper.h.

Constructor & Destructor Documentation

◆ EventSetupTestHelper() [1/2]

EventSetupTestHelper::EventSetupTestHelper ( std::vector< ESProduceEntry iProxies)

Definition at line 22 of file EventSetupTestHelper.cc.

References eostools::move().

22  : proxies_{std::move(iProxies)} {
23  //Deal with duplicates
24  std::set<eventsetup::EventSetupRecordKey> records;
25  for (auto const& p : proxies_) {
26  records.insert(p.recordKey_);
27  }
28  for (auto const& k : records) {
31  }
32  }
void usingRecordWithKey(const EventSetupRecordKey &key)
std::vector< ESProduceEntry > proxies_
def move(src, dest)
Definition: eostools.py:511
void findingRecordWithKey(const eventsetup::EventSetupRecordKey &)

◆ EventSetupTestHelper() [2/2]

edm::test::EventSetupTestHelper::EventSetupTestHelper ( const EventSetupTestHelper )
delete

Member Function Documentation

◆ getProxy()

std::shared_ptr< eventsetup::DataProxy > EventSetupTestHelper::getProxy ( unsigned int  index)

Definition at line 70 of file EventSetupTestHelper.cc.

References proxies_.

70  {
71  return proxies_[iIndex].proxy_;
72  }
std::vector< ESProduceEntry > proxies_

◆ operator=()

const EventSetupTestHelper& edm::test::EventSetupTestHelper::operator= ( const EventSetupTestHelper )
delete

◆ registerProxies()

eventsetup::DataProxyProvider::KeyedProxiesVector EventSetupTestHelper::registerProxies ( const eventsetup::EventSetupRecordKey iRecordKey,
unsigned int  iovIndex 
)
finalprotectedvirtual

Implements edm::eventsetup::DataProxyProvider.

Definition at line 59 of file EventSetupTestHelper.cc.

References AlCaHLTBitMon_ParallelJobs::p, and proxies_.

60  {
61  KeyedProxiesVector keyedProxiesVector;
62  for (auto const& p : proxies_) {
63  if (p.recordKey_ == iRecordKey) {
64  keyedProxiesVector.emplace_back(p.dataKey_, p.proxy_);
65  }
66  }
67  return keyedProxiesVector;
68  }
std::vector< ESProduceEntry > proxies_
std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >> KeyedProxiesVector

◆ resetAllProxies()

void EventSetupTestHelper::resetAllProxies ( )

Definition at line 74 of file EventSetupTestHelper.cc.

References AlCaHLTBitMon_ParallelJobs::p, and proxies_.

74  {
75  for (auto const& p : proxies_) {
76  p.proxy_->invalidate();
77  }
78  }
std::vector< ESProduceEntry > proxies_

◆ setIntervalFor()

void EventSetupTestHelper::setIntervalFor ( const eventsetup::EventSetupRecordKey ,
const IOVSyncValue iSync,
ValidityInterval oIOV 
)
finalprotectedvirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 34 of file EventSetupTestHelper.cc.

References edm::IOVSyncValue::beginOfTime(), and edm::IOVSyncValue::endOfTime().

36  {
37  // Note that we manually invalidate the proxies at the end of every call
38  // to test. And the beginning of the call to test is the only opportunity
39  // to reset this data, so we are not relying on the EventSetup system
40  // to manage invalidating the proxies in EventSetupTestHelper. The only
41  // reasonable thing to do is return an interval for all time so the EventSetup
42  // system does not invalidate these proxies when it shouldn't. There are two
43  // weaknesses to this:
44  //
45  // 1. If for the same record type there are DataProxies both managed
46  // by this class and also others managed by the EventSetup, then
47  // at IOV boundaries for this record this will fail. The EventSetup
48  // will invalidate all the proxies for the record after this class
49  // has set the ones it manages and they will stay invalid when they
50  // are needed.
51  //
52  // 2. TestProcessor does not support the special case where the different
53  // transitions executed in one call to test have different IOVs and different
54  // EventSetup data. That would be a pretty strange case, especially for a test.
55 
57  }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88

Member Data Documentation

◆ proxies_

std::vector<ESProduceEntry> edm::test::EventSetupTestHelper::proxies_
private

Definition at line 51 of file EventSetupTestHelper.h.

Referenced by getProxy(), registerProxies(), and resetAllProxies().