CMS 3D CMS Logo

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

#include <ModuleCallingContext.h>

Public Types

enum  State { State::kPrefetching, State::kRunning, State::kInvalid }
 
typedef ParentContext::Type Type
 

Public Member Functions

unsigned depth () const
 
GlobalContext const * getGlobalContext () const
 
StreamContext const * getStreamContext () const
 
ModuleCallingContext const * getTopModuleCallingContext () const
 
GlobalContext const * globalContext () const
 
InternalContext const * internalContext () const
 
 ModuleCallingContext (ModuleDescription const *moduleDescription)
 
 ModuleCallingContext (ModuleDescription const *moduleDescription, State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread)
 
ModuleCallingContext const * moduleCallingContext () const
 
ModuleDescription const * moduleDescription () const
 
ParentContext const & parent () const
 
PlaceInPathContext const * placeInPathContext () const
 
ModuleCallingContext const * previousModuleOnThread () const
 
void setContext (State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread)
 
void setState (State state)
 
State state () const
 
StreamContext const * streamContext () const
 
Type type () const
 

Private Attributes

ModuleDescription const * moduleDescription_
 
ParentContext parent_
 
ModuleCallingContext const * previousModuleOnThread_
 
State state_
 

Detailed Description

Description: This is intended primarily to be passed to Services as an argument to their callback functions.

Usage:

Definition at line 32 of file ModuleCallingContext.h.

Member Typedef Documentation

Definition at line 34 of file ModuleCallingContext.h.

Member Enumeration Documentation

Enumerator
kPrefetching 
kRunning 
kInvalid 

Definition at line 36 of file ModuleCallingContext.h.

36  {
37  kPrefetching, // prefetching products before starting to run
38  kRunning, // module actually running
39  kInvalid
40  };

Constructor & Destructor Documentation

edm::ModuleCallingContext::ModuleCallingContext ( ModuleDescription const *  moduleDescription)
edm::ModuleCallingContext::ModuleCallingContext ( ModuleDescription const *  moduleDescription,
State  state,
ParentContext const &  parent,
ModuleCallingContext const *  previousOnThread 
)

Definition at line 17 of file ModuleCallingContext.cc.

21  : previousModuleOnThread_(previousOnThread),
23  parent_(parent),
24  state_(state) {}
ModuleDescription const * moduleDescription_
ParentContext const & parent() const
ModuleDescription const * moduleDescription() const
ModuleCallingContext const * previousModuleOnThread_

Member Function Documentation

unsigned edm::ModuleCallingContext::depth ( void  ) const

Definition at line 68 of file ModuleCallingContext.cc.

References depth(), internalContext(), edm::ParentContext::kInternal, edm::ParentContext::kModule, edm::InternalContext::moduleCallingContext(), moduleCallingContext(), and type().

Referenced by edm::ESModuleCallingContext::depth(), depth(), edm::service::Tracer::postEventReadFromSource(), edm::service::Tracer::postModuleAccessInputProcessBlock(), edm::service::Tracer::postModuleBeginProcessBlock(), edm::service::Tracer::postModuleEndProcessBlock(), edm::service::Tracer::postModuleEvent(), edm::service::Tracer::postModuleEventAcquire(), edm::service::Tracer::postModuleEventDelayedGet(), edm::service::Tracer::postModuleEventPrefetching(), edm::service::Tracer::postModuleGlobalBeginLumi(), edm::service::Tracer::postModuleGlobalBeginRun(), edm::service::Tracer::postModuleGlobalEndLumi(), edm::service::Tracer::postModuleGlobalEndRun(), edm::service::Tracer::postModuleStreamBeginLumi(), edm::service::Tracer::postModuleStreamBeginRun(), edm::service::Tracer::postModuleStreamEndLumi(), edm::service::Tracer::postModuleStreamEndRun(), edm::service::Tracer::postModuleWriteLumi(), edm::service::Tracer::postModuleWriteProcessBlock(), edm::service::Tracer::postModuleWriteRun(), edm::service::Tracer::preEventReadFromSource(), edm::service::Tracer::preModuleAccessInputProcessBlock(), edm::service::Tracer::preModuleBeginProcessBlock(), edm::service::Tracer::preModuleEndProcessBlock(), edm::service::Tracer::preModuleEvent(), edm::service::Tracer::preModuleEventAcquire(), edm::service::Tracer::preModuleEventDelayedGet(), edm::service::Tracer::preModuleEventPrefetching(), edm::service::Tracer::preModuleGlobalBeginLumi(), edm::service::Tracer::preModuleGlobalBeginRun(), edm::service::Tracer::preModuleGlobalEndLumi(), edm::service::Tracer::preModuleGlobalEndRun(), edm::service::Tracer::preModuleStreamBeginLumi(), edm::service::Tracer::preModuleStreamBeginRun(), edm::service::Tracer::preModuleStreamEndLumi(), edm::service::Tracer::preModuleStreamEndRun(), edm::service::Tracer::preModuleWriteLumi(), edm::service::Tracer::preModuleWriteProcessBlock(), and edm::service::Tracer::preModuleWriteRun().

