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 45 of file AcquireIntESProducer.cc.

Constructor & Destructor Documentation

◆ AcquireIntESProducer() [1/3]

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

Definition at line 91 of file AcquireIntESProducer.cc.

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

92  : numberOfIOVsToAccumulate_(pset.getUntrackedParameter<unsigned int>("numberOfIOVsToAccumulate")),
93  secondsToWaitForWork_(pset.getUntrackedParameter<unsigned int>("secondsToWaitForWork")) {
94  auto collector = setWhatAcquiredProduced(this, "fromAcquireIntESProducer");
95  token_ = collector.consumes<IOVTestInfo>(edm::ESInputTag{"", ""});
96 
98 
102  edm::es::Label("uniquePtr"));
103 
107  edm::es::Label("optional"));
108 
110  [this](ESTestRecordI const& record, edm::WaitingTaskWithArenaHolder holder) {
111  usleep(200000);
112  auto returnValue = std::make_unique<TestValue>(kAcquireTestValueUniquePtr1);
113  lambdaUniqueTestPointers_[record.iovIndex()] = returnValue.get();
114  return returnValue;
115  },
116  [this](ESTestRecordI const& record, auto testValue) {
117  usleep(200000);
118  if (testValue.get() != lambdaUniqueTestPointers_[record.iovIndex()]) {
119  throw cms::Exception("TestFailure") << "AcquireIntESProducer::<lambda produceUniquePtr>"
120  << " unexpected value passed in as argument";
121  }
122  return std::make_unique<ESTestDataI>(kAcquireTestValueUniquePtr2);
123  },
124  edm::es::Label("uniquePtrLambda"));
125 
127  [this](ESTestRecordI const& record, edm::WaitingTaskWithArenaHolder holder) {
128  usleep(200000);
129  std::vector<TestValue> testVector;
130  testVector.push_back(kAcquireTestValueOptional1);
131  auto returnValue = std::make_optional<std::vector<TestValue>>(std::move(testVector));
132  lambdaOptionalTestPointers_[record.iovIndex()] = &returnValue.value()[0];
133  return returnValue;
134  },
135  [this](ESTestRecordI const& record, std::optional<std::vector<TestValue>> testValue) {
136  usleep(200000);
137  if (&testValue.value()[0] != lambdaOptionalTestPointers_[record.iovIndex()]) {
138  throw cms::Exception("TestFailure") << "AcquireIntESProducer::<lambda produceOptional>"
139  << " unexpected value passed in as argument";
140  }
141  return std::make_unique<ESTestDataI>(kAcquireTestValueOptional2);
142  },
143  edm::es::Label("optionalLambda"));
144  }
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 146 of file AcquireIntESProducer.cc.

References server_.

146  {
147  if (server_) {
148  server_->stop();
149  }
150  server_.reset();
151  }
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 166 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(), AlCaHarvesting_cff::record, edmtest::test_acquire::Cache::retrieved(), server_, and token_.

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

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

Referenced by AcquireIntESProducer().

249  {
250  usleep(200000);
251  std::vector<TestValue> testVector;
252  testVector.push_back(kAcquireTestValueOptional1);
253  auto returnValue = std::make_optional<std::vector<TestValue>>(std::move(testVector));
254  optionalTestPointers_[record.iovIndex()] = &returnValue.value()[0];
255  return returnValue;
256  }
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 230 of file AcquireIntESProducer.cc.

References AlCaHarvesting_cff::record, and uniqueTestPointers_.

Referenced by AcquireIntESProducer().

231  {
232  usleep(200000);
233  auto returnValue = std::make_unique<TestValue>(kAcquireTestValueUniquePtr1);
234  uniqueTestPointers_[record.iovIndex()] = returnValue.get();
235  return returnValue;
236  }
std::vector< TestValue * > uniqueTestPointers_

◆ fillDescriptions()

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

Definition at line 268 of file AcquireIntESProducer.cc.

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

268  {
270  desc.addUntracked<unsigned int>("numberOfIOVsToAccumulate", 8);
271  desc.addUntracked<unsigned int>("secondsToWaitForWork", 1);
272  descriptions.addDefault(desc);
273  }
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 153 of file AcquireIntESProducer.cc.

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

153  {
154  if (key == EventSetupRecordKey::makeKey<ESTestRecordI>()) {
155  caches_.resize(nConcurrentIOVs);
156  server_ = std::make_unique<test_acquire::WaitingServer>(
158  server_->start();
159  uniqueTestPointers_.resize(nConcurrentIOVs);
160  optionalTestPointers_.resize(nConcurrentIOVs);
161  lambdaUniqueTestPointers_.resize(nConcurrentIOVs);
162  lambdaOptionalTestPointers_.resize(nConcurrentIOVs);
163  }
164  }
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 201 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(), AlCaHarvesting_cff::record, token_, and findQualityFiles::v.

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

Referenced by AcquireIntESProducer().

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

◆ produceOptional()

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

Definition at line 258 of file AcquireIntESProducer.cc.

References Exception, optionalTestPointers_, and AlCaHarvesting_cff::record.

Referenced by AcquireIntESProducer().

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

◆ produceUniquePtr()

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

Definition at line 238 of file AcquireIntESProducer.cc.

References Exception, AlCaHarvesting_cff::record, and uniqueTestPointers_.

Referenced by AcquireIntESProducer().

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

Member Data Documentation

◆ caches_

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

Definition at line 81 of file AcquireIntESProducer.cc.

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

◆ lambdaOptionalTestPointers_

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

Definition at line 88 of file AcquireIntESProducer.cc.

Referenced by AcquireIntESProducer(), and initConcurrentIOVs().

◆ lambdaUniqueTestPointers_

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

Definition at line 87 of file AcquireIntESProducer.cc.

Referenced by AcquireIntESProducer(), and initConcurrentIOVs().

◆ numberOfIOVsToAccumulate_

const unsigned int edmtest::AcquireIntESProducer::numberOfIOVsToAccumulate_
private

Definition at line 83 of file AcquireIntESProducer.cc.

Referenced by initConcurrentIOVs().

◆ optionalTestPointers_

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

Definition at line 86 of file AcquireIntESProducer.cc.

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

◆ secondsToWaitForWork_

const unsigned int edmtest::AcquireIntESProducer::secondsToWaitForWork_
private

Definition at line 84 of file AcquireIntESProducer.cc.

Referenced by initConcurrentIOVs().

◆ server_

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

Definition at line 82 of file AcquireIntESProducer.cc.

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

◆ token_

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

Definition at line 80 of file AcquireIntESProducer.cc.

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

◆ uniqueTestPointers_

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

Definition at line 85 of file AcquireIntESProducer.cc.

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