CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::RefProd< T > 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 T>
class edm::RefProd< T >

Definition at line 23 of file EDProductfwd.h.

Member Typedef Documentation

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

Definition at line 57 of file RefProd.h.

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

Definition at line 58 of file RefProd.h.

Constructor & Destructor Documentation

template<typename T>
edm::RefProd< T >::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:165
template<typename T>
edm::RefProd< T >::RefProd ( Handle< C > const &  handle)
inlineexplicit

General purpose constructor from handle.

Definition at line 64 of file RefProd.h.

64  :
65  product_(handle.id(), handle.product(), 0, false) {
66  checkTypeAtCompileTime(handle.product());
67  }
void checkTypeAtCompileTime(C const *)
Definition: RefProd.h:163
RefCore product_
Definition: RefProd.h:165
template<typename T>
edm::RefProd< T >::RefProd ( OrphanHandle< C > const &  handle)
inlineexplicit

General purpose constructor from orphan handle.

Definition at line 70 of file RefProd.h.

70  :
71  product_(handle.id(), handle.product(), 0, false) {
72  checkTypeAtCompileTime(handle.product());
73  }
void checkTypeAtCompileTime(C const *)
Definition: RefProd.h:163
tuple handle
Definition: patZpeak.py:22
RefCore product_
Definition: RefProd.h:165
template<typename T>
edm::RefProd< T >::RefProd ( C const *  iProduct)
inline

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

Definition at line 80 of file RefProd.h.

80  :
81  product_(ProductID(), iProduct, 0, true) {
82  checkTypeAtCompileTime(iProduct);
83  }
void checkTypeAtCompileTime(C const *)
Definition: RefProd.h:163
RefCore product_
Definition: RefProd.h:165
template<typename T>
edm::RefProd< T >::RefProd ( TestHandle< C > const &  handle)
inlineexplicit

General purpose constructor from test handle.

Definition at line 90 of file RefProd.h.

90  :
91  product_(handle.id(), handle.product(), 0, true) {
92  checkTypeAtCompileTime(handle.product());
93  }
void checkTypeAtCompileTime(C const *)
Definition: RefProd.h:163
tuple handle
Definition: patZpeak.py:22
RefCore product_
Definition: RefProd.h:165
template<typename T>
edm::RefProd< T >::RefProd ( ProductID const &  productID,
EDProductGetter const *  prodGetter 
)
inline

Definition at line 98 of file RefProd.h.

98  :
99  product_(productID, 0, mustBeNonZero(prodGetter, "RefProd", productID), false) {
100  }
EDProductGetter const * mustBeNonZero(EDProductGetter const *prodGetter, std::string refType, ProductID const &productID)
RefCore product_
Definition: RefProd.h:165
template<typename T>
edm::RefProd< T >::~RefProd ( )
inline

Destructor.

Definition at line 103 of file RefProd.h.

103 {}

Member Function Documentation

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

Definition at line 163 of file RefProd.h.

Referenced by edm::RefProd< reco::CastorEgammaCollection >::RefProd().

163 {}
template<typename T>
static short edm::RefProd< T >::Class_Version ( )
inlinestatic

Definition at line 158 of file RefProd.h.

160 :
161  // Compile time check that the argument is a C* or C const*
template<typename T>
product_type const* edm::RefProd< T >::get ( ) const
inline
template<typename T>
bool edm::RefProd< T >::hasCache ( ) const
inline

Checks if product is in memory.

Definition at line 143 of file RefProd.h.

Referenced by edm::RefProd< reco::CastorEgammaCollection >::hasProductCache().

143 {return product_.productPtr() != 0;}
void const * productPtr() const
Definition: RefCore.h:52
RefCore product_
Definition: RefProd.h:165
template<typename T>
bool edm::RefProd< T >::hasProductCache ( ) const
inline

Checks if product is in memory.

Definition at line 146 of file RefProd.h.