68  {
69  unsigned depth = 0;
70  ModuleCallingContext const* mcc = this;
71  while (mcc->type() == ParentContext::Type::kModule) {
72  ++depth;
73  mcc = mcc->moduleCallingContext();
74  }
75  if (mcc->type() == ParentContext::Type::kInternal) {
76  ++depth;
77  mcc = mcc->internalContext()->moduleCallingContext();
78  }
79  while (mcc->type() == ParentContext::Type::kModule) {
80  ++depth;
81  mcc = mcc->moduleCallingContext();
82  }
83  return depth;
84  }
ModuleCallingContext(ModuleDescription const *moduleDescription)
GlobalContext const * edm::ModuleCallingContext::getGlobalContext ( ) const

Definition at line 45 of file ModuleCallingContext.cc.

References Exception, getTopModuleCallingContext(), globalContext(), edm::ParentContext::kGlobal, edm::errors::LogicError, and type().

Referenced by edm::service::MessageLogger::setThreadContext().

45  {
47  if (mcc->type() != ParentContext::Type::kGlobal) {
49  << "ModuleCallingContext::getGlobalContext() called in context not linked to a GlobalContext\n";
50  }
51  return mcc->globalContext();
52  }
ModuleCallingContext const * getTopModuleCallingContext() const
ModuleCallingContext(ModuleDescription const *moduleDescription)
StreamContext const * edm::ModuleCallingContext::getStreamContext ( ) const

Definition at line 34 of file ModuleCallingContext.cc.

References Exception, getTopModuleCallingContext(), edm::ParentContext::kPlaceInPath, edm::ParentContext::kStream, edm::errors::LogicError, edm::PlaceInPathContext::pathContext(), placeInPathContext(), edm::PathContext::streamContext(), streamContext(), and type().

Referenced by edm::Worker::emitPostModuleEventPrefetchingSignal(), edm::EventAcquireSignalsSentry::EventAcquireSignalsSentry(), edm::EventSignalsSentry::EventSignalsSentry(), edm::DelayedReader::getProduct(), edm::Worker::prefetchAsync(), edm::UnscheduledProductResolver::prefetchAsync_(), edm::DelayedReaderInputProductResolver::resolveProduct_(), edm::service::MessageLogger::setThreadContext(), edm::EventAcquireSignalsSentry::~EventAcquireSignalsSentry(), and edm::EventSignalsSentry::~EventSignalsSentry().

34  {
36  if (mcc->type() == ParentContext::Type::kPlaceInPath) {
37  return mcc->placeInPathContext()->pathContext()->streamContext();
38  } else if (mcc->type() != ParentContext::Type::kStream) {
40  << "ModuleCallingContext::getStreamContext() called in context not linked to a StreamContext\n";
41  }
42  return mcc->streamContext();
43  }
ModuleCallingContext const * getTopModuleCallingContext() const
ModuleCallingContext(ModuleDescription const *moduleDescription)
ModuleCallingContext const * edm::ModuleCallingContext::getTopModuleCallingContext ( ) const

Definition at line 54 of file ModuleCallingContext.cc.

