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 | 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 *product)
 Constructor for ref to object that is not in an event. More...
 
 RefProd (TestHandle< C > const &handle)
 General purpose constructor from test handle. More...
 
template<typename T , typename F >
 RefProd (Ref< C, T, F > const &ref)
 Constructor from Ref<C,T,F> More...
 
template<typename T , typename F >
 RefProd (RefVector< C, T, F > const &ref)
 Constructor from RefVector<C,T,F> More...
 
 RefProd (ProductID const &productID, EDProductGetter const *prodGetter)
 
template<typename T , typename F >
 RefProd (Ref< C, T, F > const &ref)
 Constructor from Ref. More...
 
template<typename T , typename F >
 RefProd (RefVector< C, T, F > const &ref)
 Constructor from RefVector. More...
 
void swap (RefProd< C > &)
 
 ~RefProd ()
 Destructor. More...
 

Private Member Functions

void checkTypeAtCompileTime (C const *ptr)
 

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 54 of file RefProd.h.

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

Definition at line 55 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 58 of file RefProd.h.

58 : product_() {}
RefCore product_
Definition: RefProd.h:170
template<typename T>
edm::RefProd< T >::RefProd ( Handle< C > const &  handle)
inlineexplicit

General purpose constructor from handle.

Definition at line 61 of file RefProd.h.

61  :
62  product_(handle.id(), handle.product(), 0, false) {
63  checkTypeAtCompileTime(handle.product());
64  }
void checkTypeAtCompileTime(C const *ptr)
Definition: RefProd.h:168
RefCore product_
Definition: RefProd.h:170
template<typename T>
edm::RefProd< T >::RefProd ( OrphanHandle< C > const &  handle)
inlineexplicit

General purpose constructor from orphan handle.

Definition at line 67 of file RefProd.h.

67  :
68  product_(handle.id(), handle.product(), 0, false) {
69  checkTypeAtCompileTime(handle.product());
70  }
tuple handle
Definition: patZpeak.py:22
void checkTypeAtCompileTime(C const *ptr)
Definition: RefProd.h:168
RefCore product_
Definition: RefProd.h:170
template<typename T>
edm::RefProd< T >::RefProd ( C const *  product)
inline

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

Definition at line 77 of file RefProd.h.

77  :
78  product_(ProductID(), product, 0, true) {
80  }
void checkTypeAtCompileTime(C const *ptr)
Definition: RefProd.h:168
RefCore product_
Definition: RefProd.h:170
product_type const * product() const
Definition: RefProd.h:124
template<typename T>
edm::RefProd< T >::RefProd ( TestHandle< C > const &  handle)
inlineexplicit

General purpose constructor from test handle.

Definition at line 87 of file RefProd.h.

87  :
88  product_(handle.id(), handle.product(), 0, true) {
89  checkTypeAtCompileTime(handle.product());
90  }
tuple handle
Definition: patZpeak.py:22
void checkTypeAtCompileTime(C const *ptr)
Definition: RefProd.h:168
RefCore product_
Definition: RefProd.h:170
template<typename T>
template<typename T , typename F >
edm::RefProd< T >::RefProd ( Ref< C, T, F > const &  ref)
explicit

Constructor from Ref<C,T,F>

template<typename T>
template<typename T , typename F >
edm::RefProd< T >::RefProd ( RefVector< C, T, F > const &  ref)
explicit

Constructor from RefVector<C,T,F>

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

Definition at line 103 of file RefProd.h.

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

Destructor.

Definition at line 108 of file RefProd.h.

108 {}
template<typename T>
template<typename T , typename F >
edm::RefProd< T >::RefProd ( Ref< C, T, F > const &  ref)
inline

Constructor from Ref.

Definition at line 185 of file RefProd.h.

185  :
186  product_(ref.id(), ref.hasProductCache() ? ref.product() : 0, ref.productGetter(), ref.isTransient())
187  { }
RefCore product_
Definition: RefProd.h:170
template<typename T>
template<typename T , typename F >
edm::RefProd< T >::RefProd ( RefVector< C, T, F > const &  ref)
inline

Constructor from RefVector.

Definition at line 193 of file RefProd.h.

193  :
194  product_(ref.id(), ref.hasProductCache() ? ref.product() : 0, ref.productGetter(), ref.isTransient())
195  { }
RefCore product_
Definition: RefProd.h:170

Member Function Documentation

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

Definition at line 168 of file RefProd.h.

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

168 {}
template<typename T>
product_type const* edm::RefProd< T >::get ( void  ) const
inline

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

Definition at line 118 of file RefProd.h.

Referenced by Options.Options::__getitem__(), pat::TriggerEvent::algorithms(), l1extra::L1ParticleMap::candidateInCombo(), pat::TriggerEvent::conditions(), l1extra::L1ParticleMap::etMissParticleInCombo(), pat::TriggerEvent::filters(), pat::TriggerEvent::objects(), and pat::TriggerEvent::paths().

118  {
119  return isNull() ? 0 : this->operator->();
120  }
bool isNull() const
Checks for null.
Definition: RefProd.h:133
product_type const * operator->() const
Member dereference operator.
Definition: RefProd.h:207
template<typename T>
bool edm::RefProd< T >::hasCache ( ) const
inline

Checks if product is in memory.

Definition at line 148 of file RefProd.h.

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

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

Checks if product is in memory.

Definition at line 151 of file RefProd.h.

151 {return hasCache();}
bool hasCache() const
Checks if product is in memory.
Definition: RefProd.h:148
template<typename T>
ProductID edm::RefProd< T >::id ( void  ) 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 155 of file RefProd.h.

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

Checks for non-null.

Definition at line 136 of file RefProd.h.

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

136 {return product_.isNonnull();}
bool isNonnull() const
Definition: RefCore.h:37
RefCore product_
Definition: RefProd.h:170
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 158 of file RefProd.h.

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

Checks for null.

Definition at line 139 of file RefProd.h.

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

Dereference operator.

Definition at line 200 of file RefProd.h.

References svgfig::template().

200  {
201  return *(edm::template getProduct<C>(product_));
202  }
RefCore product_
Definition: RefProd.h:170
def template
Definition: svgfig.py:520
template<typename C >
C const * edm::RefProd< C >::operator-> ( ) const
inline

Member dereference operator.

Definition at line 207 of file RefProd.h.

References svgfig::template().

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

207  {
208  return edm::template getProduct<C>(product_);
209  }
RefCore product_
Definition: RefProd.h:170
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 124 of file RefProd.h.

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

124  {
125  return isNull() ? 0 : this->operator->();
126  }
bool isNull() const
Checks for null.
Definition: RefProd.h:133
product_type const * operator->() const
Member dereference operator.
Definition: RefProd.h:207
template<typename T>
EDProductGetter const* edm::RefProd< T >::productGetter ( ) const
inline

Accessor for product getter.

Definition at line 145 of file RefProd.h.

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

Definition at line 128 of file RefProd.h.

Referenced by edm::operator==().

128  {
129  return product_;
130  }
RefCore product_
Definition: RefProd.h:170
template<typename C >
void edm::RefProd< C >::swap ( RefProd< C > &  other)
inline

Definition at line 214 of file RefProd.h.

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

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

214  {
215  std::swap(product_, other.product_);
216  }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
RefCore product_
Definition: RefProd.h:170

Member Data Documentation

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