CMS 3D CMS Logo

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

#include <ParentContext.h>

Classes

union  Parent
 

Public Types

enum  Type {
  Type::kGlobal, Type::kInternal, Type::kModule, Type::kPlaceInPath,
  Type::kStream, Type::kInvalid
}
 

Public Member Functions

GlobalContext const * globalContext () const
 
InternalContext const * internalContext () const
 
bool isAtEndTransition () const
 
ModuleCallingContext const * moduleCallingContext () const
 
 ParentContext ()
 
 ParentContext (GlobalContext const *)
 
 ParentContext (InternalContext const *)
 
 ParentContext (ModuleCallingContext const *)
 
 ParentContext (PlaceInPathContext const *)
 
 ParentContext (StreamContext const *)
 
PlaceInPathContext const * placeInPathContext () const
 
StreamContext const * streamContext () const
 
Type type () const
 

Private Attributes

union edm::ParentContext::Parent parent_
 
Type type_
 

Detailed Description

Description: This is intended to be used as a member of ModuleCallingContext.

Usage:

Definition at line 27 of file ParentContext.h.

Member Enumeration Documentation

◆ Type

Enumerator
kGlobal 
kInternal 
kModule 
kPlaceInPath 
kStream 
kInvalid 

Definition at line 29 of file ParentContext.h.

29 { kGlobal, kInternal, kModule, kPlaceInPath, kStream, kInvalid };

Constructor & Destructor Documentation

◆ ParentContext() [1/6]

edm::ParentContext::ParentContext ( )

Definition at line 15 of file ParentContext.cc.

15 : type_(Type::kInvalid) { parent_.global = nullptr; }

References edm::ParentContext::Parent::global, and parent_.

◆ ParentContext() [2/6]

edm::ParentContext::ParentContext ( GlobalContext const *  global)

Definition at line 17 of file ParentContext.cc.

17 : type_(Type::kGlobal) { parent_.global = global; }

References edm::ParentContext::Parent::global, and parent_.

◆ ParentContext() [3/6]

edm::ParentContext::ParentContext ( InternalContext const *  internal)

Definition at line 19 of file ParentContext.cc.

20  parent_.internal = internal;
21  }

References edm::ParentContext::Parent::internal, and parent_.

◆ ParentContext() [4/6]

edm::ParentContext::ParentContext ( ModuleCallingContext const *  module)

Definition at line 23 of file ParentContext.cc.

23 : type_(Type::kModule) { parent_.module = module; }

References edm::ParentContext::Parent::module, and parent_.

◆ ParentContext() [5/6]

edm::ParentContext::ParentContext ( PlaceInPathContext const *  placeInPath)

Definition at line 25 of file ParentContext.cc.

26  parent_.placeInPath = placeInPath;
27  }

References parent_, and edm::ParentContext::Parent::placeInPath.

◆ ParentContext() [6/6]

edm::ParentContext::ParentContext ( StreamContext const *  stream)

Member Function Documentation

◆ globalContext()

GlobalContext const * edm::ParentContext::globalContext ( ) const

Definition at line 52 of file ParentContext.cc.

52  {
53  if (type_ != Type::kGlobal) {
54  throw Exception(errors::LogicError) << "ParentContext::globalContext called for incorrect type of context";
55  }
56  return parent_.global;
57  }

References Exception, edm::ParentContext::Parent::global, kGlobal, edm::errors::LogicError, parent_, and type_.

Referenced by edm::ModuleCallingContext::globalContext(), and edm::operator<<().

◆ internalContext()

InternalContext const * edm::ParentContext::internalContext ( ) const

Definition at line 59 of file ParentContext.cc.

59  {
60  if (type_ != Type::kInternal) {
61  throw Exception(errors::LogicError) << "ParentContext::internalContext called for incorrect type of context";
62  }
63  return parent_.internal;
64  }

References Exception, edm::ParentContext::Parent::internal, kInternal, edm::errors::LogicError, parent_, and type_.

