CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::RefProd< C > Class Template Reference

#include <EDProductfwd.h>

Public Types

typedef C product_type
 
typedef C value_type
 

Public Member Functions

product_type const * get () const
 
bool hasCache () const
 Checks if product is in memory. More...
 
bool hasProductCache () const
 Checks if product is in memory. More...
 
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 RefProd is transient (i.e. not persistable). More...
 
bool operator! () const
 Checks for null. More...
 
product_type const & operator* () const
 Dereference operator. More...
 
product_type const * operator-> () const
 Member dereference operator. More...
 
product_type const * product () const
 
EDProductGetter const * productGetter () const
 Accessor for product getter. More...
 
RefCore const & refCore () const
 
 RefProd ()
 Default constructor needed for reading from persistent store. Not for direct use. More...
 
 RefProd (Handle< C > const &handle)
 General purpose constructor from handle. More...
 
 RefProd (OrphanHandle< C > const &handle)
 General purpose constructor from orphan handle. More...
 
 RefProd (C const *iProduct)
 Constructor for ref to object that is not in an event. More...
 
 RefProd (TestHandle< C > const &handle)
 General purpose constructor from test handle. More...
 
 RefProd (ProductID const &productID, EDProductGetter const *prodGetter)
 
void swap (RefProd< C > &)
 
 ~RefProd ()
 Destructor. More...
 

Static Public Member Functions

static short Class_Version ()
 

Private Member Functions

void checkTypeAtCompileTime (C const *)
 

Private Attributes

RefCore product_
 

Detailed Description

template<typename C>
class edm::RefProd< C >

Definition at line 25 of file EDProductfwd.h.

Member Typedef Documentation

◆ product_type

template<typename C>
typedef C edm::RefProd< C >::product_type

Definition at line 57 of file RefProd.h.

◆ value_type

template<typename C>
typedef C edm::RefProd< C >::value_type

Definition at line 58 of file RefProd.h.

Constructor & Destructor Documentation

◆ RefProd() [1/6]

template<typename C>
edm::RefProd< C >::RefProd ( )
inline

Default constructor needed for reading from persistent store. Not for direct use.

Definition at line 61 of file RefProd.h.

61 : product_() {}
RefCore product_
Definition: RefProd.h:154

◆ RefProd() [2/6]

template<typename C>
edm::RefProd< C >::RefProd ( Handle< C > const &  handle)
inlineexplicit

General purpose constructor from handle.

Definition at line 64 of file RefProd.h.

64  : product_(handle.id(), handle.product(), nullptr, false) {
65  checkTypeAtCompileTime(handle.product());
66  }
void checkTypeAtCompileTime(C const *)
Definition: RefProd.h:152
RefCore product_
Definition: RefProd.h:154

◆ RefProd() [3/6]

template<typename C>
edm::RefProd< C >::RefProd ( OrphanHandle< C > const &  handle)
inlineexplicit

General purpose constructor from orphan handle.

Definition at line 69 of file RefProd.h.

69  : product_(handle.id(), handle.product(), nullptr, false) {
70  checkTypeAtCompileTime(handle.product());
71  }
void checkTypeAtCompileTime(C const *)
Definition: RefProd.h:152
RefCore product_
Definition: RefProd.h:154

◆ RefProd() [4/6]

template<typename C>
edm::RefProd< C >::RefProd ( C const *  iProduct)
inline

Constructor for ref to object that is not in an event.

Definition at line 78 of file RefProd.h.

78 : product_(ProductID(), iProduct, nullptr, true) { checkTypeAtCompileTime(iProduct); }
void checkTypeAtCompileTime(C const *)
Definition: RefProd.h:152
RefCore product_
Definition: RefProd.h:154

◆ RefProd() [5/6]

template<typename C>
edm::RefProd< C >::RefProd ( TestHandle< C > const &  handle)
inlineexplicit

General purpose constructor from test handle.

Definition at line 85 of file RefProd.h.

85  : product_(handle.id(), handle.product(), nullptr, true) {
86  checkTypeAtCompileTime(handle.product());
87  }
void checkTypeAtCompileTime(C const *)
Definition: RefProd.h:152
RefCore product_
Definition: RefProd.h:154

◆ RefProd() [6/6]

template<typename C>
edm::RefProd< C >::RefProd ( ProductID const &  productID,
EDProductGetter const *  prodGetter 
)
inline

Definition at line 92 of file RefProd.h.

93  : product_(productID, nullptr, mustBeNonZero(prodGetter, "RefProd", productID), false) {}
EDProductGetter const * mustBeNonZero(EDProductGetter const *prodGetter, std::string refType, ProductID const &productID)
RefCore product_
Definition: RefProd.h:154

◆ ~RefProd()

template<typename C>
edm::RefProd< C >::~RefProd ( )
inline

Destructor.

Definition at line 96 of file RefProd.h.

96 {}

Member Function Documentation

◆ checkTypeAtCompileTime()

template<typename C>
void edm::RefProd< C >::checkTypeAtCompileTime ( C const *  )
inlineprivate

Definition at line 152 of file RefProd.h.

