test
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::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 30 of file ModuleCallingContext.h.

Member Typedef Documentation

Definition at line 33 of file ModuleCallingContext.h.

Member Enumeration Documentation

Enumerator
kPrefetching 
kRunning 
kInvalid 

Definition at line 35 of file ModuleCallingContext.h.

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

Constructor & Destructor Documentation

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

Definition at line 12 of file ModuleCallingContext.cc.

12  :
13  previousModuleOnThread_(nullptr),
15  parent_(),
17  }
ModuleDescription const * moduleDescription_
ModuleDescription const * moduleDescription() const
ModuleCallingContext const * previousModuleOnThread_
edm::ModuleCallingContext::ModuleCallingContext ( ModuleDescription const *  moduleDescription,
State  state,
ParentContext const &  parent,
ModuleCallingContext const *  previousOnThread 
)

Definition at line 19 of file ModuleCallingContext.cc.

22  :
23  previousModuleOnThread_(previousOnThread),
25  parent_(parent),
26  state_(state) {
27  }
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 74 of file ModuleCallingContext.cc.

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

Referenced by edm::service::Tracer::postModuleEvent(), edm::service::Tracer::postModuleEventDelayedGet(), 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::preModuleEvent(), edm::service::Tracer::preModuleEventDelayedGet(), 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(), and edm::service::Tracer::preModuleStreamEndRun().

74  {
75  unsigned depth = 0;
76  ModuleCallingContext const* mcc = this;
77  while(mcc->type() == ParentContext::Type::kModule) {
78  ++depth;
79  mcc = mcc->moduleCallingContext();
80  }
81  if(mcc->type() == ParentContext::Type::kInternal) {
82  ++depth;
83  mcc = mcc->internalContext()->moduleCallingContext();
84  }
85  while(mcc->type() == ParentContext::Type::kModule) {
86  ++depth;
87  mcc = mcc->moduleCallingContext();
88  }
89  return depth;
90  }
ModuleCallingContext(ModuleDescription const *moduleDescription)
GlobalContext const * edm::ModuleCallingContext::getGlobalContext ( ) const

Definition at line 49 of file ModuleCallingContext.cc.

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

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

Definition at line 37 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::EventSignalsSentry::EventSignalsSentry(), edm::EventPrincipal::readFromSource_(), edm::UnscheduledCallProducer::tryToFillImpl(), edm::EventPrincipal::unscheduledFill(), and edm::EventSignalsSentry::~EventSignalsSentry().

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

Definition at line 59 of file ModuleCallingContext.cc.

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

Referenced by edm::Worker::doWork(), getGlobalContext(), getStreamContext(), and edm::service::MessageLogger::unEstablishModule().

59  {
60  ModuleCallingContext const* mcc = this;
61  while(mcc->type() == ParentContext::Type::kModule) {
62  mcc = mcc->moduleCallingContext();
63  }
64  if(mcc->type() == ParentContext::Type::kInternal) {
65  mcc = mcc->internalContext()->moduleCallingContext();
66  }
67  while(mcc->type() == ParentContext::Type::kModule) {
68  mcc = mcc->moduleCallingContext();
69  }
70  return mcc;
71  }
ModuleCallingContext(ModuleDescription const *moduleDescription)
GlobalContext const* edm::ModuleCallingContext::globalContext ( ) const
inline

Definition at line 61 of file ModuleCallingContext.h.

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

Referenced by getGlobalContext().

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

Definition at line 62 of file ModuleCallingContext.h.

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

Referenced by depth(), and getTopModuleCallingContext().

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

Definition at line 58 of file ModuleCallingContext.h.

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

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

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

Definition at line 54 of file ModuleCallingContext.h.

References moduleDescription_.

Referenced by DQMEDAnalyzer::beginRun(), edm::Worker::descPtr(), edm::Worker::description(), DQMEDAnalyzer::endLuminosityBlockSummary(), DQMEDAnalyzer::endRunSummary(), edm::service::MessageLogger::establishModule(), edm::service::RandomNumberGeneratorService::getEngine(), edm::service::RandomNumberGeneratorService::mySeed(), edm::operator<<(), edm::SystemTimeKeeper::pauseModuleEvent(), edm::service::EnableFloatingPointExceptions::postActions(), edm::service::Timing::postModule(), edm::service::SimpleMemoryCheck::postModule(), edm::service::Tracer::postModuleBeginStream(), edm::service::MessageLogger::postModuleBeginStream(), edm::service::Tracer::postModuleEndStream(), edm::service::MessageLogger::postModuleEndStream(), FWPathsPopup::postModuleEvent(), TFileService::postModuleEvent(), edm::service::Tracer::postModuleEvent(), FastTimerService::postModuleEvent(), edm::service::Tracer::postModuleEventDelayedGet(), FastTimerService::postModuleEventDelayedGet(), 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::EnableFloatingPointExceptions::preActions(), VariableHelperService::preModule(), edm::service::SimpleMemoryCheck::preModule(), edm::service::Tracer::preModuleBeginStream(), edm::service::MessageLogger::preModuleBeginStream(), edm::service::Tracer::preModuleEndStream(), edm::service::MessageLogger::preModuleEndStream(), FWPathsPopup::preModuleEvent(), TFileService::preModuleEvent(), edm::service::Tracer::preModuleEvent(), FastTimerService::preModuleEvent(), evf::FastMonitoringService::preModuleEvent(), edm::service::Tracer::preModuleEventDelayedGet(), FastTimerService::preModuleEventDelayedGet(), 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::SystemTimeKeeper::restartModuleEvent(), edm::SystemTimeKeeper::startModuleEvent(), and edm::SystemTimeKeeper::stopModuleEvent().