References internalContext(), edm::ParentContext::kInternal, edm::ParentContext::kModule, edm::InternalContext::moduleCallingContext(), moduleCallingContext(), and type().

Referenced by getGlobalContext(), getStreamContext(), edm::ESModuleCallingContext::getTopModuleCallingContext(), edm::service::MessageLogger::setThreadContext(), and edm::Worker::shouldRethrowException().

54  {
55  ModuleCallingContext const* mcc = this;
56  while (mcc->type() == ParentContext::Type::kModule) {
57  mcc = mcc->moduleCallingContext();
58  }
59  if (mcc->type() == ParentContext::Type::kInternal) {
60  mcc = mcc->internalContext()->moduleCallingContext();
61  }
62  while (mcc->type() == ParentContext::Type::kModule) {
63  mcc = mcc->moduleCallingContext();
64  }
65  return mcc;
66  }
ModuleCallingContext(ModuleDescription const *moduleDescription)
GlobalContext const* edm::ModuleCallingContext::globalContext ( ) const
inline

Definition at line 60 of file ModuleCallingContext.h.

References edm::ParentContext::globalContext(), and parent_.

Referenced by edm::exceptionContext(), and getGlobalContext().

60 { return parent_.globalContext(); }
GlobalContext const * globalContext() const
InternalContext const* edm::ModuleCallingContext::internalContext ( ) const
inline

Definition at line 61 of file ModuleCallingContext.h.

References edm::ParentContext::internalContext(), and parent_.

Referenced by depth(), edm::exceptionContext(), and getTopModuleCallingContext().

61 { return parent_.internalContext(); }
InternalContext const * internalContext() const
ModuleCallingContext const* edm::ModuleCallingContext::moduleCallingContext ( ) const
inline

Definition at line 57 of file ModuleCallingContext.h.

References edm::ParentContext::moduleCallingContext(), and parent_.

Referenced by depth(), edm::exceptionContext(), getTopModuleCallingContext(), and edm::operator<<().

57 { return parent_.moduleCallingContext(); }
ModuleCallingContext const * moduleCallingContext() const
ModuleDescription const* edm::ModuleCallingContext::moduleDescription ( ) const
inline

Definition at line 53 of file ModuleCallingContext.h.

References moduleDescription_.

