CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Attributes
edmtest::AcquireIntESProducer Class Reference
Inheritance diagram for edmtest::AcquireIntESProducer:
edm::ESProducerExternalWork edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Classes

class  TestValue
 

Public Member Functions

int acquire (ESTestRecordI const &, edm::WaitingTaskWithArenaHolder)
 
 AcquireIntESProducer (edm::ParameterSet const &)
 
 AcquireIntESProducer (const AcquireIntESProducer &)=delete
 
 AcquireIntESProducer (AcquireIntESProducer &&)=delete
 
std::optional< std::vector< TestValue > > acquireOptional (ESTestRecordI const &, edm::WaitingTaskWithArenaHolder)
 
std::unique_ptr< TestValueacquireUniquePtr (ESTestRecordI const &, edm::WaitingTaskWithArenaHolder)
 
void initConcurrentIOVs (EventSetupRecordKey const &, unsigned int nConcurrentIOVs) override
 
AcquireIntESProduceroperator= (const AcquireIntESProducer &)=delete
 
AcquireIntESProduceroperator= (AcquireIntESProducer &&)=delete
 
std::unique_ptr< ESTestDataIproduce (ESTestRecordI const &, int)
 
std::unique_ptr< ESTestDataBproduceESTestDataB (ESTestRecordB const &)
 
std::unique_ptr< ESTestDataIproduceOptional (ESTestRecordI const &, std::optional< std::vector< TestValue >>)
 
std::unique_ptr< ESTestDataIproduceUniquePtr (ESTestRecordI const &, std::unique_ptr< TestValue >)
 
 ~AcquireIntESProducer () override
 
- Public Member Functions inherited from edm::ESProducerExternalWork
 ESProducerExternalWork ()
 
template<typename T >
auto setWhatAcquiredProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatAcquiredProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatAcquiredProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatAcquiredProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TAcquireReturn , typename TProduceReturn , typename TRecord >
auto setWhatAcquiredProduced (T *iThis, TAcquireReturn(T::*iAcquireMethod)(const TRecord &, WaitingTaskWithArenaHolder), TProduceReturn(T::*iProduceMethod)(const TRecord &, TAcquireReturn), const es::Label &iLabel={})
 
