CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

edm::RefProd< C > Class Template Reference

#include <RefProd.h>

List of all members.

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

Private Member Functions

void checkTypeAtCompileTime (C const *ptr)

Private Attributes

RefCore product_

Detailed Description

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

Definition at line 52 of file RefProd.h.


Member Typedef Documentation

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

Definition at line 54 of file RefProd.h.

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

Definition at line 55 of file RefProd.h.


Constructor & Destructor Documentation

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

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

Definition at line 58 of file RefProd.h.

: product_() {}
template<typename C>
edm::RefProd< C >::RefProd ( Handle< C > const &  handle) [inline, explicit]

General purpose constructor from handle.

Definition at line 61 of file RefProd.h.

                                              :
    product_(handle.id(), handle.product(), 0, false) {
      checkTypeAtCompileTime(handle.product());
    }
template<typename C>
edm::RefProd< C >::RefProd ( OrphanHandle< C > const &  handle) [inline, explicit]

General purpose constructor from orphan handle.

Definition at line 67 of file RefProd.h.

                                                    :
    product_(handle.id(), handle.product(), 0, false) {
      checkTypeAtCompileTime(handle.product());
    }
template<typename C>
edm::RefProd< C >::RefProd ( C const *  product) [inline]

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

Definition at line 77 of file RefProd.h.

                              :
      product_(ProductID(), product, 0, true) {
      checkTypeAtCompileTime(product);
    }
template<typename C>
edm::RefProd< C >::RefProd ( TestHandle< C > const &  handle) [inline, explicit]

General purpose constructor from test handle.

Definition at line 87 of file RefProd.h.

                                                  :
    product_(handle.id(), handle.product(), 0, true) {
      checkTypeAtCompileTime(handle.product());
    }
template<typename C>
template<typename T , typename F >
edm::RefProd< C >::RefProd ( Ref< C, T, F > const &  ref) [inline, explicit]

Constructor from Ref<C,T,F>

Constructor from Ref.

Definition at line 185 of file RefProd.h.

                                             :
      product_(ref.id(), ref.hasProductCache() ?  ref.product() : 0, ref.productGetter(), ref.isTransient()) 
  {  }
template<typename C>
template<typename T , typename F >
edm::RefProd< C >::RefProd ( RefVector< C, T, F > const &  ref) [inline, explicit]

Constructor from RefVector<C,T,F>

Constructor from RefVector.

Definition at line 193 of file RefProd.h.

                                                   :
      product_(ref.id(), ref.hasProductCache() ?  ref.product() : 0, ref.productGetter(), ref.isTransient()) 
  {  }
template<typename C>
edm::RefProd< C >::RefProd ( ProductID const &  productID,
EDProductGetter const *  prodGetter 
) [inline]

Definition at line 103 of file RefProd.h.

                                                                           :
      product_(productID, 0, mustBeNonZero(prodGetter, "RefProd", productID), false) {
    }
template<typename C>
edm::RefProd< C >::~RefProd ( ) [inline]

Destructor.

Definition at line 108 of file RefProd.h.

{}

Member Function Documentation

template<typename C>
void edm::RefProd< C >::checkTypeAtCompileTime ( C const *  ptr) [inline, private]

Definition at line 168 of file RefProd.h.

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

{}
template<typename C>
product_type const* edm::RefProd< C >::get ( void  ) const [inline]
template<typename C>
bool edm::RefProd< C >::hasCache ( ) const [inline]

Checks if product is in memory.

Definition at line 148 of file RefProd.h.

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

{return product_.productPtr() != 0;}
template<typename C>
bool edm::RefProd< C >::hasProductCache ( ) const [inline]

Checks if product is in memory.

Definition at line 151 of file RefProd.h.

{return hasCache();}
template<typename C>
ProductID edm::RefProd< C >::id ( void  ) const [inline]
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.

Definition at line 155 of file RefProd.h.

{return product_.isAvailable();}
template<typename C>
bool edm::RefProd< C >::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().

{return product_.isNonnull();}
template<typename C>
bool edm::RefProd< C >::isNull ( ) const [inline]
template<typename C>
bool edm::RefProd< C >::isTransient ( ) const [inline]

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

Definition at line 158 of file RefProd.h.

{return product_.isTransient();}
template<typename C>
bool edm::RefProd< C >::operator! ( ) const [inline]

Checks for null.

Definition at line 139 of file RefProd.h.

{return isNull();}
template<typename C >
C const & edm::RefProd< C >::operator* ( ) const [inline]

Dereference operator.

Definition at line 200 of file RefProd.h.

References svgfig::template().

                                       {
    return *(edm::template getProduct<C>(product_));
  }
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().

                                        {
    return edm::template getProduct<C>(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 124 of file RefProd.h.

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

                                        {
      return isNull() ? 0 : this->operator->();
    }
template<typename C>
EDProductGetter const* edm::RefProd< C >::productGetter ( ) const [inline]

Accessor for product getter.

Definition at line 145 of file RefProd.h.

{return product_.productGetter();}
template<typename C>
RefCore const& edm::RefProd< C >::refCore ( ) const [inline]

Definition at line 128 of file RefProd.h.

Referenced by edm::operator==().

                                   {
      return product_;
    }
template<typename C>
void edm::RefProd< C >::swap ( RefProd< C > &  other) [inline]

Definition at line 214 of file RefProd.h.

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

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

                                          {
    std::swap(product_, other.product_);
  }

Member Data Documentation

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