CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ModuleCallingContext.h
Go to the documentation of this file.
1 #ifndef FWCore_ServiceRegistry_ModuleCallingContext_h
2 #define FWCore_ServiceRegistry_ModuleCallingContext_h
3 
13 //
14 // Original Author: W. David Dagenhart
15 // Created: 7/11/2013
16 
18 
19 #include <iosfwd>
20 
21 namespace edm {
22 
23  class GlobalContext;
24  class InternalContext;
25  class ModuleDescription;
26  class PlaceInPathContext;
27  class StreamContext;
28 
29 
31  public:
32 
34 
35  enum class State {
36  kPrefetching, // prefetching products before starting to run
37  kRunning, // module actually running
38  kInvalid
39  };
40 
42 
44  State state,
45  ParentContext const& parent,
46  ModuleCallingContext const* previousOnThread);
47 
48  void setContext(State state,
49  ParentContext const& parent,
50  ModuleCallingContext const* previousOnThread);
51 
53 
55  State state() const { return state_; }
56  Type type() const { return parent_.type(); }
57  ParentContext const& parent() const { return parent_; }
60  StreamContext const* streamContext() const { return parent_.streamContext(); }
61  GlobalContext const* globalContext() const { return parent_.globalContext(); }
63 
64  // These functions will iterate up a series of linked context objects
65  // to find the StreamContext or GlobalContext at the top of the series.
66  // Throws if the top context object does not have that type.
67  StreamContext const* getStreamContext() const;
68  GlobalContext const* getGlobalContext() const;
69 
70  // This function will iterate up a series of linked context objects to
71  // find the highest level ModuleCallingContext. It will often return a
72  // pointer to itself.
74 
75  // Returns the number of ModuleCallingContexts above this ModuleCallingContext
76  // in the series of linked context objects.
77  unsigned depth() const;
78 
80 
81  private:
86  };
87 
88  std::ostream& operator<<(std::ostream&, ModuleCallingContext const&);
89 }
90 #endif
Type type() const
Definition: ParentContext.h:46
GlobalContext const * globalContext() const
StreamContext const * getStreamContext() const
ModuleCallingContext const * moduleCallingContext() const
ModuleCallingContext const * getTopModuleCallingContext() const
ModuleDescription const * moduleDescription_
InternalContext const * internalContext() const
ModuleCallingContext const * moduleCallingContext() const
void setContext(State state, ParentContext const &parent, ModuleCallingContext const *previousOnThread)
PlaceInPathContext const * placeInPathContext() const
ParentContext const & parent() const
ModuleDescription const * moduleDescription() const
InternalContext const * internalContext() const
StreamContext const * streamContext() const
StreamContext const * streamContext() const
ModuleCallingContext const * previousModuleOnThread() const
ModuleCallingContext(ModuleDescription const *moduleDescription)
State
Definition: hltDiff.cc:286
GlobalContext const * getGlobalContext() const
ModuleCallingContext const * previousModuleOnThread_
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
GlobalContext const * globalContext() const
PlaceInPathContext const * placeInPathContext() const