template<typename T , typename TAcquireReturn , typename TProduceReturn , typename TRecord , typename TDecorator >
auto setWhatAcquiredProduced (T *iThis, TAcquireReturn(T::*iAcquireMethod)(const TRecord &, WaitingTaskWithArenaHolder), TProduceReturn(T ::*iProduceMethod)(const TRecord &, TAcquireReturn), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TAcquireFunc , typename TProduceFunc >
auto setWhatAcquiredProducedWithLambda (TAcquireFunc &&acquireFunc, TProduceFunc &&produceFunc, const es::Label &iLabel={})
 
template<typename TAcquireReturn , typename TProduceReturn , typename TRecord , typename TAcquireFunc , typename TProduceFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatAcquiredProducedWithLambda (TAcquireFunc &&acquireFunc, TProduceFunc &&produceFunc, TDecorator &&iDec, const es::Label &iLabel={})
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Attributes

std::vector< test_acquire::Cachecaches_
 
std::vector< TestValue * > lambdaOptionalTestPointers_
 
std::vector< TestValue * > lambdaUniqueTestPointers_
 
const unsigned int numberOfIOVsToAccumulate_
 
std::vector< TestValue * > optionalTestPointers_
 
const unsigned int secondsToWaitForWork_
 
std::unique_ptr< test_acquire::WaitingServerserver_
 
edm::ESGetToken< IOVTestInfo, ESTestRecordItoken_
 
std::vector< TestValue * > uniqueTestPointers_
 

Additional Inherited Members

- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Description: Used in tests of the asynchronous ESProducer.

Definition at line 46 of file AcquireIntESProducer.cc.

Constructor & Destructor Documentation

◆ AcquireIntESProducer() [1/3]

edmtest::AcquireIntESProducer::AcquireIntESProducer ( edm::ParameterSet const &  pset)

Definition at line 92 of file AcquireIntESProducer.cc.

References acquireOptional(), acquireUniquePtr(), Exception, SiStripGain_Fake_cff::Label, lambdaOptionalTestPointers_, lambdaUniqueTestPointers_, eostools::move(), produceESTestDataB(), produceOptional(), produceUniquePtr(), Hcal_FrontierConditions_cff::record, edm::ESProducerExternalWork::setWhatAcquiredProduced(), edm::ESProducerExternalWork::setWhatAcquiredProducedWithLambda(), edm::ESProducer::setWhatProduced(), and token_.

93  : numberOfIOVsToAccumulate_(pset.getUntrackedParameter<unsigned int>("numberOfIOVsToAccumulate")),
94  secondsToWaitForWork_(pset.getUntrackedParameter<unsigned int>("secondsToWaitForWork")) {
95  auto collector = setWhatAcquiredProduced(this, "fromAcquireIntESProducer");
96  token_ = collector.consumes<IOVTestInfo>(edm::ESInputTag{"", ""});
97 
99 
103  edm::es::Label("uniquePtr"));
104 
108  edm::es::Label("optional"));
109 
111  [this](ESTestRecordI const& record, edm::WaitingTaskWithArenaHolder holder) {
112  std::this_thread::sleep_for(200ms);
113  auto returnValue = std::make_unique<TestValue>(kAcquireTestValueUniquePtr1);
114  lambdaUniqueTestPointers_[record.iovIndex()] = returnValue.get();
115  return returnValue;
116  },
117  [this](ESTestRecordI const& record, auto testValue) {
118  std::this_thread::sleep_for(200ms);
119  if (testValue.get() != lambdaUniqueTestPointers_[record.iovIndex()]) {
120  throw cms::Exception("TestFailure") << "AcquireIntESProducer::<lambda produceUniquePtr>"
121  << " unexpected value passed in as argument";
122  }
123  return std::make_unique<ESTestDataI>(kAcquireTestValueUniquePtr2);
124  },
125  edm::es::Label("uniquePtrLambda"));
126 
128  [this](ESTestRecordI const& record, edm::WaitingTaskWithArenaHolder holder) {
129  std::this_thread::sleep_for(200ms);
130  std::vector<TestValue> testVector;
131  testVector.push_back(kAcquireTestValueOptional1);
132  auto returnValue = std::make_optional<std::vector<TestValue>>(std::move(testVector));
133  lambdaOptionalTestPointers_[record.iovIndex()] = &returnValue.value()[0];
134  return returnValue;
135  },
136  [this](ESTestRecordI const& record, std::optional<std::vector<TestValue>> testValue) {
137  std::this_thread::sleep_for(200ms);
138  if (&testValue.value()[0] != lambdaOptionalTestPointers_[record.iovIndex()]) {
139  throw cms::Exception("TestFailure") << "AcquireIntESProducer::<lambda produceOptional>"
140  << " unexpected value passed in as argument";
141  }
142  return std::make_unique<ESTestDataI>(kAcquireTestValueOptional2);
143  },
144  edm::es::Label("optionalLambda"));
145  }
auto setWhatAcquiredProducedWithLambda(TAcquireFunc &&acquireFunc, TProduceFunc &&produceFunc, const es::Label &iLabel={})
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
std::unique_ptr< ESTestDataI > produceOptional(ESTestRecordI const &, std::optional< std::vector< TestValue >>)
const unsigned int numberOfIOVsToAccumulate_
std::optional< std::vector< TestValue > > acquireOptional(ESTestRecordI const &, edm::WaitingTaskWithArenaHolder)
auto setWhatAcquiredProduced(T *iThis, const es::Label &iLabel={})
edm::ESGetToken< IOVTestInfo, ESTestRecordI > token_
std::unique_ptr< TestValue > acquireUniquePtr(ESTestRecordI const &, edm::WaitingTaskWithArenaHolder)
const unsigned int secondsToWaitForWork_
std::vector< TestValue * > lambdaOptionalTestPointers_
std::vector< TestValue * > lambdaUniqueTestPointers_
std::unique_ptr< ESTestDataB > produceESTestDataB(ESTestRecordB const &)
std::unique_ptr< ESTestDataI > produceUniquePtr(ESTestRecordI const &, std::unique_ptr< TestValue >)
def move(src, dest)
Definition: eostools.py:511

