CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edmtest::TestESSourceTestResolver Class Reference
Inheritance diagram for edmtest::TestESSourceTestResolver:
edm::eventsetup::ESSourceProductResolverNonConcurrentBase edm::eventsetup::ESSourceProductResolverBase edm::eventsetup::ESProductResolver

Public Member Functions

 TestESSourceTestResolver (TestESSource *testESSource)
 
- Public Member Functions inherited from edm::eventsetup::ESSourceProductResolverNonConcurrentBase
 ESSourceProductResolverNonConcurrentBase (edm::SerialTaskQueue *iQueue, std::mutex *iMutex)
 
std::mutex * mutex () const
 
edm::SerialTaskQueuequeue () const
 
- Public Member Functions inherited from edm::eventsetup::ESSourceProductResolverBase
 ESSourceProductResolverBase ()
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolver
bool cacheIsValid () const
 
 ESProductResolver ()
 
 ESProductResolver (ESProductResolver const &)=delete
 
void const * getAfterPrefetch (const EventSetupRecordImpl &iRecord, const DataKey &iKey, bool iTransiently) const
 
void invalidate ()
 
ESProductResolver const & operator= (ESProductResolver const &)=delete
 
void prefetchAsync (WaitingTaskHolder, EventSetupRecordImpl const &, DataKey const &, EventSetupImpl const *, ServiceToken const &, ESParentContext const &) const
 
ComponentDescription const * providerDescription () const
 returns the description of the ESProductResolverProvider which owns this Resolver More...
 
void resetIfTransient ()
 
void setProviderDescription (ComponentDescription const *iDesc)
 
virtual ~ESProductResolver ()
 

Private Member Functions

void const * getAfterPrefetchImpl () const override
 
void initializeForNewIOV () override
 
void prefetch (edm::eventsetup::DataKey const &, edm::EventSetupRecordDetails) override
 

Private Attributes

IOVTestInfo iovTestInfo_
 
TestESSourcetestESSource_
 

Additional Inherited Members

- Protected Member Functions inherited from edm::eventsetup::ESSourceProductResolverBase
void invalidateCache () override
 
void invalidateTransientCache () override
 
template<typename ASYNC , typename GUARD >
void prefetchAsyncImplTemplate (ASYNC iAsync, GUARD iGuardFactory, edm::WaitingTaskHolder iTask, edm::eventsetup::EventSetupRecordImpl const &iRecord, edm::eventsetup::DataKey const &iKey, edm::ESParentContext const &iContext)
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolver
void clearCacheIsValid ()
 

Detailed Description

Definition at line 43 of file TestESSource.cc.

Constructor & Destructor Documentation

◆ TestESSourceTestResolver()

edmtest::TestESSourceTestResolver::TestESSourceTestResolver ( TestESSource testESSource)

Member Function Documentation

◆ getAfterPrefetchImpl()

void const * edmtest::TestESSourceTestResolver::getAfterPrefetchImpl ( ) const
overrideprivatevirtual

used to retrieve the data from the implementation. The data is then cached locally.

Implements edm::eventsetup::ESProductResolver.

Definition at line 112 of file TestESSource.cc.

References iovTestInfo_.

112 { return &iovTestInfo_; }

◆ initializeForNewIOV()

void edmtest::TestESSourceTestResolver::initializeForNewIOV ( )
overrideprivatevirtual

Reimplemented from edm::eventsetup::ESProductResolver.

Definition at line 114 of file TestESSource.cc.

References edmtest::TestESSource::count2_, and testESSource_.

114  {
115  edm::LogAbsolute("TestESSourceTestResolver::initializeForNewIOV")
116  << "TestESSourceTestResolver::initializeForNewIOV";
118  }
Log< level::System, true > LogAbsolute
std::atomic< unsigned int > count2_
Definition: TestESSource.cc:68

◆ prefetch()

void edmtest::TestESSourceTestResolver::prefetch ( edm::eventsetup::DataKey const &  iKey,
edm::EventSetupRecordDetails  iRecord 
)
overrideprivatevirtual

Implements edm::eventsetup::ESSourceProductResolverBase.

Definition at line 90 of file TestESSource.cc.

References edmtest::TestESSource::busyWait(), edm::EventSetupRecordDetails::cacheIdentifier(), edmtest::IOVTestInfo::cacheIdentifier_, edmtest::TestESSource::count_, Exception, edm::ValidityInterval::first(), edmtest::IOVTestInfo::iovEndLumi_, edm::EventSetupRecordDetails::iovIndex(), edmtest::IOVTestInfo::iovIndex_, edmtest::IOVTestInfo::iovStartLumi_, iovTestInfo_, edm::ValidityInterval::last(), edm::IOVSyncValue::luminosityBlockNumber(), testESSource_, and edm::EventSetupRecordDetails::validityInterval().

90  {
92  if (testESSource_->count_.load() > 1) {
93  throw cms::Exception("TestFailure") << "TestESSourceTestResolver::getImpl,"
94  << " functions in mutex should not run concurrently";
95  }
96  testESSource_->busyWait("getImpl");
97 
99  edm::LogAbsolute("TestESSourceTestResolver")
100  << "TestESSoureTestResolver::getImpl startIOV = " << iov.first().luminosityBlockNumber()
101  << " endIOV = " << iov.last().luminosityBlockNumber() << " IOV index = " << iRecord.iovIndex()
102  << " cache identifier = " << iRecord.cacheIdentifier();
103 
106  iovTestInfo_.iovIndex_ = iRecord.iovIndex();
108 
110  }
const IOVSyncValue & last() const
LuminosityBlockNumber_t luminosityBlockNumber() const
Definition: IOVSyncValue.h:41
const IOVSyncValue & first() const
unsigned int iovEndLumi_
Definition: IOVTestInfo.h:24
unsigned int iovIndex_
Definition: IOVTestInfo.h:25
unsigned long long cacheIdentifier() const
ValidityInterval validityInterval() const
std::atomic< unsigned int > count_
Definition: TestESSource.cc:66
unsigned int iovStartLumi_
Definition: IOVTestInfo.h:22
void busyWait(char const *msg) const
unsigned long long cacheIdentifier_
Definition: IOVTestInfo.h:26
Log< level::System, true > LogAbsolute

Member Data Documentation

◆ iovTestInfo_

IOVTestInfo edmtest::TestESSourceTestResolver::iovTestInfo_
private

Definition at line 52 of file TestESSource.cc.

Referenced by getAfterPrefetchImpl(), and prefetch().

◆ testESSource_

TestESSource* edmtest::TestESSourceTestResolver::testESSource_
private

Definition at line 53 of file TestESSource.cc.

Referenced by initializeForNewIOV(), and prefetch().