Referenced by edm::RefProd< Phase2TrackerCluster1Ds >::RefProd().

152 {}

◆ Class_Version()

template<typename C>
static short edm::RefProd< C >::Class_Version ( )
inlinestatic

Definition at line 147 of file RefProd.h.

149 :
150  // Compile time check that the argument is a C* or C const*

◆ get()

template<typename C>
product_type const* edm::RefProd< C >::get ( ) const
inline

◆ hasCache()

template<typename C>
bool edm::RefProd< C >::hasCache ( ) const
inline

Checks if product is in memory.

Definition at line 130 of file RefProd.h.

Referenced by edm::RefProd< Phase2TrackerCluster1Ds >::hasProductCache().

130 { return product_.productPtr() != nullptr; }
void const * productPtr() const
Definition: RefCore.h:51
RefCore product_
Definition: RefProd.h:154

◆ hasProductCache()

template<typename C>
bool edm::RefProd< C >::hasProductCache ( ) const
inline

Checks if product is in memory.

Definition at line 133 of file RefProd.h.

133 { return hasCache(); }
bool hasCache() const
Checks if product is in memory.
Definition: RefProd.h:130

◆ id()

template<typename C>
ProductID edm::RefProd< C >::id ( ) const
inline

◆ isAvailable()

template<typename C>
bool edm::RefProd< C >::isAvailable ( ) const
inline

Checks if collection is in memory or available in the Event. No type checking is done. This function is potentially costly as it might cause a disk read (note that it does not cause the data to be cached locally)

Definition at line 139 of file RefProd.h.

139 { return product_.isAvailable(); }
bool isAvailable() const
Definition: RefCore.cc:146
RefCore product_
Definition: RefProd.h:154

◆ isNonnull()

template<typename C>
bool edm::RefProd< C >::isNonnull ( ) const
inline

◆ isNull()

template<typename C>
bool edm::RefProd< C >::isNull ( ) const
inline

◆ isTransient()

template<typename C>
bool edm::RefProd< C >::isTransient ( ) const
inline

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

Definition at line 142 of file RefProd.h.

142 { return product_.isTransient(); }
bool isTransient() const
Definition: RefCore.h:105
RefCore product_
Definition: RefProd.h:154

◆ operator!()

template<typename C>
bool edm::RefProd< C >::operator! ( ) const
inline

Checks for null.

Definition at line 121 of file RefProd.h.

121 { return isNull(); }
bool isNull() const
Checks for null.
Definition: RefProd.h:115

◆ operator*()

template<typename C >
C const & edm::RefProd< C >::operator* ( ) const
inline

Dereference operator.

Definition at line 164 of file RefProd.h.

164  {
165  return *(edm::template getProduct<C>(product_));
166  }
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:521
RefCore product_
Definition: RefProd.h:154

◆ operator->()

template<typename C >
C const * edm::RefProd< C >::operator-> ( ) const
inline

Member dereference operator.

Definition at line 170 of file RefProd.h.

Referenced by edm::RefProd< Phase2TrackerCluster1Ds >::get(), and edm::RefProd< Phase2TrackerCluster1Ds >::product().

170  {
171  return edm::template getProduct<C>(product_);
172  }
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:521
RefCore product_
Definition: RefProd.h:154

◆ product()

template<typename C>
product_type const* edm::RefProd< C >::product ( ) const
inline

Returns C++ pointer to the product Will attempt to retrieve product

Definition at line 110 of file RefProd.h.

Referenced by edm::ContainerMask< T >::ContainerMask(), edm::ContainerMask< T >::mask(), and edm::RefToBaseProd< T >::RefToBaseProd().

110 { return isNull() ? nullptr : this->operator->(); }
product_type const * operator->() const
Member dereference operator.
Definition: RefProd.h:170
bool isNull() const
Checks for null.
Definition: RefProd.h:115

◆ productGetter()

template<typename C>
EDProductGetter const* edm::RefProd< C >::productGetter ( ) const
inline

Accessor for product getter.

Definition at line 127 of file RefProd.h.

127 { return product_.productGetter(); }
RefCore product_
Definition: RefProd.h:154
EDProductGetter const * productGetter() const
Definition: RefCore.h:81

◆ refCore()

template<typename C>
RefCore const& edm::RefProd< C >::refCore ( ) const
inline

Definition at line 112 of file RefProd.h.

Referenced by edm::Ref< L1GctEmCandCollection >::Ref(), and edm::RefToBaseProd< T >::RefToBaseProd().

112 { return product_; }
RefCore product_
Definition: RefProd.h:154

◆ swap()

template<typename C>
void edm::RefProd< C >::swap ( RefProd< C > &  other)
inline

Definition at line 175 of file RefProd.h.

Referenced by edm::ContainerMask< T >::swap(), edm::Association< C >::swap(), and reco::ClusterRemovalInfo::swap().

175  {
176  edm::swap(product_, other.product_);
177  }
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
RefCore product_
Definition: RefProd.h:154

Member Data Documentation

◆ product_

template<typename C>
RefCore edm::RefProd< C >::product_
private