Referenced by edm::ModuleCallingContext::internalContext(), and edm::operator<<().

◆ isAtEndTransition()

bool edm::ParentContext::isAtEndTransition ( ) const

◆ moduleCallingContext()

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

Definition at line 31 of file ParentContext.cc.

31  {
32  if (type_ != Type::kModule) {
33  throw Exception(errors::LogicError) << "ParentContext::moduleCallingContext called for incorrect type of context";
34  }
35  return parent_.module;
36  }

References Exception, kModule, edm::errors::LogicError, edm::ParentContext::Parent::module, parent_, and type_.

Referenced by edm::ModuleCallingContext::moduleCallingContext(), and edm::operator<<().

◆ placeInPathContext()

PlaceInPathContext const * edm::ParentContext::placeInPathContext ( ) const

Definition at line 38 of file ParentContext.cc.

38  {
39  if (type_ != Type::kPlaceInPath) {
40  throw Exception(errors::LogicError) << "ParentContext::placeInPathContext called for incorrect type of context";
41  }
42  return parent_.placeInPath;
43  }

References Exception, kPlaceInPath, edm::errors::LogicError, parent_, edm::ParentContext::Parent::placeInPath, and type_.

Referenced by edm::operator<<(), and edm::ModuleCallingContext::placeInPathContext().

◆ streamContext()

StreamContext const * edm::ParentContext::streamContext ( ) const

Definition at line 45 of file ParentContext.cc.

45  {
46  if (type_ != Type::kStream) {
47  throw Exception(errors::LogicError) << "ParentContext::streamContext called for incorrect type of context";
48  }
49  return parent_.stream;
50  }

References Exception, kStream, edm::errors::LogicError, parent_, edm::ParentContext::Parent::stream, and type_.

Referenced by edm::operator<<(), and edm::ModuleCallingContext::streamContext().

◆ type()

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

Definition at line 38 of file ParentContext.h.

38 { return type_; }

References type_.

Referenced by edm::operator<<(), and edm::ModuleCallingContext::type().

Member Data Documentation

◆ parent_

union edm::ParentContext::Parent edm::ParentContext::parent_
private

◆ type_

Type edm::ParentContext::type_
private
edm::ParentContext::Parent::internal
InternalContext const * internal
Definition: ParentContext.h:53
edm::PathContext::streamContext
StreamContext const * streamContext() const
Definition: PathContext.h:31
edm::errors::LogicError
Definition: EDMException.h:37
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
edm::PlaceInPathContext::pathContext
PathContext const * pathContext() const
Definition: PlaceInPathContext.h:24
edm::ParentContext::Type::kStream
edm::ParentContext::Type::kGlobal
edm::ParentContext::Parent::module
ModuleCallingContext const * module
Definition: ParentContext.h:54
edm::ParentContext::Type::kPlaceInPath
edm::ParentContext::Parent::stream
StreamContext const * stream
Definition: ParentContext.h:56
edm::ModuleCallingContext::parent
ParentContext const & parent() const
Definition: ModuleCallingContext.h:53
edm::ParentContext::Parent::global
GlobalContext const * global
Definition: ParentContext.h:52
edm::StreamContext::isAtEndTransition
bool isAtEndTransition() const
Definition: StreamContext.h:56
edm::ParentContext::Type::kInternal
edm::ParentContext::Type::kModule
edm::GlobalContext::isAtEndTransition
bool isAtEndTransition() const
Definition: GlobalContext.h:54
edm::ParentContext::Parent::placeInPath
PlaceInPathContext const * placeInPath
Definition: ParentContext.h:55
Exception
Definition: hltDiff.cc:246
edm::ParentContext::Type::kInvalid
edm::ParentContext::parent_
union edm::ParentContext::Parent parent_
edm::ParentContext::isAtEndTransition
bool isAtEndTransition() const
Definition: ParentContext.cc:66
edm::ParentContext::type_
Type type_
Definition: ParentContext.h:49