CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Friends
edm::FwdPtr< T > Class Template Reference

#include <DataFormats/Common/interface/FwdPtr.h>

Public Types

typedef unsigned long key_type
 
typedef T value_type
 

Public Member Functions

Ptr< value_type > const & backPtr () const
 
template<typename C >
 FwdPtr (const Ptr< C > &f, const Ptr< C > &b)
 
 FwdPtr ()
 
T const * get () const
 Returns C++ pointer to the item. More...
 
bool hasProductCache () const
 
ProductID id () const
 Accessor for product ID. More...
 
bool isAvailable () const
 
bool isNonnull () const
 Checks for non-null. More...
 
bool isNull () const
 Checks for null. More...
 
bool isTransient () const
 Checks if this FwdPtr is transient (i.e. not persistable). More...
 
key_type key () const
 
bool operator! () const
 Checks for null. More...
 
T const & operator* () const
 Dereference operator. More...
 
T const * operator-> () const
 Member dereference operator. More...
 
void const * product () const
 
EDProductGetter const * productGetter () const
 Accessor for product getter. More...
 
Ptr< value_type > const & ptr () const
 
RefCore const & refCore () const
 
 ~FwdPtr ()
 Destructor. More...
 

Static Public Member Functions

static short Class_Version ()
 

Private Attributes

Ptr< value_typebackPtr_
 
Ptr< value_typeptr_
 

Friends

class FwdPtrVectorBase
 

Detailed Description

template<typename T>
class edm::FwdPtr< T >

Description: Persistent 'pointer' to an item in a collection where the collection is in the edm::Event

Usage: <usage>

Definition at line 40 of file FwdPtr.h.

Member Typedef Documentation

◆ key_type

template<typename T>
typedef unsigned long edm::FwdPtr< T >::key_type

Definition at line 44 of file FwdPtr.h.

◆ value_type

template<typename T>
typedef T edm::FwdPtr< T >::value_type

Definition at line 45 of file FwdPtr.h.

Constructor & Destructor Documentation

◆ FwdPtr() [1/2]

template<typename T>
template<typename C >
edm::FwdPtr< T >::FwdPtr ( const Ptr< C > &  f,
const Ptr< C > &  b 
)
inline

Definition at line 49 of file FwdPtr.h.

References cms::cuda::assert(), b, and f.

49  : ptr_(f), backPtr_(b) {
50  assert(f.isNull() == b.isNull());
51  }
assert(be >=bs)
double f[11][100]
double b
Definition: hdecay.h:118
Ptr< value_type > ptr_
Definition: FwdPtr.h:123
Ptr< value_type > backPtr_
Definition: FwdPtr.h:124

◆ FwdPtr() [2/2]

template<typename T>
edm::FwdPtr< T >::FwdPtr ( )
inline

Definition at line 53 of file FwdPtr.h.

53 : ptr_(), backPtr_() {}
Ptr< value_type > ptr_
Definition: FwdPtr.h:123
Ptr< value_type > backPtr_
Definition: FwdPtr.h:124

◆ ~FwdPtr()

template<typename T>
edm::FwdPtr< T >::~FwdPtr ( )
inline

Destructor.

Definition at line 67 of file FwdPtr.h.

67 {}

Member Function Documentation

◆ backPtr()

template<typename T>
Ptr<value_type> const& edm::FwdPtr< T >::backPtr ( ) const
inline

Definition at line 117 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_.

Referenced by TopProjectorFwdPtrOverlap< Top, Bottom >::operator()().

117 { return backPtr_; }
Ptr< value_type > backPtr_
Definition: FwdPtr.h:124

◆ Class_Version()

template<typename T>
static short edm::FwdPtr< T >::Class_Version ( )
inlinestatic

Definition at line 120 of file FwdPtr.h.

122 :
123  Ptr<value_type> ptr_;
Ptr< value_type > ptr_
Definition: FwdPtr.h:123

◆ get()

template<typename T>
T const* edm::FwdPtr< T >::get ( ) const
inline

◆ hasProductCache()

template<typename T>
bool edm::FwdPtr< T >::hasProductCache ( ) const
inline

Definition at line 109 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::hasProductCache(), and edm::FwdPtr< T >::ptr_.

109 { return ptr_.hasProductCache() || backPtr_.hasProductCache(); }
bool hasProductCache() const
Definition: Ptr.h:165
Ptr< value_type > ptr_
Definition: FwdPtr.h:123
Ptr< value_type > backPtr_
Definition: FwdPtr.h:124

◆ id()

template<typename T>
ProductID edm::FwdPtr< T >::id ( ) const
inline

Accessor for product ID.

Definition at line 95 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::id(), edm::Ptr< T >::isNonnull(), and edm::FwdPtr< T >::ptr_.

95 { return ptr_.isNonnull() ? ptr_.id() : backPtr_.id(); }
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:158
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
Ptr< value_type > ptr_
Definition: FwdPtr.h:123
Ptr< value_type > backPtr_
Definition: FwdPtr.h:124

◆ isAvailable()

template<typename T>
bool edm::FwdPtr< T >::isAvailable ( ) const
inline

Checks if collection is in memory or available in the event. No type checking is done.

Definition at line 89 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::isAvailable(), and edm::FwdPtr< T >::ptr_.

89 { return ptr_.isAvailable() || backPtr_.isAvailable(); }
bool isAvailable() const
Definition: Ptr.h:230
Ptr< value_type > ptr_
Definition: FwdPtr.h:123
Ptr< value_type > backPtr_
Definition: FwdPtr.h:124

◆ isNonnull()

