CMS 3D CMS Logo

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 const * moduleCallingContext () const
 
 ModuleCallingContext (ModuleDescription const *moduleDescription)
 
 ModuleCallingContext (ModuleDescription const *moduleDescription, State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread)
 
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 29 of file ModuleCallingContext.h.

Member Typedef Documentation

◆ Type

Definition at line 31 of file ModuleCallingContext.h.

Member Enumeration Documentation

◆ State

Enumerator
kPrefetching 
kRunning 
kInvalid 

Definition at line 33 of file ModuleCallingContext.h.

33  {
34  kPrefetching, // prefetching products before starting to run
35  kRunning, // module actually running
36  kInvalid
37  };

Constructor & Destructor Documentation

◆ ModuleCallingContext() [1/2]

edm::ModuleCallingContext::ModuleCallingContext ( ModuleDescription const *  moduleDescription)

◆ ModuleCallingContext() [2/2]

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

Definition at line 15 of file ModuleCallingContext.cc.

19  : previousModuleOnThread_(previousOnThread),
21  parent_(parent),
22  state_(state) {}

Member Function Documentation

◆ depth()

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

Definition at line 66 of file ModuleCallingContext.cc.

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

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

Referenced by edm::ESModuleCallingContext::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().

◆ getGlobalContext()

GlobalContext const * edm::ModuleCallingContext::getGlobalContext ( ) const

Definition at line 43 of file ModuleCallingContext.cc.

43  {
45  if (mcc->type() != ParentContext::Type::kGlobal) {
47  << "ModuleCallingContext::getGlobalContext() called in context not linked to a GlobalContext\n";
48  }
49  return mcc->globalContext();
50  }

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

◆ getStreamContext()

StreamContext const * edm::ModuleCallingContext::getStreamContext ( ) const

◆ getTopModuleCallingContext()

ModuleCallingContext const * edm::ModuleCallingContext::getTopModuleCallingContext ( ) const

Definition at line 52 of file ModuleCallingContext.cc.

52  {
53  ModuleCallingContext const* mcc = this;
54  while (mcc->type() == ParentContext::Type::kModule) {
55  mcc = mcc->moduleCallingContext();
56  }
57  if (mcc->type() == ParentContext::Type::kInternal) {
58  mcc = mcc->internalContext()->moduleCallingContext();
59  }
60  while (mcc->type() == ParentContext::Type::kModule) {
61  mcc = mcc->moduleCallingContext();
62  }
63  return mcc;
64  }

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

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

◆ globalContext()

GlobalContext const* edm::ModuleCallingContext::globalContext ( ) const
inline

Definition at line 57 of file ModuleCallingContext.h.

57 { return parent_.globalContext(); }

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

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

◆ internalContext()

InternalContext const* edm::ModuleCallingContext::internalContext ( ) const
inline

◆ moduleCallingContext()

ModuleCallingContext const* edm::ModuleCallingContext::moduleCallingContext ( ) const
inline

◆ moduleDescription()

ModuleDescription const* edm::ModuleCallingContext::moduleDescription ( ) const
inline

Definition at line 50 of file ModuleCallingContext.h.

50 { return moduleDescription_; }

References moduleDescription_.

