1 #ifndef FWCore_Framework_WorkerManager_h 2 #define FWCore_Framework_WorkerManager_h 25 class ExceptionCollector;
29 class PreallocationConfiguration;
30 namespace eventsetup {
41 std::shared_ptr<ActivityRegistry> actReg,
46 std::shared_ptr<ProcessConfiguration> processConfiguration,
48 std::set<std::string>& unscheduledLabels,
49 std::vector<std::string>& shouldBeUsedLabels);
51 template <
typename T,
typename U>
52 void processOneOccurrence(
typename T::MyPrincipal&
principal,
55 typename T::Context
const* topContext,
57 bool cleaningUpAfterException =
false);
58 template <
typename T,
typename U>
64 typename T::Context
const* topContext,
69 typename T::MyPrincipal
const& ep,
74 typename T::Context
const* context);
85 AllWorkers
const&
allWorkers()
const {
return allWorkers_; }
87 void addToAllWorkers(
Worker*
w);
94 std::shared_ptr<ProcessConfiguration const> processConfiguration,
107 template <
typename T,
typename U>
111 typename T::Context
const* topContext,
113 bool cleaningUpAfterException) {
117 waitTask->increment_ref_count();
118 processOneOccurrenceAsync<T, U>(
120 waitTask->wait_for_all();
121 if (waitTask->exceptionPtr() !=
nullptr) {
127 "Calling function WorkerManager::processOneOccurrence", ex, cleaningUpAfterException);
136 template <
typename T,
typename U>
138 typename T::MyPrincipal& ep,
142 typename T::Context
const* topContext,
145 unscheduled_.runNowAsync<
T,
U>(
task, ep, es, token, streamID, topContext, context);
148 template <
typename T>
150 typename T::MyPrincipal
const& ep,
155 typename T::Context
const* context) {
156 unscheduled_.runAccumulatorsAsync<
T>(
task, ep, es, token, streamID, parentContext, context);
roAction_t actions[nactions]
void processOneOccurrence(typename T::MyPrincipal &principal, EventSetupImpl const &eventSetup, StreamID streamID, typename T::Context const *topContext, U const *context, bool cleaningUpAfterException=false)
UnscheduledCallProducer unscheduled_
void addContextAndPrintException(char const *context, cms::Exception &ex, bool disablePrint)
ServiceToken presentToken() const
ExceptionToActionTable const * actionTable_
void const * lastSetupEventPrincipal_
std::vector< Worker * > AllWorkers
std::unique_ptr< edm::EmptyWaitingTask, waitingtask::TaskDestroyer > make_empty_waiting_task()
Create an EmptyWaitingTask which will properly be destroyed.
std::list< std::string > const & context() const
static ServiceRegistry & instance()
void processOneOccurrenceAsync(WaitingTask *task, typename T::MyPrincipal &principal, EventSetupImpl const &eventSetup, ServiceToken const &token, StreamID streamID, typename T::Context const *topContext, U const *context)
AllWorkers const & allWorkers() const
void processAccumulatorsAsync(WaitingTask *task, typename T::MyPrincipal const &ep, EventSetupImpl const &es, ServiceToken const &token, StreamID streamID, ParentContext const &parentContext, typename T::Context const *context)
WorkerRegistry workerReg_
The Registry of all workers that where requested Holds all instances of workers. In this implementati...
auto wrap(F iFunc) -> decltype(iFunc())
ExceptionToActionTable const & actionTable() const