54 { return moduleDescription_; }
ModuleDescription const * moduleDescription_
ParentContext const& edm::ModuleCallingContext::parent ( void  ) const
inline

Definition at line 57 of file ModuleCallingContext.h.

References parent_.

Referenced by BeautifulSoup.PageElement::_invert(), Vispa.Gui.ConnectableWidget.ConnectableWidget::addMenuEntry(), Vispa.Views.LineDecayView.LineDecayContainer::applyFilter(), Vispa.Views.BoxDecayView.BoxDecayContainer::arrangeUsingRelations(), Vispa.Views.BoxDecayView.BoxDecayContainer::autolayoutAlgorithm(), Vispa.Gui.ZoomableScrollableWidgetOwner.ZoomableScrollableWidgetOwner::autosizeScrollArea(), Vispa.Views.BoxDecayView.BoxDecayContainer::autosizeScrollArea(), Vispa.Gui.PortWidget.PortWidget::connectionPoint(), Vispa.Main.StartupScreen.StartupScreen::createDescriptionWidget(), Vispa.Views.BoxDecayView.BoxDecayContainer::dataAccessor(), Vispa.Views.LineDecayView.LineDecayContainer::dataAccessor(), Vispa.Views.LineDecayView.LineDecayContainer::delete(), Vispa.Gui.VispaWidget.VispaWidget::delete(), Vispa.Gui.VispaWidget.VispaWidget::dragWidget(), Vispa.Share.ImageExporter.ImageExporter::exportImageDialog(), Vispa.Gui.VispaWidget.VispaWidget::keyPressEvent(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget::leaveEvent(), Vispa.Gui.PortWidget.PortWidget::moduleParent(), Vispa.Gui.WidgetContainer.WidgetContainer::mouseDoubleClickEvent(), Vispa.Gui.VispaWidget.VispaWidget::mouseDoubleClickEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), Vispa.Views.LineDecayView.ParticleWidget::mousePressEvent(), Vispa.Views.LineDecayView.LineDecayContainer::noDecorationsMode(), Vispa.Views.LineDecayView.LineDecayContainer::operationId(), edm::operator<<(), Vispa.Gui.VispaWidget.VispaWidget::paintEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget::positionizeMenuWidget(), edm::Worker::resetModuleDescription(), Vispa.Views.WidgetView.WidgetView::restoreSelection(), Vispa.Views.WidgetView.WidgetView::select(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), setContext(), Vispa.Views.LineDecayView.LineDecayContainer::sizeHint(), Vispa.Views.LineDecayView.LineDecayContainer::tabController(), Vispa.Views.BoxDecayView.BoxDecayContainer::toggleCollapsed(), Vispa.Views.PropertyView.PropertyView::valueChanged(), Vispa.Views.BoxDecayView.BoxDecayContainer::widgetByObject(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::widgetDoubleClicked(), and Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::widgetDragged().

57 { return parent_; }
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 
)

Definition at line 29 of file ModuleCallingContext.cc.

References parent(), parent_, previousModuleOnThread_, state(), and state_.

30  {
31  state_ = state;
32  parent_ = parent;
33  previousModuleOnThread_ = previousOnThread;
34  }
ParentContext const & parent() const
ModuleCallingContext const * previousModuleOnThread_
void edm::ModuleCallingContext::setState ( State  state)
inline
State edm::ModuleCallingContext::state ( ) const
inline
StreamContext const* edm::ModuleCallingContext::streamContext ( ) const
inline

Definition at line 60 of file ModuleCallingContext.h.

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

Referenced by getStreamContext().

60 { 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 83 of file ModuleCallingContext.h.

Referenced by moduleDescription().

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

Definition at line 82 of file ModuleCallingContext.h.

Referenced by previousModuleOnThread(), and setContext().

State edm::ModuleCallingContext::state_
private

Definition at line 85 of file ModuleCallingContext.h.

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