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::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
 
void setEventSetup (EventSetup const &iSetup)
 
 UnscheduledCallProducer (ActivityRegistry &iReg)
 

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

void edm::UnscheduledCallProducer::addWorker ( Worker aWorker)
inline

Definition at line 45 of file UnscheduledCallProducer.h.

References assert(), and unscheduledWorkers_.

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

45  {
46  assert(0 != aWorker);
47  unscheduledWorkers_.push_back(aWorker);
48  }
assert(m_qm.get())
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::addContext(), edm::InLumi, edm::InRun, 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  std::ostringstream ost;
71  if (T::isEvent_) {
72  ost << "Calling event method";
73  }
74  else if (T::begin_ && T::branchType_ == InRun) {
75  ost << "Calling beginRun";
76  }
77  else if (T::begin_ && T::branchType_ == InLumi) {
78  ost << "Calling beginLuminosityBlock";
79  }
80  else if (!T::begin_ && T::branchType_ == InLumi) {
81  ost << "Calling endLuminosityBlock";
82  }
83  else if (!T::begin_ && T::branchType_ == InRun) {
84  ost << "Calling endRun";
85  }
86  else {
87  // It should be impossible to get here ...
88  ost << "Calling unknown function";
89  }
90  ost << " for unscheduled module " << worker->description().moduleName()
91  << "/'" << worker->description().moduleLabel() << "'";
92  ex.addContext(ost.str());
93  ost.str("");
94  ost << "Processing " << p.id();
95  ex.addContext(ost.str());
96  throw;
97  }
98  }
99  }
100  }
void addContext(std::string const &context)
Definition: Exception.cc:227
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 104 of file UnscheduledCallProducer.h.

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

worker_container edm::UnscheduledCallProducer::unscheduledWorkers_
private

Definition at line 103 of file UnscheduledCallProducer.h.

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