◆ ~AcquireIntESProducer()

edmtest::AcquireIntESProducer::~AcquireIntESProducer ( )
override

Definition at line 147 of file AcquireIntESProducer.cc.

References server_.

147  {
148  if (server_) {
149  server_->stop();
150  }
151  server_.reset();
152  }
std::unique_ptr< test_acquire::WaitingServer > server_

◆ AcquireIntESProducer() [2/3]

edmtest::AcquireIntESProducer::AcquireIntESProducer ( const AcquireIntESProducer )
delete

◆ AcquireIntESProducer() [3/3]

edmtest::AcquireIntESProducer::AcquireIntESProducer ( AcquireIntESProducer &&  )
delete

Member Function Documentation

◆ acquire()

int edmtest::AcquireIntESProducer::acquire ( ESTestRecordI const &  record,
edm::WaitingTaskWithArenaHolder  holder 
)

Definition at line 167 of file AcquireIntESProducer.cc.

References edmtest::IOVTestInfo::cacheIdentifier_, caches_, Exception, edm::ValidityInterval::first(), edmtest::IOVTestInfo::iovEndLumi_, edmtest::IOVTestInfo::iovEndRun_, edmtest::IOVTestInfo::iovIndex_, edmtest::IOVTestInfo::iovStartLumi_, edmtest::IOVTestInfo::iovStartRun_, edm::ValidityInterval::last(), edm::IOVSyncValue::luminosityBlockNumber(), edmtest::test_acquire::Cache::processed(), Hcal_FrontierConditions_cff::record, edmtest::test_acquire::Cache::retrieved(), server_, and token_.

167  {
168  std::this_thread::sleep_for(200ms);
169 
170  test_acquire::Cache& iovCache = caches_[record.iovIndex()];
171  iovCache.retrieved().clear();
172  iovCache.processed().clear();
173 
174  // Get some data and push it into the input cache for the ExternalWork.
175  // There is no significance to the particular data we are using.
176  // Using anything from the EventSetup would be good enough for the test.
177  // I already had test modules around that would make IOVTestInfo
178  // data, so that was easy to use. We put in known values and later
179  // check that we get the expected result (they get incremented by one
180  // to simulate some "external work", then summed in the produce method
181  // calculate a result we can check easily).
182  IOVTestInfo const& iovTestInfo = record.get(token_);
183  std::vector<int>& retrieved = iovCache.retrieved();
184  retrieved.push_back(iovTestInfo.iovStartRun_);
185  retrieved.push_back(iovTestInfo.iovStartLumi_);
186  retrieved.push_back(iovTestInfo.iovEndRun_);
187  retrieved.push_back(iovTestInfo.iovEndLumi_);
188  retrieved.push_back(iovTestInfo.cacheIdentifier_);
189 
190  server_->requestValuesAsync(record.iovIndex(), &iovCache.retrieved(), &iovCache.processed(), holder);
191 
192  edm::ValidityInterval iov = record.validityInterval();
193  if (iovTestInfo.iovStartLumi_ != iov.first().luminosityBlockNumber() ||
194  iovTestInfo.iovEndLumi_ != iov.last().luminosityBlockNumber() || iovTestInfo.iovIndex_ != record.iovIndex() ||
195  iovTestInfo.cacheIdentifier_ != record.cacheIdentifier()) {
196  throw cms::Exception("TestFailure") << "AcquireIntESProducer::acquire"
197  << "read values do not agree with record";
198  }
199  return kAcquireTestValue;
200  }
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
std::unique_ptr< test_acquire::WaitingServer > server_
edm::ESGetToken< IOVTestInfo, ESTestRecordI > token_
unsigned int iovEndRun_
Definition: IOVTestInfo.h:23
unsigned int iovStartLumi_
Definition: IOVTestInfo.h:22
std::vector< test_acquire::Cache > caches_
unsigned long long cacheIdentifier_
Definition: IOVTestInfo.h:26
unsigned int iovStartRun_
Definition: IOVTestInfo.h:21
std::vector< int > const & processed() const
Definition: WaitingServer.h:62
std::vector< int > const & retrieved() const
Definition: WaitingServer.h:59