Referenced by edm::Worker::description(), edm::service::MessageLogger::establishModule(), edm::exceptionContext(), edm::service::RandomNumberGeneratorService::getEngine(), edm::service::RandomNumberGeneratorService::mySeed(), edm::operator<<(), edm::SystemTimeKeeper::pauseModuleEvent(), NVProfilerService::postCloseFile(), edm::service::Tracer::postEventReadFromSource(), edm::service::SimpleMemoryCheck::postModule(), edm::service::Tracer::postModuleAccessInputProcessBlock(), edm::service::Tracer::postModuleBeginProcessBlock(), CUDAMonitoringService::postModuleBeginStream(), edm::service::MessageLogger::postModuleBeginStream(), edm::service::Tracer::postModuleBeginStream(), edm::service::Tracer::postModuleEndProcessBlock(), edm::service::MessageLogger::postModuleEndStream(), edm::service::Tracer::postModuleEndStream(), CUDAMonitoringService::postModuleEvent(), FWPathsPopup::postModuleEvent(), edm::service::IgProfService::postModuleEvent(), edm::service::Timing::postModuleEvent(), TFileService::postModuleEvent(), edm::service::Tracer::postModuleEvent(), FastTimerService::postModuleEvent(), FastTimerService::postModuleEventAcquire(), edm::service::Tracer::postModuleEventAcquire(), edm::service::Tracer::postModuleEventDelayedGet(), edm::service::Tracer::postModuleEventPrefetching(), TFileService::postModuleGlobal(), edm::service::Tracer::postModuleGlobalBeginLumi(), edm::service::Tracer::postModuleGlobalBeginRun(), edm::service::Tracer::postModuleGlobalEndLumi(), edm::service::Tracer::postModuleGlobalEndRun(), edm::service::Tracer::postModuleStreamBeginLumi(), edm::service::Tracer::postModuleStreamBeginRun(), edm::service::RandomNumberGeneratorService::postModuleStreamCheck(), edm::service::Tracer::postModuleStreamEndLumi(), edm::service::Tracer::postModuleStreamEndRun(), edm::service::Tracer::postModuleWriteLumi(), edm::service::Tracer::postModuleWriteProcessBlock(), edm::service::Tracer::postModuleWriteRun(), edm::service::Tracer::preEventReadFromSource(), VariableHelperService::preModule(), edm::service::SimpleMemoryCheck::preModule(), edm::service::Tracer::preModuleAccessInputProcessBlock(), edm::service::Tracer::preModuleBeginProcessBlock(), edm::service::MessageLogger::preModuleBeginStream(), edm::service::Tracer::preModuleBeginStream(), edm::service::Tracer::preModuleEndProcessBlock(), edm::service::MessageLogger::preModuleEndStream(), edm::service::Tracer::preModuleEndStream(), FWPathsPopup::preModuleEvent(), edm::service::IgProfService::preModuleEvent(), TFileService::preModuleEvent(), edm::service::Tracer::preModuleEvent(), evf::FastMonitoringService::preModuleEvent(), edm::service::Tracer::preModuleEventAcquire(), evf::FastMonitoringService::preModuleEventAcquire(), edm::service::Tracer::preModuleEventDelayedGet(), edm::service::Tracer::preModuleEventPrefetching(), TFileService::preModuleGlobal(), edm::service::Tracer::preModuleGlobalBeginLumi(), edm::service::Tracer::preModuleGlobalBeginRun(), edm::service::Tracer::preModuleGlobalEndLumi(), edm::service::Tracer::preModuleGlobalEndRun(), edm::service::Tracer::preModuleStreamBeginLumi(), edm::service::Tracer::preModuleStreamBeginRun(), edm::service::RandomNumberGeneratorService::preModuleStreamCheck(), edm::service::Tracer::preModuleStreamEndLumi(), edm::service::Tracer::preModuleStreamEndRun(), edm::service::Tracer::preModuleWriteLumi(), edm::service::Tracer::preModuleWriteProcessBlock(), edm::service::Tracer::preModuleWriteRun(), edm::SystemTimeKeeper::restartModuleEvent(), edm::SystemTimeKeeper::startModuleEvent(), edm::SystemTimeKeeper::stopModuleEvent(), and edm::service::ConcurrentModuleTimer::trackModule().

53 { return moduleDescription_; }
ModuleDescription const * moduleDescription_
ParentContext const& edm::ModuleCallingContext::parent ( void  ) const
inline
PlaceInPathContext const* edm::ModuleCallingContext::placeInPathContext ( ) const
inline
ModuleCallingContext const* edm::ModuleCallingContext::previousModuleOnThread ( ) const
inline
void edm::ModuleCallingContext::setContext ( State  state,
ParentContext const &  parent,
ModuleCallingContext const *  previousOnThread 
)
void edm::ModuleCallingContext::setState ( State  state)
inline

Definition at line 51 of file ModuleCallingContext.h.

References state(), and state_.

Referenced by edm::Worker::beginStream(), and edm::Worker::endStream().

State edm::ModuleCallingContext::state ( ) const
inline
StreamContext const* edm::ModuleCallingContext::streamContext ( ) const
inline

Definition at line 59 of file ModuleCallingContext.h.

References parent_, and edm::ParentContext::streamContext().

Referenced by edm::exceptionContext(), and getStreamContext().

59 { return parent_.streamContext(); }
StreamContext const * streamContext() const
Type edm::ModuleCallingContext::type ( ) const
inline

Member Data Documentation

ModuleDescription const* edm::ModuleCallingContext::moduleDescription_
private

Definition at line 82 of file ModuleCallingContext.h.

Referenced by moduleDescription().

ParentContext edm::ModuleCallingContext::parent_
private
ModuleCallingContext const* edm::ModuleCallingContext::previousModuleOnThread_
private

Definition at line 81 of file ModuleCallingContext.h.

Referenced by previousModuleOnThread(), and setContext().

State edm::ModuleCallingContext::state_
private

Definition at line 84 of file ModuleCallingContext.h.

Referenced by setContext(), setState(), and state().