Referenced by edm::Worker::description(), edm::Worker::exceptionContext(), edm::service::RandomNumberGeneratorService::getEngine(), edm::service::RandomNumberGeneratorService::mySeed(), edm::operator<<(), edm::SystemTimeKeeper::pauseModuleEvent(), edm::service::Tracer::postEventReadFromSource(), edm::service::SimpleMemoryCheck::postModule(), edm::service::MessageLogger::postModuleAccessInputProcessBlock(), edm::service::Tracer::postModuleAccessInputProcessBlock(), edm::service::MessageLogger::postModuleBeginProcessBlock(), edm::service::Tracer::postModuleBeginProcessBlock(), CUDAMonitoringService::postModuleBeginStream(), edm::service::MessageLogger::postModuleBeginStream(), edm::service::Tracer::postModuleBeginStream(), NVProfilerService::postModuleBeginStream(), edm::service::MessageLogger::postModuleEndProcessBlock(), edm::service::Tracer::postModuleEndProcessBlock(), edm::service::MessageLogger::postModuleEndStream(), edm::service::Tracer::postModuleEndStream(), NVProfilerService::postModuleEndStream(), CUDAMonitoringService::postModuleEvent(), FWPathsPopup::postModuleEvent(), edm::service::Timing::postModuleEvent(), TFileService::postModuleEvent(), edm::service::Tracer::postModuleEvent(), FastTimerService::postModuleEvent(), NVProfilerService::postModuleEvent(), edm::service::Tracer::postModuleEventAcquire(), FastTimerService::postModuleEventAcquire(), NVProfilerService::postModuleEventAcquire(), edm::service::Tracer::postModuleEventDelayedGet(), edm::service::Tracer::postModuleEventPrefetching(), NVProfilerService::postModuleEventPrefetching(), TFileService::postModuleGlobal(), edm::service::Tracer::postModuleGlobalBeginLumi(), NVProfilerService::postModuleGlobalBeginLumi(), edm::service::Tracer::postModuleGlobalBeginRun(), NVProfilerService::postModuleGlobalBeginRun(), edm::service::Tracer::postModuleGlobalEndLumi(), NVProfilerService::postModuleGlobalEndLumi(), edm::service::Tracer::postModuleGlobalEndRun(), NVProfilerService::postModuleGlobalEndRun(), edm::service::Tracer::postModuleStreamBeginLumi(), NVProfilerService::postModuleStreamBeginLumi(), edm::service::Tracer::postModuleStreamBeginRun(), NVProfilerService::postModuleStreamBeginRun(), edm::service::RandomNumberGeneratorService::postModuleStreamCheck(), edm::service::Tracer::postModuleStreamEndLumi(), NVProfilerService::postModuleStreamEndLumi(), edm::service::Tracer::postModuleStreamEndRun(), NVProfilerService::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::MessageLogger::preModuleAccessInputProcessBlock(), edm::service::Tracer::preModuleAccessInputProcessBlock(), edm::service::MessageLogger::preModuleBeginProcessBlock(), edm::service::Tracer::preModuleBeginProcessBlock(), edm::service::MessageLogger::preModuleBeginStream(), edm::service::Tracer::preModuleBeginStream(), NVProfilerService::preModuleBeginStream(), edm::service::MessageLogger::preModuleEndProcessBlock(), edm::service::Tracer::preModuleEndProcessBlock(), edm::service::MessageLogger::preModuleEndStream(), edm::service::Tracer::preModuleEndStream(), NVProfilerService::preModuleEndStream(), FWPathsPopup::preModuleEvent(), TFileService::preModuleEvent(), edm::service::Tracer::preModuleEvent(), evf::FastMonitoringService::preModuleEvent(), NVProfilerService::preModuleEvent(), edm::service::Tracer::preModuleEventAcquire(), evf::FastMonitoringService::preModuleEventAcquire(), NVProfilerService::preModuleEventAcquire(), edm::service::Tracer::preModuleEventDelayedGet(), edm::service::Tracer::preModuleEventPrefetching(), NVProfilerService::preModuleEventPrefetching(), TFileService::preModuleGlobal(), edm::service::Tracer::preModuleGlobalBeginLumi(), NVProfilerService::preModuleGlobalBeginLumi(), edm::service::Tracer::preModuleGlobalBeginRun(), NVProfilerService::preModuleGlobalBeginRun(), edm::service::Tracer::preModuleGlobalEndLumi(), NVProfilerService::preModuleGlobalEndLumi(), edm::service::Tracer::preModuleGlobalEndRun(), NVProfilerService::preModuleGlobalEndRun(), edm::service::Tracer::preModuleStreamBeginLumi(), NVProfilerService::preModuleStreamBeginLumi(), edm::service::Tracer::preModuleStreamBeginRun(), NVProfilerService::preModuleStreamBeginRun(), edm::service::RandomNumberGeneratorService::preModuleStreamCheck(), edm::service::Tracer::preModuleStreamEndLumi(), NVProfilerService::preModuleStreamEndLumi(), edm::service::Tracer::preModuleStreamEndRun(), NVProfilerService::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().

