CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::UnscheduledCallProducer Class Reference

#include <UnscheduledCallProducer.h>

Public Types

using const_iterator = worker_container::const_iterator
 
using worker_container = std::vector< Worker * >
 

Public Member Functions

void addWorker (Worker *aWorker)
 
UnscheduledAuxiliary const & auxiliary () const
 
const_iterator begin () const
 
const_iterator end () const
 
template<typename T , typename U >
void runNow (typename T::MyPrincipal &p, EventSetup const &es, StreamID streamID, typename T::Context const *topContext, U const *context) const
 
template<typename T , typename U >
void runNowAsync (WaitingTask *task, typename T::MyPrincipal &p, EventSetup const &es, StreamID streamID, typename T::Context const *topContext, U const *context) const
 
void setEventSetup (EventSetup const &iSetup)
 
 UnscheduledCallProducer (ActivityRegistry &iReg)
 

Private Member Functions

template<typename T , typename ID >
void addContextToException (cms::Exception &ex, Worker const *worker, ID const &id) const
 

Private Attributes

UnscheduledAuxiliary aux_
 
worker_container unscheduledWorkers_
 

Detailed Description

Definition at line 35 of file UnscheduledCallProducer.h.

Member Typedef Documentation

using edm::UnscheduledCallProducer::const_iterator = worker_container::const_iterator

Definition at line 39 of file UnscheduledCallProducer.h.

Definition at line 38 of file UnscheduledCallProducer.h.

Constructor & Destructor Documentation

edm::UnscheduledCallProducer::UnscheduledCallProducer ( ActivityRegistry iReg)
inline

Definition at line 41 of file UnscheduledCallProducer.h.

References aux_, edm::signalslot::Signal< T >::connect(), edm::UnscheduledAuxiliary::postModuleDelayedGetSignal_, edm::ActivityRegistry::postModuleEventDelayedGetSignal_, edm::UnscheduledAuxiliary::preModuleDelayedGetSignal_, and edm::ActivityRegistry::preModuleEventDelayedGetSignal_.

42  aux_.preModuleDelayedGetSignal_.connect(std::cref(iReg.preModuleEventDelayedGetSignal_));
43  aux_.postModuleDelayedGetSignal_.connect(std::cref(iReg.postModuleEventDelayedGetSignal_));
44  }
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> preModuleDelayedGetSignal_
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> postModuleDelayedGetSignal_
void connect(U iFunc)
Definition: Signal.h:63

Member Function Documentation

template<typename T , typename ID >
void edm::UnscheduledCallProducer::addContextToException ( cms::Exception ex,
Worker const *  worker,
ID const &  id 
) const
inlineprivate

Definition at line 95 of file UnscheduledCallProducer.h.

References cms::Exception::addContext(), and hcalTTPDigis_cfi::id.

95  {
96  std::ostringstream ost;
97  ost << "Processing " << T::transitionName()<<" "<< id;
98  ex.addContext(ost.str());
99  }
void addContext(std::string const &context)
Definition: Exception.cc:227
void edm::UnscheduledCallProducer::addWorker ( Worker aWorker)
inline

Definition at line 45 of file UnscheduledCallProducer.h.

References unscheduledWorkers_.

Referenced by edm::WorkerManager::addToUnscheduledWorkers().

45  {
46  assert(0 != aWorker);
47  unscheduledWorkers_.push_back(aWorker);
48  }
UnscheduledAuxiliary const& edm::UnscheduledCallProducer::auxiliary ( ) const
inline

Definition at line 54 of file UnscheduledCallProducer.h.

References aux_.

Referenced by edm::WorkerManager::setupOnDemandSystem().

54 { return aux_; }
const_iterator edm::UnscheduledCallProducer::begin ( void  ) const
inline

Definition at line 56 of file UnscheduledCallProducer.h.

References unscheduledWorkers_.

56 { return unscheduledWorkers_.begin(); }
const_iterator edm::UnscheduledCallProducer::end ( void  ) const
inline

Definition at line 57 of file UnscheduledCallProducer.h.

References unscheduledWorkers_.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

57 { return unscheduledWorkers_.end(); }
template<typename T , typename U >
void edm::UnscheduledCallProducer::runNow ( typename T::MyPrincipal &  p,
EventSetup const &  es,
StreamID  streamID,
typename T::Context const *  topContext,
U const *  context 
) const
inline

Definition at line 60 of file UnscheduledCallProducer.h.

References cms::Exception::context(), AlCaHLTBitMon_ParallelJobs::p, and unscheduledWorkers_.

Referenced by edm::WorkerManager::processOneOccurrence().

61  {
62  //do nothing for event since we will run when requested
63  if(!T::isEvent_) {
64  for(auto worker: unscheduledWorkers_) {
65  try {
66  ParentContext parentContext(context);
67  worker->doWork<T>(p, es, streamID, parentContext, topContext);
68  }
69  catch (cms::Exception & ex) {
70  if(ex.context().empty()) {
71  addContextToException<T>(ex,worker,p.id());
72  }
73  throw;
74  }
75  }
76  }
77  }
std::list< std::string > const & context() const
Definition: Exception.cc:191
long double T
template<typename T , typename U >
void edm::UnscheduledCallProducer::runNowAsync ( WaitingTask task,
typename T::MyPrincipal &  p,
EventSetup const &  es,
StreamID  streamID,
typename T::Context const *  topContext,
U const *  context 
) const
inline

Definition at line 80 of file UnscheduledCallProducer.h.

References AlCaHLTBitMon_ParallelJobs::p, and unscheduledWorkers_.

Referenced by edm::WorkerManager::processOneOccurrenceAsync().

82  {
83  //do nothing for event since we will run when requested
84  if(!T::isEvent_) {
85  for(auto worker: unscheduledWorkers_) {
86  ParentContext parentContext(context);
87  worker->doWorkNoPrefetchingAsync<T>(task, p, es, streamID, parentContext, topContext);
88  }
89  }
90  }
long double T
void edm::UnscheduledCallProducer::setEventSetup ( EventSetup const &  iSetup)
inline

Definition at line 50 of file UnscheduledCallProducer.h.

References aux_, and edm::UnscheduledAuxiliary::setEventSetup().

Referenced by edm::WorkerManager::setupOnDemandSystem().

50  {
51  aux_.setEventSetup(&iSetup);
52  }
void setEventSetup(EventSetup const *iSetup)

Member Data Documentation

UnscheduledAuxiliary edm::UnscheduledCallProducer::aux_
private

Definition at line 101 of file UnscheduledCallProducer.h.

Referenced by auxiliary(), setEventSetup(), and UnscheduledCallProducer().

worker_container edm::UnscheduledCallProducer::unscheduledWorkers_
private

Definition at line 100 of file UnscheduledCallProducer.h.

Referenced by addWorker(), begin(), end(), runNow(), and runNowAsync().