◆ acquireOptional()

std::optional< std::vector< AcquireIntESProducer::TestValue > > edmtest::AcquireIntESProducer::acquireOptional ( ESTestRecordI const &  record,
edm::WaitingTaskWithArenaHolder  holder 
)

Definition at line 249 of file AcquireIntESProducer.cc.

References eostools::move(), optionalTestPointers_, and Hcal_FrontierConditions_cff::record.

Referenced by AcquireIntESProducer().

250  {
251  std::this_thread::sleep_for(200ms);
252  std::vector<TestValue> testVector;
253  testVector.push_back(kAcquireTestValueOptional1);
254  auto returnValue = std::make_optional<std::vector<TestValue>>(std::move(testVector));
255  optionalTestPointers_[record.iovIndex()] = &returnValue.value()[0];
256  return returnValue;
257  }
std::vector< TestValue * > optionalTestPointers_
def move(src, dest)
Definition: eostools.py:511

◆ acquireUniquePtr()

std::unique_ptr< AcquireIntESProducer::TestValue > edmtest::AcquireIntESProducer::acquireUniquePtr ( ESTestRecordI const &  record,
edm::WaitingTaskWithArenaHolder  holder 
)

Definition at line 231 of file AcquireIntESProducer.cc.

References Hcal_FrontierConditions_cff::record, and uniqueTestPointers_.

Referenced by AcquireIntESProducer().

232  {
233  std::this_thread::sleep_for(200ms);
234  auto returnValue = std::make_unique<TestValue>(kAcquireTestValueUniquePtr1);
235  uniqueTestPointers_[record.iovIndex()] = returnValue.get();
236  return returnValue;
237  }
std::vector< TestValue * > uniqueTestPointers_

◆ fillDescriptions()

void edmtest::AcquireIntESProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 269 of file AcquireIntESProducer.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

269  {
271  desc.addUntracked<unsigned int>("numberOfIOVsToAccumulate", 8);
272  desc.addUntracked<unsigned int>("secondsToWaitForWork", 1);
273  descriptions.addDefault(desc);
274  }
void addDefault(ParameterSetDescription const &psetDescription)

◆ initConcurrentIOVs()

void edmtest::AcquireIntESProducer::initConcurrentIOVs ( EventSetupRecordKey const &  key,
unsigned int  nConcurrentIOVs 
)
overridevirtual

Reimplemented from edm::eventsetup::ESProductResolverProvider.

Definition at line 154 of file AcquireIntESProducer.cc.

References caches_, submitPVResolutionJobs::key, lambdaOptionalTestPointers_, lambdaUniqueTestPointers_, ConfigBuilder::nConcurrentIOVs, numberOfIOVsToAccumulate_, optionalTestPointers_, secondsToWaitForWork_, server_, and uniqueTestPointers_.