template<typename T>
bool edm::FwdPtr< T >::isNonnull ( ) const
inline

Checks for non-null.

Definition at line 83 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::isNonnull(), and edm::FwdPtr< T >::ptr_.

Referenced by edm::FwdPtr< T >::isNull().

83 { return ptr_.isNonnull() || backPtr_.isNonnull(); }
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
Ptr< value_type > ptr_
Definition: FwdPtr.h:123
Ptr< value_type > backPtr_
Definition: FwdPtr.h:124

◆ isNull()

template<typename T>
bool edm::FwdPtr< T >::isNull ( ) const
inline

Checks for null.

Definition at line 79 of file FwdPtr.h.

References edm::FwdPtr< T >::isNonnull().

Referenced by edm::FwdPtr< T >::operator!().

79 { return !isNonnull(); }
bool isNonnull() const
Checks for non-null.
Definition: FwdPtr.h:83

◆ isTransient()

template<typename T>
bool edm::FwdPtr< T >::isTransient ( ) const
inline

Checks if this FwdPtr is transient (i.e. not persistable).

Definition at line 92 of file FwdPtr.h.

References edm::Ptr< T >::isTransient(), and edm::FwdPtr< T >::ptr_.

92 { return ptr_.isTransient(); }
Ptr< value_type > ptr_
Definition: FwdPtr.h:123
bool isTransient() const
Checks if this Ptr is transient (i.e. not persistable).
Definition: Ptr.h:155

◆ key()

template<typename T>
key_type edm::FwdPtr< T >::key ( ) const
inline

Definition at line 107 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::isNonnull(), edm::Ptr< T >::key(), and edm::FwdPtr< T >::ptr_.

107 { return ptr_.isNonnull() ? ptr_.key() : backPtr_.key(); }
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
key_type key() const
Definition: Ptr.h:163
Ptr< value_type > ptr_
Definition: FwdPtr.h:123
Ptr< value_type > backPtr_
Definition: FwdPtr.h:124

◆ operator!()

template<typename T>
bool edm::FwdPtr< T >::operator! ( ) const
inline

Checks for null.

Definition at line 85 of file FwdPtr.h.

References edm::FwdPtr< T >::isNull().

85 { return isNull(); }
bool isNull() const
Checks for null.
Definition: FwdPtr.h:79

◆ operator*()

template<typename T>
T const& edm::FwdPtr< T >::operator* ( ) const
inline

Dereference operator.

Definition at line 70 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::isAvailable(), and edm::FwdPtr< T >::ptr_.

70 { return ptr_.isAvailable() ? ptr_.operator*() : backPtr_.operator*(); }
bool isAvailable() const
Definition: Ptr.h:230
Ptr< value_type > ptr_
Definition: FwdPtr.h:123
Ptr< value_type > backPtr_
Definition: FwdPtr.h:124

◆ operator->()

template<typename T>
T const* edm::FwdPtr< T >::operator-> ( ) const
inline

Member dereference operator.

Definition at line 73 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::isAvailable(), and edm::FwdPtr< T >::ptr_.

73 { return ptr_.isAvailable() ? ptr_.operator->() : backPtr_.operator->(); }
bool isAvailable() const
Definition: Ptr.h:230
Ptr< value_type > ptr_
Definition: FwdPtr.h:123
Ptr< value_type > backPtr_
Definition: FwdPtr.h:124

◆ product()

template<typename T>
void const* edm::FwdPtr< T >::product ( ) const
inline

Definition at line 114 of file FwdPtr.h.

114 { return nullptr; }

◆ productGetter()

template<typename T>
EDProductGetter const* edm::FwdPtr< T >::productGetter ( ) const
inline

Accessor for product getter.

Definition at line 98 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::productGetter(), and edm::FwdPtr< T >::ptr_.

98  {
99  //another thread might cause productGetter() to change its value
100  EDProductGetter const* getter = ptr_.productGetter();
101  if (getter)
102  return getter;
103  else
104  return backPtr_.productGetter();
105  }
EDProductGetter const * productGetter() const
Accessor for product getter.
Definition: Ptr.h:161
Ptr< value_type > ptr_
Definition: FwdPtr.h:123
Ptr< value_type > backPtr_
Definition: FwdPtr.h:124

◆ ptr()

template<typename T>
Ptr<value_type> const& edm::FwdPtr< T >::ptr ( ) const
inline

Definition at line 116 of file FwdPtr.h.

References edm::FwdPtr< T >::ptr_.

Referenced by TopProjectorFwdPtrOverlap< Top, Bottom >::operator()().

116 { return ptr_; }
Ptr< value_type > ptr_
Definition: FwdPtr.h:123

◆ refCore()

template<typename T>
RefCore const& edm::FwdPtr< T >::refCore ( ) const
inline

Definition at line 111 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::isNonnull(), edm::FwdPtr< T >::ptr_, and edm::Ptr< T >::refCore().

111 { return ptr_.isNonnull() ? ptr_.refCore() : backPtr_.refCore(); }
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
RefCore const & refCore() const
Definition: Ptr.h:167
Ptr< value_type > ptr_
Definition: FwdPtr.h:123
Ptr< value_type > backPtr_
Definition: FwdPtr.h:124

Friends And Related Function Documentation

◆ FwdPtrVectorBase

template<typename T>
friend class FwdPtrVectorBase
friend

Definition at line 41 of file FwdPtr.h.

Member Data Documentation

◆ backPtr_

template<typename T>
Ptr<value_type> edm::FwdPtr< T >::backPtr_
private

◆ ptr_

template<typename T>
Ptr<value_type> edm::FwdPtr< T >::ptr_
private