37 constexpr int kAcquireTestValueUniquePtr1 = 101;
38 constexpr int kAcquireTestValueUniquePtr2 = 102;
39 constexpr int kAcquireTestValueOptional1 = 201;
40 constexpr int kAcquireTestValueOptional2 = 202;
82 std::unique_ptr<test_acquire::WaitingServer>
server_;
92 : numberOfIOVsToAccumulate_(
pset.getUntrackedParameter<unsigned
int>(
"numberOfIOVsToAccumulate")),
93 secondsToWaitForWork_(
pset.getUntrackedParameter<unsigned
int>(
"secondsToWaitForWork")) {
112 auto returnValue = std::make_unique<TestValue>(kAcquireTestValueUniquePtr1);
119 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::<lambda produceUniquePtr>" 120 <<
" unexpected value passed in as argument";
122 return std::make_unique<ESTestDataI>(kAcquireTestValueUniquePtr2);
129 std::vector<TestValue> testVector;
130 testVector.push_back(kAcquireTestValueOptional1);
131 auto returnValue = std::make_optional<std::vector<TestValue>>(
std::move(testVector));
138 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::<lambda produceOptional>" 139 <<
" unexpected value passed in as argument";
141 return std::make_unique<ESTestDataI>(kAcquireTestValueOptional2);
154 if (
key == EventSetupRecordKey::makeKey<ESTestRecordI>()) {
155 caches_.resize(nConcurrentIOVs);
156 server_ = std::make_unique<test_acquire::WaitingServer>(
182 std::vector<int>& retrieved = iovCache.
retrieved();
195 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::acquire" 196 <<
"read values do not agree with record";
198 return kAcquireTestValue;
204 if (valueReturnedByAcquire != kAcquireTestValue) {
205 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::produce" 206 <<
" unexpected value passed in as argument";
214 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::produce" 215 <<
"read values do not agree with record";
223 return std::make_unique<ESTestDataI>(sum);
227 return std::make_unique<ESTestDataB>(11);
233 auto returnValue = std::make_unique<TestValue>(kAcquireTestValueUniquePtr1);
239 std::unique_ptr<TestValue> testValue) {
242 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::produceUniquePtr" 243 <<
" unexpected value passed in as argument";
245 return std::make_unique<ESTestDataI>(kAcquireTestValueUniquePtr2);
251 std::vector<TestValue> testVector;
252 testVector.push_back(kAcquireTestValueOptional1);
253 auto returnValue = std::make_optional<std::vector<TestValue>>(
std::move(testVector));
262 throw cms::Exception(
"TestFailure") <<
"AcquireIntESProducer::produceOptional" 263 <<
" unexpected value passed in as argument";
265 return std::make_unique<ESTestDataI>(kAcquireTestValueOptional2);
270 desc.addUntracked<
unsigned int>(
"numberOfIOVsToAccumulate", 8);
271 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
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
const unsigned int secondsToWaitForWork_
std::unique_ptr< TestValue > acquireUniquePtr(ESTestRecordI const &, edm::WaitingTaskWithArenaHolder)
std::vector< TestValue * > lambdaOptionalTestPointers_
std::vector< TestValue * > uniqueTestPointers_
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
std::unique_ptr< ESTestDataI > produce(ESTestRecordI const &, int)
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 &)
AcquireIntESProducer & operator=(const AcquireIntESProducer &)=delete
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