14 #include "DataFormats/TestObjects/interface/ToyProducts.h" 20 class ThrowingDelayedReader :
public DelayedReader {
22 ThrowingDelayedReader(
23 signalslot::Signal<
void(StreamContext
const&, ModuleCallingContext
const&)>
const* preEventReadSource,
24 signalslot::Signal<
void(StreamContext
const&, ModuleCallingContext
const&)>
const* postEventReadSource)
25 : preEventReadFromSourceSignal_(preEventReadSource),
26 postEventReadFromSourceSignal_(postEventReadSource),
29 signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)>
const* preEventReadFromSourceSignal()
31 return preEventReadFromSourceSignal_;
33 signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)>
const* postEventReadFromSourceSignal()
35 return postEventReadFromSourceSignal_;
41 std::rethrow_exception(e_);
44 auto copyException = iE;
45 copyException.
addContext(
"called ThrowingDelayedReader");
49 void mergeReaders_(DelayedReader*)
final {}
50 void reset_() final {}
52 signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)>
const* preEventReadFromSourceSignal_ =
54 signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)>
const* postEventReadFromSourceSignal_ =
56 std::exception_ptr e_;
76 std::unique_ptr<SharedResourcesAcquirer>
83 delayedReader_(&preEventReadFromSourceSignal_, &postEventReadFromSourceSignal_) {
92 std::vector<BranchDescription>
branches;
93 for (
auto const&
label :
pset.getUntrackedParameter<std::vector<std::string>>(
"labels")) {
98 twd.friendlyClassName(),
116 bilists[0].emplace_back(
branch.branchID().id());
133 desc.setComment(
"Throws an exception when the DelayedReader is used.");
135 desc.addUntracked<std::vector<std::string>>(
"labels", {{
"test"}});
136 descriptions.
add(
"source",
desc);
T const * getProduct_(RefCore const &ref, const EDProductGetter *prodGetter)
std::vector< BranchIDList > BranchIDLists
ThrowingDelayedReader delayedReader_
std::unique_ptr< SharedResourcesAcquirer > resourceSharedWithDelayedReaderPtr_
bool registerProcessHistory(ProcessHistory const &processHistory)
std::vector< EventSelectionID > EventSelectionIDVector
DelayedReaderThrowingSource(ParameterSet const &, InputSourceDescription const &)
std::vector< BranchListIndex > BranchListIndexes
static SharedResourcesRegistry * instance()
void doReadEventWithDelayedReader(EventPrincipal &eventPrincipal, ProcessHistoryID const &historyID, EventSelectionIDVector eventSelectionIDs, BranchListIndexes branchListIndexes, DelayedReader *reader)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
unsigned long long TimeValue_t
bool setRunAndEventInfo(EventID &id, TimeValue_t &time, edm::EventAuxiliary::ExperimentType &) override
static TypeWithDict byTypeInfo(std::type_info const &ti)
Namespace of DDCMS conversion namespace.
static void fillDescription(ParameterSetDescription &desc)
std::shared_ptr< std::recursive_mutex > mutexSharedWithDelayedReader_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void addContext(std::string const &context)
ProcessHistoryID historyID_
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader_() override
void updateFromInput(ProductList const &other)
std::pair< SharedResourcesAcquirer, std::shared_ptr< std::recursive_mutex > > createAcquirerForSourceDelayedReader()
void readEvent_(edm::EventPrincipal &) override