File indexing completed on 2025-06-20 01:53:19
0001 #include "FWCore/Framework/interface/maker/WorkerT.h"
0002 #include "FWCore/Framework/interface/EventPrincipal.h"
0003
0004 #include "FWCore/Framework/interface/one/EDProducerBase.h"
0005 #include "FWCore/Framework/interface/one/EDFilterBase.h"
0006 #include "FWCore/Framework/interface/one/EDAnalyzerBase.h"
0007 #include "FWCore/Framework/interface/one/OutputModuleBase.h"
0008 #include "FWCore/Framework/interface/global/EDProducerBase.h"
0009 #include "FWCore/Framework/interface/global/EDFilterBase.h"
0010 #include "FWCore/Framework/interface/global/EDAnalyzerBase.h"
0011 #include "FWCore/Framework/interface/global/OutputModuleBase.h"
0012
0013 #include "FWCore/Framework/interface/stream/EDProducerAdaptorBase.h"
0014 #include "FWCore/Framework/interface/stream/EDFilterAdaptorBase.h"
0015 #include "FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h"
0016
0017 #include "FWCore/Framework/interface/limited/EDProducerBase.h"
0018 #include "FWCore/Framework/interface/limited/EDFilterBase.h"
0019 #include "FWCore/Framework/interface/limited/EDAnalyzerBase.h"
0020 #include "FWCore/Framework/interface/limited/OutputModuleBase.h"
0021
0022 #include "FWCore/ServiceRegistry/interface/ModuleConsumesInfo.h"
0023
0024 #include <type_traits>
0025
0026 namespace edm {
0027 namespace workerimpl {
0028 template <typename T>
0029 struct has_stream_functions {
0030 static bool constexpr value = false;
0031 };
0032
0033 template <>
0034 struct has_stream_functions<edm::global::EDProducerBase> {
0035 static bool constexpr value = true;
0036 };
0037
0038 template <>
0039 struct has_stream_functions<edm::global::EDFilterBase> {
0040 static bool constexpr value = true;
0041 };
0042
0043 template <>
0044 struct has_stream_functions<edm::global::EDAnalyzerBase> {
0045 static bool constexpr value = true;
0046 };
0047
0048 template <>
0049 struct has_stream_functions<edm::limited::EDProducerBase> {
0050 static bool constexpr value = true;
0051 };
0052
0053 template <>
0054 struct has_stream_functions<edm::limited::EDFilterBase> {
0055 static bool constexpr value = true;
0056 };
0057
0058 template <>
0059 struct has_stream_functions<edm::limited::EDAnalyzerBase> {
0060 static bool constexpr value = true;
0061 };
0062
0063 template <>
0064 struct has_stream_functions<edm::stream::EDProducerAdaptorBase> {
0065 static bool constexpr value = true;
0066 };
0067
0068 template <>
0069 struct has_stream_functions<edm::stream::EDFilterAdaptorBase> {
0070 static bool constexpr value = true;
0071 };
0072
0073 template <>
0074 struct has_stream_functions<edm::stream::EDAnalyzerAdaptorBase> {
0075 static bool constexpr value = true;
0076 };
0077
0078 template <typename T>
0079 struct has_only_stream_transition_functions {
0080 static bool constexpr value = false;
0081 };
0082
0083 template <>
0084 struct has_only_stream_transition_functions<edm::global::OutputModuleBase> {
0085 static bool constexpr value = true;
0086 };
0087
0088 struct DoNothing {
0089 template <typename... T>
0090 inline void operator()(const T&...) {}
0091 };
0092
0093 template <typename T>
0094 struct DoBeginStream {
0095 inline void operator()(WorkerT<T>* iWorker, StreamID id) { iWorker->callWorkerBeginStream(0, id); }
0096 };
0097
0098 template <typename T>
0099 struct DoEndStream {
0100 inline void operator()(WorkerT<T>* iWorker, StreamID id) { iWorker->callWorkerEndStream(0, id); }
0101 };
0102
0103 template <typename T, typename INFOTYPE>
0104 struct DoStreamBeginTrans {
0105 inline void operator()(WorkerT<T>* iWorker, StreamID id, INFOTYPE const& info, ModuleCallingContext const* mcc) {
0106 iWorker->callWorkerStreamBegin(0, id, info, mcc);
0107 }
0108 };
0109
0110 template <typename T, typename INFOTYPE>
0111 struct DoStreamEndTrans {
0112 inline void operator()(WorkerT<T>* iWorker, StreamID id, INFOTYPE const& info, ModuleCallingContext const* mcc) {
0113 iWorker->callWorkerStreamEnd(0, id, info, mcc);
0114 }
0115 };
0116 }
0117
0118 template <typename T>
0119 inline WorkerT<T>::WorkerT(std::shared_ptr<T> ed, ModuleDescription const& md, ExceptionToActionTable const* actions)
0120 : Worker(md, actions), module_(ed) {
0121 assert(module_ != nullptr);
0122 }
0123
0124 template <typename T>
0125 WorkerT<T>::~WorkerT() {}
0126
0127 template <typename T>
0128 bool WorkerT<T>::wantsProcessBlocks() const noexcept {
0129 return module_->wantsProcessBlocks();
0130 }
0131
0132 template <typename T>
0133 bool WorkerT<T>::wantsInputProcessBlocks() const noexcept {
0134 return module_->wantsInputProcessBlocks();
0135 }
0136
0137 template <typename T>
0138 bool WorkerT<T>::wantsGlobalRuns() const noexcept {
0139 return module_->wantsGlobalRuns();
0140 }
0141
0142 template <typename T>
0143 bool WorkerT<T>::wantsGlobalLuminosityBlocks() const noexcept {
0144 return module_->wantsGlobalLuminosityBlocks();
0145 }
0146
0147 template <typename T>
0148 bool WorkerT<T>::wantsStreamRuns() const noexcept {
0149 return module_->wantsStreamRuns();
0150 }
0151
0152 template <typename T>
0153 bool WorkerT<T>::wantsStreamLuminosityBlocks() const noexcept {
0154 return module_->wantsStreamLuminosityBlocks();
0155 }
0156
0157 template <typename T>
0158 SerialTaskQueue* WorkerT<T>::globalRunsQueue() {
0159 return nullptr;
0160 }
0161 template <typename T>
0162 SerialTaskQueue* WorkerT<T>::globalLuminosityBlocksQueue() {
0163 return nullptr;
0164 }
0165
0166
0167 template <>
0168 SerialTaskQueue* WorkerT<one::EDProducerBase>::globalRunsQueue() {
0169 return module_->globalRunsQueue();
0170 }
0171 template <>
0172 SerialTaskQueue* WorkerT<one::EDProducerBase>::globalLuminosityBlocksQueue() {
0173 return module_->globalLuminosityBlocksQueue();
0174 }
0175 template <>
0176 SerialTaskQueue* WorkerT<one::EDFilterBase>::globalRunsQueue() {
0177 return module_->globalRunsQueue();
0178 }
0179 template <>
0180 SerialTaskQueue* WorkerT<one::EDFilterBase>::globalLuminosityBlocksQueue() {
0181 return module_->globalLuminosityBlocksQueue();
0182 }
0183 template <>
0184 SerialTaskQueue* WorkerT<one::EDAnalyzerBase>::globalRunsQueue() {
0185 return module_->globalRunsQueue();
0186 }
0187 template <>
0188 SerialTaskQueue* WorkerT<one::EDAnalyzerBase>::globalLuminosityBlocksQueue() {
0189 return module_->globalLuminosityBlocksQueue();
0190 }
0191 template <>
0192 SerialTaskQueue* WorkerT<one::OutputModuleBase>::globalRunsQueue() {
0193 return module_->globalRunsQueue();
0194 }
0195 template <>
0196 SerialTaskQueue* WorkerT<one::OutputModuleBase>::globalLuminosityBlocksQueue() {
0197 return module_->globalLuminosityBlocksQueue();
0198 }
0199
0200 template <typename T>
0201 inline bool WorkerT<T>::implDo(EventTransitionInfo const& info, ModuleCallingContext const* mcc) {
0202 EventPrincipal const& ep = info.principal();
0203 std::shared_ptr<Worker> sentry(this, [&ep](Worker* obj) { obj->postDoEvent(ep); });
0204 return module_->doEvent(info, activityRegistry(), mcc);
0205 }
0206
0207 template <typename T>
0208 inline void WorkerT<T>::implDoAcquire(EventTransitionInfo const&, ModuleCallingContext const*, WaitingTaskHolder&&) {}
0209
0210 template <>
0211 inline void WorkerT<global::EDProducerBase>::implDoAcquire(EventTransitionInfo const& info,
0212 ModuleCallingContext const* mcc,
0213 WaitingTaskHolder&& holder) {
0214 module_->doAcquire(info, activityRegistry(), mcc, std::move(holder));
0215 }
0216
0217 template <>
0218 inline void WorkerT<global::EDFilterBase>::implDoAcquire(EventTransitionInfo const& info,
0219 ModuleCallingContext const* mcc,
0220 WaitingTaskHolder&& holder) {
0221 module_->doAcquire(info, activityRegistry(), mcc, std::move(holder));
0222 }
0223
0224 template <>
0225 inline void WorkerT<global::OutputModuleBase>::implDoAcquire(EventTransitionInfo const& info,
0226 ModuleCallingContext const* mcc,
0227 WaitingTaskHolder&& holder) {
0228 module_->doAcquire(info, activityRegistry(), mcc, std::move(holder));
0229 }
0230
0231 template <>
0232 inline void WorkerT<stream::EDProducerAdaptorBase>::implDoAcquire(EventTransitionInfo const& info,
0233 ModuleCallingContext const* mcc,
0234 WaitingTaskHolder&& holder) {
0235 module_->doAcquire(info, activityRegistry(), mcc, std::move(holder));
0236 }
0237
0238 template <>
0239 inline void WorkerT<stream::EDFilterAdaptorBase>::implDoAcquire(EventTransitionInfo const& info,
0240 ModuleCallingContext const* mcc,
0241 WaitingTaskHolder&& holder) {
0242 module_->doAcquire(info, activityRegistry(), mcc, std::move(holder));
0243 }
0244
0245 template <typename T>
0246 inline void WorkerT<T>::implDoTransformAsync(WaitingTaskHolder iTask,
0247 size_t iTransformIndex,
0248 EventPrincipal const& iEvent,
0249 ParentContext const& iParent,
0250 ServiceWeakToken const& weakToken) noexcept {
0251 CMS_SA_ALLOW try {
0252 ServiceRegistry::Operate guard(weakToken.lock());
0253
0254 ModuleCallingContext mcc(
0255 &module_->moduleDescription(), iTransformIndex + 1, ModuleCallingContext::State::kRunning, iParent, nullptr);
0256 module_->doTransformAsync(iTask, iTransformIndex, iEvent, activityRegistry(), mcc, weakToken);
0257 } catch (...) {
0258 iTask.doneWaiting(std::current_exception());
0259 return;
0260 }
0261 iTask.doneWaiting(std::exception_ptr());
0262 }
0263
0264 template <>
0265 inline void WorkerT<global::EDAnalyzerBase>::implDoTransformAsync(WaitingTaskHolder task,
0266 size_t iTransformIndex,
0267 EventPrincipal const& iEvent,
0268 ParentContext const& iParent,
0269 ServiceWeakToken const& weakToken) noexcept {}
0270 template <>
0271 inline void WorkerT<global::OutputModuleBase>::implDoTransformAsync(WaitingTaskHolder task,
0272 size_t iTransformIndex,
0273 EventPrincipal const& iEvent,
0274 ParentContext const& iParent,
0275 ServiceWeakToken const& weakToken) noexcept {}
0276 template <>
0277 inline void WorkerT<limited::EDAnalyzerBase>::implDoTransformAsync(WaitingTaskHolder task,
0278 size_t iTransformIndex,
0279 EventPrincipal const& iEvent,
0280 ParentContext const& iParent,
0281 ServiceWeakToken const& weakToken) noexcept {}
0282 template <>
0283 inline void WorkerT<limited::OutputModuleBase>::implDoTransformAsync(WaitingTaskHolder task,
0284 size_t iTransformIndex,
0285 EventPrincipal const& iEvent,
0286 ParentContext const& iParent,
0287 ServiceWeakToken const& weakToken) noexcept {}
0288 template <>
0289 inline void WorkerT<one::EDAnalyzerBase>::implDoTransformAsync(WaitingTaskHolder task,
0290 size_t iTransformIndex,
0291 EventPrincipal const& iEvent,
0292 ParentContext const& iParent,
0293 ServiceWeakToken const& weakToken) noexcept {}
0294 template <>
0295 inline void WorkerT<one::OutputModuleBase>::implDoTransformAsync(WaitingTaskHolder task,
0296 size_t iTransformIndex,
0297 EventPrincipal const& iEvent,
0298 ParentContext const& iParent,
0299 ServiceWeakToken const& weakToken) noexcept {}
0300 template <>
0301 inline void WorkerT<stream::EDAnalyzerAdaptorBase>::implDoTransformAsync(WaitingTaskHolder task,
0302 size_t iTransformIndex,
0303 EventPrincipal const& iEvent,
0304 ParentContext const& iParent,
0305 ServiceWeakToken const& weakToken) noexcept {
0306 }
0307
0308 template <typename T>
0309 inline size_t WorkerT<T>::transformIndex(edm::ProductDescription const&) const noexcept {
0310 return -1;
0311 }
0312 template <>
0313 inline size_t WorkerT<global::EDFilterBase>::transformIndex(edm::ProductDescription const& iBranch) const noexcept {
0314 return module_->transformIndex_(iBranch);
0315 }
0316 template <>
0317 inline size_t WorkerT<global::EDProducerBase>::transformIndex(edm::ProductDescription const& iBranch) const noexcept {
0318 return module_->transformIndex_(iBranch);
0319 }
0320 template <>
0321 inline size_t WorkerT<stream::EDProducerAdaptorBase>::transformIndex(
0322 edm::ProductDescription const& iBranch) const noexcept {
0323 return module_->transformIndex_(iBranch);
0324 }
0325 template <>
0326 inline size_t WorkerT<limited::EDFilterBase>::transformIndex(edm::ProductDescription const& iBranch) const noexcept {
0327 return module_->transformIndex_(iBranch);
0328 }
0329 template <>
0330 inline size_t WorkerT<limited::EDProducerBase>::transformIndex(edm::ProductDescription const& iBranch) const noexcept {
0331 return module_->transformIndex_(iBranch);
0332 }
0333 template <>
0334 inline size_t WorkerT<one::EDFilterBase>::transformIndex(edm::ProductDescription const& iBranch) const noexcept {
0335 return module_->transformIndex_(iBranch);
0336 }
0337 template <>
0338 inline size_t WorkerT<one::EDProducerBase>::transformIndex(edm::ProductDescription const& iBranch) const noexcept {
0339 return module_->transformIndex_(iBranch);
0340 }
0341
0342 template <typename T>
0343 inline ProductResolverIndex WorkerT<T>::itemToGetForTransform(size_t iTransformIndex) const noexcept {
0344 return -1;
0345 }
0346 template <>
0347 inline ProductResolverIndex WorkerT<global::EDFilterBase>::itemToGetForTransform(
0348 size_t iTransformIndex) const noexcept {
0349 return module_->transformPrefetch_(iTransformIndex);
0350 }
0351 template <>
0352 inline ProductResolverIndex WorkerT<global::EDProducerBase>::itemToGetForTransform(
0353 size_t iTransformIndex) const noexcept {
0354 return module_->transformPrefetch_(iTransformIndex);
0355 }
0356 template <>
0357 inline ProductResolverIndex WorkerT<stream::EDProducerAdaptorBase>::itemToGetForTransform(
0358 size_t iTransformIndex) const noexcept {
0359 return module_->transformPrefetch_(iTransformIndex);
0360 }
0361 template <>
0362 inline ProductResolverIndex WorkerT<limited::EDFilterBase>::itemToGetForTransform(
0363 size_t iTransformIndex) const noexcept {
0364 return module_->transformPrefetch_(iTransformIndex);
0365 }
0366 template <>
0367 inline ProductResolverIndex WorkerT<limited::EDProducerBase>::itemToGetForTransform(
0368 size_t iTransformIndex) const noexcept {
0369 return module_->transformPrefetch_(iTransformIndex);
0370 }
0371 template <>
0372 inline ProductResolverIndex WorkerT<one::EDFilterBase>::itemToGetForTransform(size_t iTransformIndex) const noexcept {
0373 return module_->transformPrefetch_(iTransformIndex);
0374 }
0375 template <>
0376 inline ProductResolverIndex WorkerT<one::EDProducerBase>::itemToGetForTransform(
0377 size_t iTransformIndex) const noexcept {
0378 return module_->transformPrefetch_(iTransformIndex);
0379 }
0380
0381 template <typename T>
0382 inline bool WorkerT<T>::implNeedToRunSelection() const noexcept {
0383 return false;
0384 }
0385
0386 template <typename T>
0387 inline bool WorkerT<T>::implDoPrePrefetchSelection(StreamID id,
0388 EventPrincipal const& ep,
0389 ModuleCallingContext const* mcc) {
0390 return true;
0391 }
0392 template <typename T>
0393 inline void WorkerT<T>::itemsToGetForSelection(std::vector<ProductResolverIndexAndSkipBit>&) const {}
0394
0395 template <>
0396 inline bool WorkerT<edm::one::OutputModuleBase>::implNeedToRunSelection() const noexcept {
0397 return true;
0398 }
0399
0400 template <>
0401 inline bool WorkerT<edm::one::OutputModuleBase>::implDoPrePrefetchSelection(StreamID id,
0402 EventPrincipal const& ep,
0403 ModuleCallingContext const* mcc) {
0404 return module_->prePrefetchSelection(id, ep, mcc);
0405 }
0406 template <>
0407 inline void WorkerT<edm::one::OutputModuleBase>::itemsToGetForSelection(
0408 std::vector<ProductResolverIndexAndSkipBit>& iItems) const {
0409 iItems = module_->productsUsedBySelection();
0410 }
0411
0412 template <>
0413 inline bool WorkerT<edm::global::OutputModuleBase>::implNeedToRunSelection() const noexcept {
0414 return true;
0415 }
0416 template <>
0417 inline bool WorkerT<edm::global::OutputModuleBase>::implDoPrePrefetchSelection(StreamID id,
0418 EventPrincipal const& ep,
0419 ModuleCallingContext const* mcc) {
0420 return module_->prePrefetchSelection(id, ep, mcc);
0421 }
0422 template <>
0423 inline void WorkerT<edm::global::OutputModuleBase>::itemsToGetForSelection(
0424 std::vector<ProductResolverIndexAndSkipBit>& iItems) const {
0425 iItems = module_->productsUsedBySelection();
0426 }
0427
0428 template <>
0429 inline bool WorkerT<edm::limited::OutputModuleBase>::implNeedToRunSelection() const noexcept {
0430 return true;
0431 }
0432 template <>
0433 inline bool WorkerT<edm::limited::OutputModuleBase>::implDoPrePrefetchSelection(StreamID id,
0434 EventPrincipal const& ep,
0435 ModuleCallingContext const* mcc) {
0436 return module_->prePrefetchSelection(id, ep, mcc);
0437 }
0438 template <>
0439 inline void WorkerT<edm::limited::OutputModuleBase>::itemsToGetForSelection(
0440 std::vector<ProductResolverIndexAndSkipBit>& iItems) const {
0441 iItems = module_->productsUsedBySelection();
0442 }
0443
0444 template <typename T>
0445 bool WorkerT<T>::implDoBeginProcessBlock(ProcessBlockPrincipal const& pbp, ModuleCallingContext const* mcc) {
0446 module_->doBeginProcessBlock(pbp, mcc);
0447 return true;
0448 }
0449
0450 template <typename T>
0451 bool WorkerT<T>::implDoAccessInputProcessBlock(ProcessBlockPrincipal const& pbp, ModuleCallingContext const* mcc) {
0452 module_->doAccessInputProcessBlock(pbp, mcc);
0453 return true;
0454 }
0455
0456 template <typename T>
0457 bool WorkerT<T>::implDoEndProcessBlock(ProcessBlockPrincipal const& pbp, ModuleCallingContext const* mcc) {
0458 module_->doEndProcessBlock(pbp, mcc);
0459 return true;
0460 }
0461
0462 template <typename T>
0463 inline bool WorkerT<T>::implDoBegin(RunTransitionInfo const& info, ModuleCallingContext const* mcc) {
0464 module_->doBeginRun(info, mcc);
0465 return true;
0466 }
0467
0468 template <typename T>
0469 template <typename D>
0470 void WorkerT<T>::callWorkerStreamBegin(D,
0471 StreamID id,
0472 RunTransitionInfo const& info,
0473 ModuleCallingContext const* mcc) {
0474 module_->doStreamBeginRun(id, info, mcc);
0475 }
0476
0477 template <typename T>
0478 template <typename D>
0479 void WorkerT<T>::callWorkerStreamEnd(D, StreamID id, RunTransitionInfo const& info, ModuleCallingContext const* mcc) {
0480 module_->doStreamEndRun(id, info, mcc);
0481 }
0482
0483 template <typename T>
0484 inline bool WorkerT<T>::implDoStreamBegin(StreamID id,
0485 RunTransitionInfo const& info,
0486 ModuleCallingContext const* mcc) {
0487 std::conditional_t<workerimpl::has_stream_functions<T>::value,
0488 workerimpl::DoStreamBeginTrans<T, RunTransitionInfo const>,
0489 workerimpl::DoNothing>
0490 might_call;
0491 might_call(this, id, info, mcc);
0492 return true;
0493 }
0494
0495 template <typename T>
0496 inline bool WorkerT<T>::implDoStreamEnd(StreamID id, RunTransitionInfo const& info, ModuleCallingContext const* mcc) {
0497 std::conditional_t<workerimpl::has_stream_functions<T>::value,
0498 workerimpl::DoStreamEndTrans<T, RunTransitionInfo const>,
0499 workerimpl::DoNothing>
0500 might_call;
0501 might_call(this, id, info, mcc);
0502 return true;
0503 }
0504
0505 template <typename T>
0506 inline bool WorkerT<T>::implDoEnd(RunTransitionInfo const& info, ModuleCallingContext const* mcc) {
0507 module_->doEndRun(info, mcc);
0508 return true;
0509 }
0510
0511 template <typename T>
0512 inline bool WorkerT<T>::implDoBegin(LumiTransitionInfo const& info, ModuleCallingContext const* mcc) {
0513 module_->doBeginLuminosityBlock(info, mcc);
0514 return true;
0515 }
0516
0517 template <typename T>
0518 template <typename D>
0519 void WorkerT<T>::callWorkerStreamBegin(D,
0520 StreamID id,
0521 LumiTransitionInfo const& info,
0522 ModuleCallingContext const* mcc) {
0523 module_->doStreamBeginLuminosityBlock(id, info, mcc);
0524 }
0525
0526 template <typename T>
0527 template <typename D>
0528 void WorkerT<T>::callWorkerStreamEnd(D, StreamID id, LumiTransitionInfo const& info, ModuleCallingContext const* mcc) {
0529 module_->doStreamEndLuminosityBlock(id, info, mcc);
0530 }
0531
0532 template <typename T>
0533 inline bool WorkerT<T>::implDoStreamBegin(StreamID id,
0534 LumiTransitionInfo const& info,
0535 ModuleCallingContext const* mcc) {
0536 std::conditional_t<workerimpl::has_stream_functions<T>::value,
0537 workerimpl::DoStreamBeginTrans<T, LumiTransitionInfo>,
0538 workerimpl::DoNothing>
0539 might_call;
0540 might_call(this, id, info, mcc);
0541 return true;
0542 }
0543
0544 template <typename T>
0545 inline bool WorkerT<T>::implDoStreamEnd(StreamID id,
0546 LumiTransitionInfo const& info,
0547 ModuleCallingContext const* mcc) {
0548 std::conditional_t<workerimpl::has_stream_functions<T>::value,
0549 workerimpl::DoStreamEndTrans<T, LumiTransitionInfo>,
0550 workerimpl::DoNothing>
0551 might_call;
0552 might_call(this, id, info, mcc);
0553
0554 return true;
0555 }
0556
0557 template <typename T>
0558 inline bool WorkerT<T>::implDoEnd(LumiTransitionInfo const& info, ModuleCallingContext const* mcc) {
0559 module_->doEndLuminosityBlock(info, mcc);
0560 return true;
0561 }
0562
0563 template <typename T>
0564 inline std::string WorkerT<T>::workerType() const {
0565 return module_->workerType();
0566 }
0567
0568 template <typename T>
0569 inline void WorkerT<T>::implBeginJob() {
0570 module_->doBeginJob();
0571 }
0572
0573 template <typename T>
0574 inline void WorkerT<T>::implEndJob() {
0575 module_->doEndJob();
0576 }
0577
0578 template <typename T>
0579 template <typename D>
0580 void WorkerT<T>::callWorkerBeginStream(D, StreamID id) {
0581 module_->doBeginStream(id);
0582 }
0583
0584 template <typename T>
0585 inline void WorkerT<T>::implBeginStream(StreamID id) {
0586 std::conditional_t<workerimpl::has_stream_functions<T>::value or
0587 workerimpl::has_only_stream_transition_functions<T>::value,
0588 workerimpl::DoBeginStream<T>,
0589 workerimpl::DoNothing>
0590 might_call;
0591 might_call(this, id);
0592 }
0593
0594 template <typename T>
0595 template <typename D>
0596 void WorkerT<T>::callWorkerEndStream(D, StreamID id) {
0597 module_->doEndStream(id);
0598 }
0599
0600 template <typename T>
0601 inline void WorkerT<T>::implEndStream(StreamID id) {
0602 std::conditional_t<workerimpl::has_stream_functions<T>::value or
0603 workerimpl::has_only_stream_transition_functions<T>::value,
0604 workerimpl::DoEndStream<T>,
0605 workerimpl::DoNothing>
0606 might_call;
0607 might_call(this, id);
0608 }
0609
0610 template <typename T>
0611 inline void WorkerT<T>::implRespondToOpenInputFile(FileBlock const& fb) {
0612 module_->doRespondToOpenInputFile(fb);
0613 }
0614
0615 template <typename T>
0616 inline void WorkerT<T>::implRespondToCloseInputFile(FileBlock const& fb) {
0617 module_->doRespondToCloseInputFile(fb);
0618 }
0619
0620 template <typename T>
0621 void WorkerT<T>::implRespondToCloseOutputFile() {
0622 module_->doRespondToCloseOutputFile();
0623 }
0624
0625 template <typename T>
0626 inline Worker::TaskQueueAdaptor WorkerT<T>::serializeRunModule() {
0627 return Worker::TaskQueueAdaptor{};
0628 }
0629 template <>
0630 Worker::TaskQueueAdaptor WorkerT<one::EDAnalyzerBase>::serializeRunModule() {
0631 return &(module_->sharedResourcesAcquirer().serialQueueChain());
0632 }
0633 template <>
0634 Worker::TaskQueueAdaptor WorkerT<one::EDFilterBase>::serializeRunModule() {
0635 return &(module_->sharedResourcesAcquirer().serialQueueChain());
0636 }
0637 template <>
0638 Worker::TaskQueueAdaptor WorkerT<one::EDProducerBase>::serializeRunModule() {
0639 return &(module_->sharedResourcesAcquirer().serialQueueChain());
0640 }
0641 template <>
0642 Worker::TaskQueueAdaptor WorkerT<one::OutputModuleBase>::serializeRunModule() {
0643 return &(module_->sharedResourcesAcquirer().serialQueueChain());
0644 }
0645 template <>
0646 Worker::TaskQueueAdaptor WorkerT<limited::EDAnalyzerBase>::serializeRunModule() {
0647 return &(module_->queue());
0648 }
0649 template <>
0650 Worker::TaskQueueAdaptor WorkerT<limited::EDFilterBase>::serializeRunModule() {
0651 return &(module_->queue());
0652 }
0653 template <>
0654 Worker::TaskQueueAdaptor WorkerT<limited::EDProducerBase>::serializeRunModule() {
0655 return &(module_->queue());
0656 }
0657 template <>
0658 Worker::TaskQueueAdaptor WorkerT<limited::OutputModuleBase>::serializeRunModule() {
0659 return &(module_->queue());
0660 }
0661
0662 template <>
0663 Worker::Types WorkerT<edm::one::EDProducerBase>::moduleType() const {
0664 return Worker::kProducer;
0665 }
0666 template <>
0667 Worker::Types WorkerT<edm::one::EDFilterBase>::moduleType() const {
0668 return Worker::kFilter;
0669 }
0670 template <>
0671 Worker::Types WorkerT<edm::one::EDAnalyzerBase>::moduleType() const {
0672 return Worker::kAnalyzer;
0673 }
0674 template <>
0675 Worker::Types WorkerT<edm::one::OutputModuleBase>::moduleType() const {
0676 return Worker::kOutputModule;
0677 }
0678
0679 template <>
0680 Worker::Types WorkerT<edm::global::EDProducerBase>::moduleType() const {
0681 return Worker::kProducer;
0682 }
0683 template <>
0684 Worker::Types WorkerT<edm::global::EDFilterBase>::moduleType() const {
0685 return Worker::kFilter;
0686 }
0687 template <>
0688 Worker::Types WorkerT<edm::global::EDAnalyzerBase>::moduleType() const {
0689 return Worker::kAnalyzer;
0690 }
0691 template <>
0692 Worker::Types WorkerT<edm::global::OutputModuleBase>::moduleType() const {
0693 return Worker::kOutputModule;
0694 }
0695
0696 template <>
0697 Worker::Types WorkerT<edm::limited::EDProducerBase>::moduleType() const {
0698 return Worker::kProducer;
0699 }
0700 template <>
0701 Worker::Types WorkerT<edm::limited::EDFilterBase>::moduleType() const {
0702 return Worker::kFilter;
0703 }
0704 template <>
0705 Worker::Types WorkerT<edm::limited::EDAnalyzerBase>::moduleType() const {
0706 return Worker::kAnalyzer;
0707 }
0708 template <>
0709 Worker::Types WorkerT<edm::limited::OutputModuleBase>::moduleType() const {
0710 return Worker::kOutputModule;
0711 }
0712
0713 template <>
0714 Worker::Types WorkerT<edm::stream::EDProducerAdaptorBase>::moduleType() const {
0715 return Worker::kProducer;
0716 }
0717 template <>
0718 Worker::Types WorkerT<edm::stream::EDFilterAdaptorBase>::moduleType() const {
0719 return Worker::kFilter;
0720 }
0721 template <>
0722 Worker::Types WorkerT<edm::stream::EDAnalyzerAdaptorBase>::moduleType() const {
0723 return Worker::kAnalyzer;
0724 }
0725
0726 template <>
0727 Worker::ConcurrencyTypes WorkerT<edm::one::EDProducerBase>::moduleConcurrencyType() const {
0728 return Worker::kOne;
0729 }
0730 template <>
0731 Worker::ConcurrencyTypes WorkerT<edm::one::EDFilterBase>::moduleConcurrencyType() const {
0732 return Worker::kOne;
0733 }
0734 template <>
0735 Worker::ConcurrencyTypes WorkerT<edm::one::EDAnalyzerBase>::moduleConcurrencyType() const {
0736 return Worker::kOne;
0737 }
0738 template <>
0739 Worker::ConcurrencyTypes WorkerT<edm::one::OutputModuleBase>::moduleConcurrencyType() const {
0740 return Worker::kOne;
0741 }
0742
0743 template <>
0744 Worker::ConcurrencyTypes WorkerT<edm::global::EDProducerBase>::moduleConcurrencyType() const {
0745 return Worker::kGlobal;
0746 }
0747 template <>
0748 Worker::ConcurrencyTypes WorkerT<edm::global::EDFilterBase>::moduleConcurrencyType() const {
0749 return Worker::kGlobal;
0750 }
0751 template <>
0752 Worker::ConcurrencyTypes WorkerT<edm::global::EDAnalyzerBase>::moduleConcurrencyType() const {
0753 return Worker::kGlobal;
0754 }
0755 template <>
0756 Worker::ConcurrencyTypes WorkerT<edm::global::OutputModuleBase>::moduleConcurrencyType() const {
0757 return Worker::kGlobal;
0758 }
0759
0760 template <>
0761 Worker::ConcurrencyTypes WorkerT<edm::limited::EDProducerBase>::moduleConcurrencyType() const {
0762 return Worker::kLimited;
0763 }
0764 template <>
0765 Worker::ConcurrencyTypes WorkerT<edm::limited::EDFilterBase>::moduleConcurrencyType() const {
0766 return Worker::kLimited;
0767 }
0768 template <>
0769 Worker::ConcurrencyTypes WorkerT<edm::limited::EDAnalyzerBase>::moduleConcurrencyType() const {
0770 return Worker::kLimited;
0771 }
0772 template <>
0773 Worker::ConcurrencyTypes WorkerT<edm::limited::OutputModuleBase>::moduleConcurrencyType() const {
0774 return Worker::kLimited;
0775 }
0776
0777 template <>
0778 Worker::ConcurrencyTypes WorkerT<edm::stream::EDProducerAdaptorBase>::moduleConcurrencyType() const {
0779 return Worker::kStream;
0780 }
0781 template <>
0782 Worker::ConcurrencyTypes WorkerT<edm::stream::EDFilterAdaptorBase>::moduleConcurrencyType() const {
0783 return Worker::kStream;
0784 }
0785 template <>
0786 Worker::ConcurrencyTypes WorkerT<edm::stream::EDAnalyzerAdaptorBase>::moduleConcurrencyType() const {
0787 return Worker::kStream;
0788 }
0789
0790 template <typename T>
0791 std::vector<ModuleConsumesInfo> WorkerT<T>::moduleConsumesInfos() const {
0792 return module_->moduleConsumesInfos();
0793 }
0794
0795
0796
0797 template class WorkerT<one::EDProducerBase>;
0798 template class WorkerT<one::EDFilterBase>;
0799 template class WorkerT<one::EDAnalyzerBase>;
0800 template class WorkerT<one::OutputModuleBase>;
0801 template class WorkerT<global::EDProducerBase>;
0802 template class WorkerT<global::EDFilterBase>;
0803 template class WorkerT<global::EDAnalyzerBase>;
0804 template class WorkerT<global::OutputModuleBase>;
0805 template class WorkerT<stream::EDProducerAdaptorBase>;
0806 template class WorkerT<stream::EDFilterAdaptorBase>;
0807 template class WorkerT<stream::EDAnalyzerAdaptorBase>;
0808 template class WorkerT<limited::EDProducerBase>;
0809 template class WorkerT<limited::EDFilterBase>;
0810 template class WorkerT<limited::EDAnalyzerBase>;
0811 template class WorkerT<limited::OutputModuleBase>;
0812 }