◆ parent()

ParentContext const& edm::ModuleCallingContext::parent ( void  ) const
inline

◆ placeInPathContext()

PlaceInPathContext const* edm::ModuleCallingContext::placeInPathContext ( ) const
inline

◆ previousModuleOnThread()

ModuleCallingContext const* edm::ModuleCallingContext::previousModuleOnThread ( ) const
inline

◆ setContext()

void edm::ModuleCallingContext::setContext ( State  state,
ParentContext const &  parent,
ModuleCallingContext const *  previousOnThread 
)

◆ setState()

void edm::ModuleCallingContext::setState ( State  state)
inline

Definition at line 48 of file ModuleCallingContext.h.

48 { state_ = state; }

References state(), and state_.

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

◆ state()

State edm::ModuleCallingContext::state ( ) const
inline

◆ streamContext()

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

Definition at line 56 of file ModuleCallingContext.h.

56 { return parent_.streamContext(); }

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

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

◆ type()

Type edm::ModuleCallingContext::type ( ) const
inline

Member Data Documentation

◆ moduleDescription_

ModuleDescription const* edm::ModuleCallingContext::moduleDescription_
private

Definition at line 79 of file ModuleCallingContext.h.

Referenced by moduleDescription().

◆ parent_

ParentContext edm::ModuleCallingContext::parent_
private

◆ previousModuleOnThread_

ModuleCallingContext const* edm::ModuleCallingContext::previousModuleOnThread_
private

Definition at line 78 of file ModuleCallingContext.h.

Referenced by previousModuleOnThread(), and setContext().

◆ state_

State edm::ModuleCallingContext::state_
private

Definition at line 81 of file ModuleCallingContext.h.

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

edm::ModuleCallingContext::state
State state() const
Definition: ModuleCallingContext.h:51
edm::ModuleCallingContext::parent_
ParentContext parent_
Definition: ModuleCallingContext.h:80
edm::ParentContext::streamContext
StreamContext const * streamContext() const
Definition: ParentContext.cc:45
edm::ModuleCallingContext::moduleDescription_
ModuleDescription const * moduleDescription_
Definition: ModuleCallingContext.h:79
edm::errors::LogicError
Definition: EDMException.h:37
edm::ParentContext::Type::kStream
edm::ParentContext::Type::kGlobal
edm::ParentContext::Type::kPlaceInPath
edm::ModuleCallingContext::State::kInvalid
edm::ModuleCallingContext::moduleDescription
ModuleDescription const * moduleDescription() const
Definition: ModuleCallingContext.h:50
edm::ParentContext::moduleCallingContext
ModuleCallingContext const * moduleCallingContext() const
Definition: ParentContext.cc:31
edm::ParentContext::type
Type type() const
Definition: ParentContext.h:38
edm::ParentContext::placeInPathContext
PlaceInPathContext const * placeInPathContext() const
Definition: ParentContext.cc:38
edm::ModuleCallingContext::parent
ParentContext const & parent() const
Definition: ModuleCallingContext.h:53
edm::ParentContext::Type::kInternal
edm::ModuleCallingContext::depth
unsigned depth() const
Definition: ModuleCallingContext.cc:66
edm::ParentContext::Type::kModule
edm::ModuleCallingContext::previousModuleOnThread_
ModuleCallingContext const * previousModuleOnThread_
Definition: ModuleCallingContext.h:78
edm::ParentContext::internalContext
InternalContext const * internalContext() const
Definition: ParentContext.cc:59
edm::ModuleCallingContext::getTopModuleCallingContext
ModuleCallingContext const * getTopModuleCallingContext() const
Definition: ModuleCallingContext.cc:52
edm::ModuleCallingContext::state_
State state_
Definition: ModuleCallingContext.h:81
edm::ParentContext::globalContext
GlobalContext const * globalContext() const
Definition: ParentContext.cc:52
Exception
Definition: hltDiff.cc:245
edm::ModuleCallingContext::ModuleCallingContext
ModuleCallingContext(ModuleDescription const *moduleDescription)
Definition: ModuleCallingContext.cc:12