CMS 3D CMS Logo

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

#include <ESModuleCallingContext.h>

Public Types

enum  State { State::kPrefetching, State::kRunning, State::kInvalid }
 
using Type = ESParentContext::Type
 

Public Member Functions

std::uintptr_t callID () const
 
edm::eventsetup::ComponentDescription const * componentDescription () const
 
unsigned depth () const
 
 ESModuleCallingContext (edm::eventsetup::ComponentDescription const *moduleDescription, std::uintptr_t id)
 
 ESModuleCallingContext (edm::eventsetup::ComponentDescription const *moduleDescription, std::uintptr_t id, State state, ESParentContext const &parent)
 
ESModuleCallingContext const * esmoduleCallingContext () const
 
ModuleCallingContext const * getTopModuleCallingContext () const
 
ModuleCallingContext const * moduleCallingContext () const
 
ESParentContext const & parent () const
 
void setContext (State state, ESParentContext const &parent)
 
void setState (State state)
 
State state () const
 
Type type () const
 

Private Attributes

edm::eventsetup::ComponentDescription const * componentDescription_
 
std::uintptr_t id_
 
ESParentContext parent_
 
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 28 of file ESModuleCallingContext.h.

Member Typedef Documentation

◆ Type

Definition at line 30 of file ESModuleCallingContext.h.

Member Enumeration Documentation

◆ State

Enumerator
kPrefetching 
kRunning 
kInvalid 

Definition at line 32 of file ESModuleCallingContext.h.

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

Constructor & Destructor Documentation

◆ ESModuleCallingContext() [1/2]

edm::ESModuleCallingContext::ESModuleCallingContext ( edm::eventsetup::ComponentDescription const *  moduleDescription,
std::uintptr_t  id 
)

◆ ESModuleCallingContext() [2/2]

edm::ESModuleCallingContext::ESModuleCallingContext ( edm::eventsetup::ComponentDescription const *  moduleDescription,
std::uintptr_t  id,
State  state,
ESParentContext const &  parent 
)

Definition at line 14 of file ESModuleCallingContext.cc.

ESParentContext const & parent() const
edm::eventsetup::ComponentDescription const * componentDescription_
edm::eventsetup::ComponentDescription const * componentDescription() const

Member Function Documentation

◆ callID()

std::uintptr_t edm::ESModuleCallingContext::callID ( ) const
inline

Returns a unique id for this module to differentiate possibly concurrent calls to the module. The value returned may be large so not appropriate for an index lookup.

Definition at line 55 of file ESModuleCallingContext.h.

References id_.

Referenced by edm::moduleAlloc::monitor_file_utilities::module_callid(), and edm::service::monitor_file_utilities::module_callid().

55 { return id_; }

◆ componentDescription()

edm::eventsetup::ComponentDescription const* edm::ESModuleCallingContext::componentDescription ( ) const
inline

◆ depth()

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

Definition at line 33 of file ESModuleCallingContext.cc.

References edm::ModuleCallingContext::depth(), esmoduleCallingContext(), edm::ESParentContext::kESModule, moduleCallingContext(), and type().

Referenced by edm::service::Tracer::postESModule(), edm::service::Tracer::postESModuleAcquire(), edm::service::Tracer::postESModulePrefetching(), edm::service::Tracer::preESModule(), edm::service::Tracer::preESModuleAcquire(), and edm::service::Tracer::preESModulePrefetching().

33  {
34  unsigned depth = 0;
35  ESModuleCallingContext const* mcc = this;
36  while (mcc->type() == ESParentContext::Type::kESModule) {
37  ++depth;
38  mcc = mcc->esmoduleCallingContext();
39  }
40  return depth + mcc->moduleCallingContext()->depth();
41  }
ESModuleCallingContext(edm::eventsetup::ComponentDescription const *moduleDescription, std::uintptr_t id)

◆ esmoduleCallingContext()

ESModuleCallingContext const* edm::ESModuleCallingContext::esmoduleCallingContext ( ) const
inline

Definition at line 58 of file ESModuleCallingContext.h.

References edm::ESParentContext::esmoduleCallingContext(), and parent_.

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

58 { return parent_.esmoduleCallingContext(); }
ESModuleCallingContext const * esmoduleCallingContext() const

◆ getTopModuleCallingContext()

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

Definition at line 25 of file ESModuleCallingContext.cc.

References esmoduleCallingContext(), edm::ModuleCallingContext::getTopModuleCallingContext(), edm::ESParentContext::kESModule, moduleCallingContext(), and type().

25  {
26  ESModuleCallingContext const* mcc = this;
27  while (mcc->type() == ESParentContext::Type::kESModule) {
28  mcc = mcc->esmoduleCallingContext();
29  }
30  return mcc->moduleCallingContext()->getTopModuleCallingContext();
31  }
ESModuleCallingContext(edm::eventsetup::ComponentDescription const *moduleDescription, std::uintptr_t id)

◆ moduleCallingContext()

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

Definition at line 57 of file ESModuleCallingContext.h.

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

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

57 { return parent_.moduleCallingContext(); }
ModuleCallingContext const * moduleCallingContext() const

◆ parent()

ESParentContext const& edm::ESModuleCallingContext::parent ( void  ) const
inline

Definition at line 56 of file ESModuleCallingContext.h.

References parent_.

Referenced by setContext().

56 { return parent_; }

◆ setContext()

void edm::ESModuleCallingContext::setContext ( State  state,
ESParentContext const &  parent 
)

◆ setState()

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

◆ state()

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

Definition at line 50 of file ESModuleCallingContext.h.

References state_.

Referenced by edm::exceptionContext(), setContext(), and setState().

◆ type()

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

Definition at line 51 of file ESModuleCallingContext.h.

References parent_, and edm::ESParentContext::type().

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

51 { return parent_.type(); }
Type type() const noexcept

Member Data Documentation

◆ componentDescription_

edm::eventsetup::ComponentDescription const* edm::ESModuleCallingContext::componentDescription_
private

Definition at line 69 of file ESModuleCallingContext.h.

Referenced by componentDescription().

◆ id_

std::uintptr_t edm::ESModuleCallingContext::id_
private

Definition at line 71 of file ESModuleCallingContext.h.

Referenced by callID().

◆ parent_

ESParentContext edm::ESModuleCallingContext::parent_
private

◆ state_

State edm::ESModuleCallingContext::state_
private

Definition at line 72 of file ESModuleCallingContext.h.

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