37 constexpr int kAcquireTestValueUniquePtr1 = 101;
38 constexpr int kAcquireTestValueUniquePtr2 = 102;
39 constexpr int kAcquireTestValueOptional1 = 201;
40 constexpr int kAcquireTestValueOptional2 = 202;
60 std::unique_ptr<ESTestDataI> produce(
ESTestRecordI const&,
int);
62 std::unique_ptr<ESTestDataB> produceESTestDataB(
ESTestRecordB const&);
72 std::unique_ptr<ESTestDataI> produceUniquePtr(
ESTestRecordI const&, std::unique_ptr<TestValue>);
83 std::unique_ptr<test_acquire::WaitingServer>
server_;
93 : numberOfIOVsToAccumulate_(
pset.getUntrackedParameter<unsigned
int>(
"numberOfIOVsToAccumulate")),
94 secondsToWaitForWork_(
pset.getUntrackedParameter<unsigned
int>(
"secondsToWaitForWork")) {
112 std::this_thread::sleep_for(200ms);
113 auto returnValue = std::make_unique<TestValue>(kAcquireTestValueUniquePtr1);
118 std::this_thread::sleep_for(200ms);
120 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::<lambda produceUniquePtr>" 121 <<
" unexpected value passed in as argument";
123 return std::make_unique<ESTestDataI>(kAcquireTestValueUniquePtr2);
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));
137 std::this_thread::sleep_for(200ms);
139 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::<lambda produceOptional>" 140 <<
" unexpected value passed in as argument";
142 return std::make_unique<ESTestDataI>(kAcquireTestValueOptional2);
155 if (
key == EventSetupRecordKey::makeKey<ESTestRecordI>()) {
157 server_ = std::make_unique<test_acquire::WaitingServer>(
168 std::this_thread::sleep_for(200ms);
183 std::vector<int>& retrieved = iovCache.
retrieved();
196 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::acquire" 197 <<
"read values do not agree with record";
199 return kAcquireTestValue;
203 std::this_thread::sleep_for(200ms);
205 if (valueReturnedByAcquire != kAcquireTestValue) {
206 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::produce" 207 <<
" unexpected value passed in as argument";
215 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::produce" 216 <<
"read values do not agree with record";
224 return std::make_unique<ESTestDataI>(sum);
228 return std::make_unique<ESTestDataB>(11);
233 std::this_thread::sleep_for(200ms);
234 auto returnValue = std::make_unique<TestValue>(kAcquireTestValueUniquePtr1);
240 std::unique_ptr<TestValue> testValue) {
241 std::this_thread::sleep_for(200ms);
243 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::produceUniquePtr" 244 <<
" unexpected value passed in as argument";
246 return std::make_unique<ESTestDataI>(kAcquireTestValueUniquePtr2);
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));
261 std::this_thread::sleep_for(200ms);
263 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::produceOptional" 264 <<
" unexpected value passed in as argument";
266 return std::make_unique<ESTestDataI>(kAcquireTestValueOptional2);
271 desc.addUntracked<
unsigned int>(
"numberOfIOVsToAccumulate", 8);
272 desc.addUntracked<
unsigned int>(
"secondsToWaitForWork", 1);
auto setWhatAcquiredProducedWithLambda(TAcquireFunc &&acquireFunc, TProduceFunc &&produceFunc, const es::Label &iLabel={})
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
const IOVSyncValue & last() const
LuminosityBlockNumber_t luminosityBlockNumber() const
Basic3DVector & operator=(const Basic3DVector &)=default
Assignment operator.
const IOVSyncValue & first() const
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)
int acquire(ESTestRecordI const &, edm::WaitingTaskWithArenaHolder)
auto setWhatAcquiredProduced(T *iThis, const es::Label &iLabel={})
std::unique_ptr< test_acquire::WaitingServer > server_
void addDefault(ParameterSetDescription const &psetDescription)
std::vector< TestValue * > optionalTestPointers_
edm::ESGetToken< IOVTestInfo, ESTestRecordI > token_
~AcquireIntESProducer() override
unsigned int iovStartLumi_
std::vector< test_acquire::Cache > caches_
key
prepare the HTCondor submission files and eventually submit them
std::unique_ptr< TestValue > acquireUniquePtr(ESTestRecordI const &, edm::WaitingTaskWithArenaHolder)
const unsigned int secondsToWaitForWork_
std::vector< TestValue * > lambdaOptionalTestPointers_
std::vector< TestValue * > uniqueTestPointers_
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
std::unique_ptr< ESTestDataI > produce(ESTestRecordI const &, int)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< TestValue * > lambdaUniqueTestPointers_
unsigned long long cacheIdentifier_
static void fillDescriptions(edm::ConfigurationDescriptions &)
AcquireIntESProducer(edm::ParameterSet const &)
unsigned int iovStartRun_
std::vector< int > const & processed() const
std::unique_ptr< ESTestDataB > produceESTestDataB(ESTestRecordB const &)
void initConcurrentIOVs(EventSetupRecordKey const &, unsigned int nConcurrentIOVs) override
std::unique_ptr< ESTestDataI > produceUniquePtr(ESTestRecordI const &, std::unique_ptr< TestValue >)
std::vector< int > const & retrieved() const