CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
edm::WorkerInPath Class Reference

#include <WorkerInPath.h>

Public Types

enum  FilterAction { Normal =0, Ignore, Veto }
 

Public Member Functions

void clearCounters ()
 
FilterAction filterAction () const
 
WorkergetWorker () const
 
template<typename T >
bool runWorker (typename T::MyPrincipal const &, EventSetup const &, StreamID streamID, typename T::Context const *context)
 
void setPathContext (PathContext const *v)
 
int timesExcept () const
 
int timesFailed () const
 
int timesPassed () const
 
int timesVisited () const
 
 WorkerInPath (Worker *, FilterAction theAction, unsigned int placeInPath)
 

Private Attributes

FilterAction filterAction_
 
PlaceInPathContext placeInPathContext_
 
int timesExcept_
 
int timesFailed_
 
int timesPassed_
 
int timesVisited_
 
Workerworker_
 

Detailed Description

Definition at line 23 of file WorkerInPath.h.

Member Enumeration Documentation

Enumerator
Normal 
Ignore 
Veto 

Definition at line 25 of file WorkerInPath.h.

Constructor & Destructor Documentation

edm::WorkerInPath::WorkerInPath ( Worker w,
FilterAction  theAction,
unsigned int  placeInPath 
)

Definition at line 6 of file WorkerInPath.cc.

6  :
8  timesPassed_(),
9  timesFailed_(),
10  timesExcept_(),
11  filterAction_(theFilterAction),
12  worker_(w),
13  placeInPathContext_(placeInPath)
14  {
15  }
const double w
Definition: UKUtility.cc:23
FilterAction filterAction_
Definition: WorkerInPath.h:54
PlaceInPathContext placeInPathContext_
Definition: WorkerInPath.h:57

Member Function Documentation

void edm::WorkerInPath::clearCounters ( )
inline
FilterAction edm::WorkerInPath::filterAction ( ) const
inline

Definition at line 43 of file WorkerInPath.h.

References filterAction_.

43 { return filterAction_; }
FilterAction filterAction_
Definition: WorkerInPath.h:54
Worker* edm::WorkerInPath::getWorker ( ) const
inline

Definition at line 44 of file WorkerInPath.h.

References worker_.

44 { return worker_; }
template<typename T >
bool edm::WorkerInPath::runWorker ( typename T::MyPrincipal const &  ep,
EventSetup const &  es,
StreamID  streamID,
typename T::Context const *  context 
)

Definition at line 61 of file WorkerInPath.h.

References edm::Worker::doWork(), filterAction_, Ignore, placeInPathContext_, timesExcept_, timesFailed_, timesPassed_, timesVisited_, Veto, and worker_.

63  {
64 
65  if (T::isEvent_) {
66  ++timesVisited_;
67  }
68  bool rc = true;
69 
70  try {
71  // may want to change the return value from the worker to be
72  // the Worker::FilterAction so conditions in the path will be easier to
73  // identify
74  if(T::isEvent_) {
75  ParentContext parentContext(&placeInPathContext_);
76  rc = worker_->doWork<T>(ep, es,streamID, parentContext, context);
77  } else {
78  ParentContext parentContext(context);
79  rc = worker_->doWork<T>(ep, es,streamID, parentContext, context);
80  }
81  // Ignore return code for non-event (e.g. run, lumi) calls
82  if (!T::isEvent_) rc = true;
83  else if (filterAction_ == Veto) rc = !rc;
84  else if (filterAction_ == Ignore) rc = true;
85 
86  if (T::isEvent_) {
87  if(rc) ++timesPassed_; else ++timesFailed_;
88  }
89  }
90  catch(...) {
91  if (T::isEvent_) ++timesExcept_;
92  throw;
93  }
94 
95  return rc;
96  }
bool doWork(typename T::MyPrincipal const &, EventSetup const &c, StreamID stream, ParentContext const &parentContext, typename T::Context const *context)
Definition: Worker.h:452
FilterAction filterAction_
Definition: WorkerInPath.h:54
PlaceInPathContext placeInPathContext_
Definition: WorkerInPath.h:57
long double T
void edm::WorkerInPath::setPathContext ( PathContext const *  v)
inline

Definition at line 46 of file WorkerInPath.h.

References placeInPathContext_, and edm::PlaceInPathContext::setPathContext().

void setPathContext(PathContext const *v)
PlaceInPathContext placeInPathContext_
Definition: WorkerInPath.h:57
int edm::WorkerInPath::timesExcept ( ) const
inline

Definition at line 41 of file WorkerInPath.h.

References timesExcept_.

41 { return timesExcept_; }
int edm::WorkerInPath::timesFailed ( ) const
inline

Definition at line 40 of file WorkerInPath.h.

References timesFailed_.

40 { return timesFailed_; }
int edm::WorkerInPath::timesPassed ( ) const
inline

Definition at line 39 of file WorkerInPath.h.

References timesPassed_.

39 { return timesPassed_; }
int edm::WorkerInPath::timesVisited ( ) const
inline

Definition at line 38 of file WorkerInPath.h.

References timesVisited_.

38 { return timesVisited_; }

Member Data Documentation

FilterAction edm::WorkerInPath::filterAction_
private

Definition at line 54 of file WorkerInPath.h.

Referenced by filterAction(), and runWorker().

PlaceInPathContext edm::WorkerInPath::placeInPathContext_
private

Definition at line 57 of file WorkerInPath.h.

Referenced by runWorker(), and setPathContext().

int edm::WorkerInPath::timesExcept_
private

Definition at line 52 of file WorkerInPath.h.

Referenced by clearCounters(), runWorker(), and timesExcept().

int edm::WorkerInPath::timesFailed_
private

Definition at line 51 of file WorkerInPath.h.

Referenced by clearCounters(), runWorker(), and timesFailed().

int edm::WorkerInPath::timesPassed_
private

Definition at line 50 of file WorkerInPath.h.

Referenced by clearCounters(), runWorker(), and timesPassed().

int edm::WorkerInPath::timesVisited_
private

Definition at line 49 of file WorkerInPath.h.

Referenced by clearCounters(), runWorker(), and timesVisited().

Worker* edm::WorkerInPath::worker_
private

Definition at line 55 of file WorkerInPath.h.

Referenced by getWorker(), and runWorker().