154  {
155  if (key == EventSetupRecordKey::makeKey<ESTestRecordI>()) {
156  caches_.resize(nConcurrentIOVs);
157  server_ = std::make_unique<test_acquire::WaitingServer>(
159  server_->start();
164  }
165  }
const unsigned int numberOfIOVsToAccumulate_
std::unique_ptr< test_acquire::WaitingServer > server_
std::vector< TestValue * > optionalTestPointers_
std::vector< test_acquire::Cache > caches_
key
prepare the HTCondor submission files and eventually submit them
const unsigned int secondsToWaitForWork_
std::vector< TestValue * > lambdaOptionalTestPointers_
std::vector< TestValue * > uniqueTestPointers_
std::vector< TestValue * > lambdaUniqueTestPointers_

◆ operator=() [1/2]

AcquireIntESProducer& edmtest::AcquireIntESProducer::operator= ( const AcquireIntESProducer )
delete

◆ operator=() [2/2]

AcquireIntESProducer& edmtest::AcquireIntESProducer::operator= ( AcquireIntESProducer &&  )
delete

◆ produce()

std::unique_ptr< ESTestDataI > edmtest::AcquireIntESProducer::produce ( ESTestRecordI const &  record,
int  valueReturnedByAcquire 
)

Definition at line 202 of file AcquireIntESProducer.cc.

References edmtest::IOVTestInfo::cacheIdentifier_, caches_, Exception, edm::ValidityInterval::first(), edmtest::IOVTestInfo::iovEndLumi_, edmtest::IOVTestInfo::iovIndex_, edmtest::IOVTestInfo::iovStartLumi_, edm::ValidityInterval::last(), edm::IOVSyncValue::luminosityBlockNumber(), edmtest::test_acquire::Cache::processed(), Hcal_FrontierConditions_cff::record, token_, and findQualityFiles::v.

202  {
203  std::this_thread::sleep_for(200ms);
204 
205  if (valueReturnedByAcquire != kAcquireTestValue) {
206  throw cms::Exception("TestFailure") << "AcquireIntESProducer::produce"
207  << " unexpected value passed in as argument";
208  }
209 
210  edm::ESHandle<IOVTestInfo> iovTestInfo = record.getHandle(token_);
211  edm::ValidityInterval iov = record.validityInterval();
212  if (iovTestInfo->iovStartLumi_ != iov.first().luminosityBlockNumber() ||
213  iovTestInfo->iovEndLumi_ != iov.last().luminosityBlockNumber() || iovTestInfo->iovIndex_ != record.iovIndex() ||
214  iovTestInfo->cacheIdentifier_ != record.cacheIdentifier()) {
215  throw cms::Exception("TestFailure") << "AcquireIntESProducer::produce"
216  << "read values do not agree with record";
217  }
218 
219  test_acquire::Cache& iovCache = caches_[record.iovIndex()];
220  int sum = 0;
221  for (auto v : iovCache.processed()) {
222  sum += v;
223  }
224  return std::make_unique<ESTestDataI>(sum);
225  }
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
edm::ESGetToken< IOVTestInfo, ESTestRecordI > token_
unsigned int iovStartLumi_
Definition: IOVTestInfo.h:22
std::vector< test_acquire::Cache > caches_
unsigned long long cacheIdentifier_
Definition: IOVTestInfo.h:26
std::vector< int > const & processed() const
Definition: WaitingServer.h:62

◆ produceESTestDataB()

std::unique_ptr< ESTestDataB > edmtest::AcquireIntESProducer::produceESTestDataB ( ESTestRecordB const &  )

Definition at line 227 of file AcquireIntESProducer.cc.

Referenced by AcquireIntESProducer().

227  {
228  return std::make_unique<ESTestDataB>(11);
229  }

◆ produceOptional()

std::unique_ptr< ESTestDataI > edmtest::AcquireIntESProducer::produceOptional ( ESTestRecordI const &  )

Definition at line 259 of file AcquireIntESProducer.cc.

References Exception, optionalTestPointers_, and Hcal_FrontierConditions_cff::record.

Referenced by AcquireIntESProducer().

260  {
261  std::this_thread::sleep_for(200ms);
262  if (&testValue.value()[0] != optionalTestPointers_[record.iovIndex()]) {
263  throw cms::Exception("TestFailure") << "AcquireIntESProducer::produceOptional"
264  << " unexpected value passed in as argument";
265  }
266  return std::make_unique<ESTestDataI>(kAcquireTestValueOptional2);
267  }
std::vector< TestValue * > optionalTestPointers_

◆ produceUniquePtr()

std::unique_ptr< ESTestDataI > edmtest::AcquireIntESProducer::produceUniquePtr ( ESTestRecordI const &  record,
std::unique_ptr< TestValue testValue 
)

Definition at line 239 of file AcquireIntESProducer.cc.

References Exception, Hcal_FrontierConditions_cff::record, and uniqueTestPointers_.

Referenced by AcquireIntESProducer().

240  {
241  std::this_thread::sleep_for(200ms);
242  if (testValue.get() != uniqueTestPointers_[record.iovIndex()]) {
243  throw cms::Exception("TestFailure") << "AcquireIntESProducer::produceUniquePtr"
244  << " unexpected value passed in as argument";
245  }
246  return std::make_unique<ESTestDataI>(kAcquireTestValueUniquePtr2);
247  }
std::vector< TestValue * > uniqueTestPointers_

Member Data Documentation

◆ caches_

std::vector<test_acquire::Cache> edmtest::AcquireIntESProducer::caches_
private

Definition at line 82 of file AcquireIntESProducer.cc.

Referenced by acquire(), initConcurrentIOVs(), and produce().

◆ lambdaOptionalTestPointers_

std::vector<TestValue*> edmtest::AcquireIntESProducer::lambdaOptionalTestPointers_
private

Definition at line 89 of file AcquireIntESProducer.cc.

Referenced by AcquireIntESProducer(), and initConcurrentIOVs().

◆ lambdaUniqueTestPointers_

std::vector<TestValue*> edmtest::AcquireIntESProducer::lambdaUniqueTestPointers_
private

Definition at line 88 of file AcquireIntESProducer.cc.

Referenced by AcquireIntESProducer(), and initConcurrentIOVs().

◆ numberOfIOVsToAccumulate_

const unsigned int edmtest::AcquireIntESProducer::numberOfIOVsToAccumulate_
private

Definition at line 84 of file AcquireIntESProducer.cc.

Referenced by initConcurrentIOVs().

◆ optionalTestPointers_

std::vector<TestValue*> edmtest::AcquireIntESProducer::optionalTestPointers_
private

Definition at line 87 of file AcquireIntESProducer.cc.

Referenced by acquireOptional(), initConcurrentIOVs(), and produceOptional().

◆ secondsToWaitForWork_

const unsigned int edmtest::AcquireIntESProducer::secondsToWaitForWork_
private

Definition at line 85 of file AcquireIntESProducer.cc.

Referenced by initConcurrentIOVs().

◆ server_

std::unique_ptr<test_acquire::WaitingServer> edmtest::AcquireIntESProducer::server_
private

Definition at line 83 of file AcquireIntESProducer.cc.

Referenced by acquire(), initConcurrentIOVs(), and ~AcquireIntESProducer().

◆ token_

edm::ESGetToken<IOVTestInfo, ESTestRecordI> edmtest::AcquireIntESProducer::token_
private

Definition at line 81 of file AcquireIntESProducer.cc.

Referenced by acquire(), AcquireIntESProducer(), and produce().

◆ uniqueTestPointers_

std::vector<TestValue*> edmtest::AcquireIntESProducer::uniqueTestPointers_
private

Definition at line 86 of file AcquireIntESProducer.cc.

Referenced by acquireUniquePtr(), initConcurrentIOVs(), and produceUniquePtr().