WorkerInPath.h
Go to the documentation of this file.
1 #ifndef art_Framework_Core_WorkerInPath_h
2 #define art_Framework_Core_WorkerInPath_h
3 // vim: set sw=2 expandtab :
4 
5 // ====================================================================
6 // The WorkerInPath is a wrapper around a Worker, so that statistics
7 // can be managed per path. A Path holds Workers as these things.
8 //
9 // For a given module label, there will be n*m WorkerInPath objects,
10 // where n is the number of configured schedules, and m is the number
11 // paths in which the module label appears.
12 // ====================================================================
13 
19 #include "art/Utilities/fwd.h"
20 #include "cetlib/exempt_ptr.h"
21 #include "hep_concurrency/WaitingTask.h"
22 
23 #include <string>
24 
25 namespace art {
27 
28  namespace detail {
29  struct ModuleConfigInfo;
30  }
31 
32  class WorkerInPath {
33  public:
34  struct ConfigInfo {
37  : moduleConfigInfo{info}, filterAction{action}
38  {}
41  };
42 
43  // Special Member Functions
46  ModuleContext const&,
47  GlobalTaskGroup& group);
48 
49  // API for user
50  Worker* getWorker() const;
51  detail::FilterAction filterAction() const;
52 
53  // Used only by Path
54  bool returnCode() const;
55  std::string const& label() const;
56  bool run(Transition, Principal&);
57  void run(hep::concurrency::WaitingTaskPtr workerDoneTask, EventPrincipal&);
58  void clearCounters();
59 
60  // Used by writeSummary
61  std::size_t timesVisited() const;
62  std::size_t timesPassed() const;
63  std::size_t timesFailed() const;
64  std::size_t timesExcept() const;
65 
66  private:
68 
73 
74  // Per-schedule
75  bool returnCode_{false};
76 
77  // Counts
78  std::size_t counts_visited_{};
79  std::size_t counts_passed_{};
80  std::size_t counts_failed_{};
81  std::size_t counts_thrown_{};
82  };
83 
84 } // namespace art
85 
86 #endif /* art_Framework_Core_WorkerInPath_h */
87 
88 // Local Variables:
89 // mode: c++
90 // End:
std::string string
Definition: nybbler.cc:12
ConfigInfo(cet::exempt_ptr< detail::ModuleConfigInfo const > const info, detail::FilterAction const action)
Definition: WorkerInPath.h:35
ModuleContext moduleContext_
Definition: WorkerInPath.h:71
std::string module_label_t
Definition: WorkerInPath.h:26
detail::FilterAction filterAction
Definition: WorkerInPath.h:40
GlobalTaskGroup * taskGroup_
Definition: WorkerInPath.h:72
Transition
Definition: Transition.h:7
cet::exempt_ptr< detail::ModuleConfigInfo const > moduleConfigInfo
Definition: WorkerInPath.h:39
detail::FilterAction filterAction_
Definition: WorkerInPath.h:70
cet::exempt_ptr< Worker > worker_
Definition: WorkerInPath.h:67