146 {return hasCache();}
bool hasCache() const
Checks if product is in memory.
Definition: RefProd.h:143
template<typename T>
ProductID edm::RefProd< T >::id ( ) const
inline
template<typename T>
bool edm::RefProd< T >::isAvailable ( ) const
inline

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

Definition at line 150 of file RefProd.h.

150 {return product_.isAvailable();}
bool isAvailable() const
Definition: RefCore.cc:169
RefCore product_
Definition: RefProd.h:165
template<typename T>
bool edm::RefProd< T >::isNonnull ( ) const
inline

Checks for non-null.

Definition at line 131 of file RefProd.h.

Referenced by reco::ClusterRemovalInfo::hasPixel(), reco::ClusterRemovalInfo::hasStrip(), and edm::RefProd< reco::CastorEgammaCollection >::isNull().

131 {return product_.isNonnull();}
bool isNonnull() const
Definition: RefCore.h:74
RefCore product_
Definition: RefProd.h:165
template<typename T>
bool edm::RefProd< T >::isNull ( ) const
inline
template<typename T>
bool edm::RefProd< T >::isTransient ( ) const
inline

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

Definition at line 153 of file RefProd.h.

153 {return product_.isTransient();}
RefCore product_
Definition: RefProd.h:165
bool isTransient() const
Definition: RefCore.h:106
template<typename T>
bool edm::RefProd< T >::operator! ( ) const
inline

Checks for null.

Definition at line 134 of file RefProd.h.

134 {return isNull();}
bool isNull() const
Checks for null.
Definition: RefProd.h:128
template<typename C >
C const & edm::RefProd< C >::operator* ( ) const
inline

Dereference operator.

Definition at line 176 of file RefProd.h.

References svgfig::template().

176  {
177  return *(edm::template getProduct<C>(product_));
178  }
RefCore product_
Definition: RefProd.h:165
def template
Definition: svgfig.py:520
template<typename C >
C const * edm::RefProd< C >::operator-> ( ) const
inline

Member dereference operator.

Definition at line 183 of file RefProd.h.

References svgfig::template().

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

183  {
184  return edm::template getProduct<C>(product_);
185  }
RefCore product_
Definition: RefProd.h:165
def template
Definition: svgfig.py:520
template<typename T>
product_type const* edm::RefProd< T >::product ( ) const
inline

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

Definition at line 119 of file RefProd.h.

Referenced by edm::RefToBaseProd< T >::RefToBaseProd().

119  {
120  return isNull() ? 0 : this->operator->();
121  }
bool isNull() const
Checks for null.
Definition: RefProd.h:128
product_type const * operator->() const
Member dereference operator.
Definition: RefProd.h:183
template<typename T>
EDProductGetter const* edm::RefProd< T >::productGetter ( ) const
inline

Accessor for product getter.

Definition at line 140 of file RefProd.h.

Referenced by BoostedJetMerger::produce().

140 {return product_.productGetter();}
RefCore product_
Definition: RefProd.h:165
EDProductGetter const * productGetter() const
Definition: RefCore.h:84
template<typename T>
RefCore const& edm::RefProd< T >::refCore ( ) const
inline

Definition at line 123 of file RefProd.h.

Referenced by edm::operator==(), edm::Ref< C, T, F >::Ref(), edm::RefToBaseProd< T >::RefToBaseProd(), and reco::TrackExtraBase::setHits().

123  {
124  return product_;
125  }
RefCore product_
Definition: RefProd.h:165
template<typename C >
void edm::RefProd< C >::swap ( RefProd< C > &  other)
inline

Definition at line 190 of file RefProd.h.

References edm::RefProd< T >::product_, and edm::swap().

Referenced by reco::ClusterRemovalInfo::swap(), edm::Association< reco::FFTJPTJetCollection >::swap(), and edm::swap().

190  {
191  edm::swap(product_, other.product_);
192  }
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
RefCore product_
Definition: RefProd.h:165

Member Data Documentation

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