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 noexcept(false)
 
InternalContext const * internalContext () const noexcept(false)
 
bool isAtEndTransition () const noexcept
 
ModuleCallingContext const * moduleCallingContext () const noexcept(false)
 
 ParentContext () noexcept
 
 ParentContext (GlobalContext const *) noexcept
 
 ParentContext (InternalContext const *) noexcept
 
 ParentContext (ModuleCallingContext const *) noexcept
 
 ParentContext (PlaceInPathContext const *) noexcept
 
 ParentContext (StreamContext const *) noexcept
 
PlaceInPathContext const * placeInPathContext () const noexcept(false)
 
StreamContext const * streamContext () const noexcept(false)
 
Type type () const noexcept
 

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 ( )
noexcept

Definition at line 15 of file ParentContext.cc.

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

15 : type_(Type::kInvalid) { parent_.global = nullptr; }
union edm::ParentContext::Parent parent_
GlobalContext const * global
Definition: ParentContext.h:52

◆ ParentContext() [2/6]

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

Definition at line 17 of file ParentContext.cc.

17 : type_(Type::kGlobal) { parent_.global = global; }
union edm::ParentContext::Parent parent_
GlobalContext const * global
Definition: ParentContext.h:52

◆ ParentContext() [3/6]

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

Definition at line 19 of file ParentContext.cc.

20  parent_.internal = internal;
21  }
union edm::ParentContext::Parent parent_
InternalContext const * internal
Definition: ParentContext.h:53

◆ ParentContext() [4/6]

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

Definition at line 23 of file ParentContext.cc.

References callgraph::module.

23  : type_(Type::kModule) {
25  }
ModuleCallingContext const * module
Definition: ParentContext.h:54
union edm::ParentContext::Parent parent_

◆ ParentContext() [5/6]

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

Definition at line 27 of file ParentContext.cc.

28  parent_.placeInPath = placeInPath;
29  }
union edm::ParentContext::Parent parent_
PlaceInPathContext const * placeInPath
Definition: ParentContext.h:55

◆ ParentContext() [6/6]

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

Definition at line 31 of file ParentContext.cc.

References cms::cuda::stream.

union edm::ParentContext::Parent parent_
StreamContext const * stream
Definition: ParentContext.h:56
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream

Member Function Documentation

◆ globalContext()

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

◆ internalContext()

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

Definition at line 61 of file ParentContext.cc.

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

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

61  {
62  if (type_ != Type::kInternal) {
63  throw Exception(errors::LogicError) << "ParentContext::internalContext called for incorrect type of context";
64  }
65  return parent_.internal;
66  }
union edm::ParentContext::Parent parent_
InternalContext const * internal
Definition: ParentContext.h:53

◆ isAtEndTransition()

bool edm::ParentContext::isAtEndTransition ( ) const
noexcept

Definition at line 68 of file ParentContext.cc.

References edm::ParentContext::Parent::global, isAtEndTransition(), edm::StreamContext::isAtEndTransition(), edm::GlobalContext::isAtEndTransition(), kGlobal, kModule, kPlaceInPath, kStream, edm::ParentContext::Parent::module, edm::ModuleCallingContext::parent(), parent_, edm::PlaceInPathContext::pathContext(), edm::ParentContext::Parent::placeInPath, edm::ParentContext::Parent::stream, edm::PathContext::streamContext(), and type_.

Referenced by isAtEndTransition(), edm::PuttableProductResolver::prefetchAsync_(), and edm::SwitchProducerProductResolver::prefetchAsync_().

68  {
69  switch (type_) {
70  case Type::kGlobal: {
72  }
73  case Type::kModule: {
75  }
76  case Type::kStream: {
78  }
79  case Type::kPlaceInPath: {
81  }
82  default:
83  break;
84  }
85  return false;
86  }
ModuleCallingContext const * module
Definition: ParentContext.h:54
union edm::ParentContext::Parent parent_
StreamContext const * stream
Definition: ParentContext.h:56
StreamContext const * streamContext() const
Definition: PathContext.h:31
bool isAtEndTransition() const noexcept
PlaceInPathContext const * placeInPath
Definition: ParentContext.h:55
bool isAtEndTransition() const
Definition: StreamContext.h:57
bool isAtEndTransition() const
Definition: GlobalContext.h:60
ParentContext const & parent() const noexcept
PathContext const * pathContext() const
GlobalContext const * global
Definition: ParentContext.h:52

◆ moduleCallingContext()

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

Definition at line 33 of file ParentContext.cc.

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

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

33  {
34  if (type_ != Type::kModule) {
35  throw Exception(errors::LogicError) << "ParentContext::moduleCallingContext called for incorrect type of context";
36  }
37  return parent_.module;
38  }
ModuleCallingContext const * module
Definition: ParentContext.h:54
union edm::ParentContext::Parent parent_

◆ placeInPathContext()

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

Definition at line 40 of file ParentContext.cc.

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

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

40  {
41  if (type_ != Type::kPlaceInPath) {
42  throw Exception(errors::LogicError) << "ParentContext::placeInPathContext called for incorrect type of context";
43  }
44  return parent_.placeInPath;
45  }
union edm::ParentContext::Parent parent_
PlaceInPathContext const * placeInPath
Definition: ParentContext.h:55

◆ streamContext()

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

Definition at line 47 of file ParentContext.cc.

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

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

47  {
48  if (type_ != Type::kStream) {
49  throw Exception(errors::LogicError) << "ParentContext::streamContext called for incorrect type of context";
50  }
51  return parent_.stream;
52  }
union edm::ParentContext::Parent parent_
StreamContext const * stream
Definition: ParentContext.h:56

◆ type()

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

Definition at line 38 of file ParentContext.h.

References type_.

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

38 { return type_; }

Member Data Documentation

◆ parent_

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

◆ type_

Type edm::ParentContext::type_
private