CMS 3D CMS Logo

edm::RefProd< C > Class Template Reference

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

List of all members.

Public Types

typedef C product_type
typedef C value_type

Public Member Functions

product_type const * get () const
 Returns C++ pointer to the product Will attempt to retrieve product.
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
 Checks if collection is in memory or available in the Event.
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).
product_type const & operator * () const
 Dereference operator.
bool operator! () const
 Checks for null.
product_type const * operator-> () const
 Member dereference operator.
product_type const * product () const
 Returns C++ pointer to the product Will attempt to retrieve product.
EDProductGetter const * productGetter () const
 Accessor for product getter.
RefCore const & refCore () const
 RefProd (ProductID const &productID, EDProductGetter const *prodGetter)
template<typename T, typename F>
 RefProd (RefVector< C, T, F > const &ref)
 Constructor from RefVector<C,T,F>.
template<typename T, typename F>
 RefProd (Ref< C, T, F > const &ref)
 Constructor from Ref<C,T,F>.
 RefProd (TestHandle< C > const &handle)
 General purpose constructor from test handle.
 RefProd (C const *product)
 Constructor for ref to object that is not in an event.
 RefProd (OrphanHandle< C > const &handle)
 General purpose constructor from orphan handle.
 RefProd (Handle< C > const &handle)
 General purpose constructor from handle.
 RefProd ()
 Default constructor needed for reading from persistent store. Not for direct use.
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 51 of file RefProd.h.


Member Typedef Documentation

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

Definition at line 53 of file RefProd.h.

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

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

00057 : product_() {}

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

General purpose constructor from handle.

Definition at line 60 of file RefProd.h.

00060                                               :
00061     product_(handle.id(), handle.product(), 0, false) {
00062       checkTypeAtCompileTime(handle.product());
00063     }

template<typename C>
edm::RefProd< C >::RefProd ( OrphanHandle< C > const &  handle  )  [inline, explicit]

General purpose constructor from orphan handle.

Definition at line 66 of file RefProd.h.

00066                                                     :
00067     product_(handle.id(), handle.product(), 0, false) {
00068       checkTypeAtCompileTime(handle.product());
00069     }

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

00076                               :
00077       product_(ProductID(), product, 0, true) {
00078       checkTypeAtCompileTime(product);
00079     }

template<typename C>
edm::RefProd< C >::RefProd ( TestHandle< C > const &  handle  )  [inline, explicit]

General purpose constructor from test handle.

Definition at line 86 of file RefProd.h.

00086                                                   :
00087     product_(handle.id(), handle.product(), 0, true) {
00088       checkTypeAtCompileTime(handle.product());
00089     }

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

00181                                              :
00182       product_(ref.id(), ref.hasProductCache() ?  ref.product() : 0, ref.productGetter(), ref.isTransient()) 
00183   {  }

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

00189                                                    :
00190       product_(ref.id(), ref.hasProductCache() ?  ref.product() : 0, ref.productGetter(), ref.isTransient()) 
00191   {  }

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

Definition at line 102 of file RefProd.h.

00102                                                                            :
00103       product_(productID, 0, mustBeNonZero(prodGetter, "RefProd", productID), false) {
00104     }

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

Destructor.

Definition at line 107 of file RefProd.h.

00107 {}


Member Function Documentation

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

Definition at line 164 of file RefProd.h.

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

00164 {}

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

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

Definition at line 117 of file RefProd.h.

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

00117                                     {
00118       return isNull() ? 0 : this->operator->();
00119     }

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

Checks if product is in memory.

Definition at line 147 of file RefProd.h.

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

00147 {return product_.productPtr() != 0;}

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

Checks if product is in memory.

Definition at line 150 of file RefProd.h.

00150 {return hasCache();}

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

Accessor for product ID.

Definition at line 141 of file RefProd.h.

Referenced by GenParticleProducer::produce(), edm::RefToBaseProd< T >::RefToBaseProd(), and edm::Association< C >::setRef().

00141 {return product_.id();}

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

00154 {return product_.isAvailable();}

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

Checks for non-null.

Definition at line 135 of file RefProd.h.

Referenced by edm::RefProd< edm::OwnVector >::isNull().

00135 {return product_.isNonnull();}

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

Checks for null.

Definition at line 132 of file RefProd.h.

Referenced by edm::RefProd< edm::OwnVector >::get(), edm::RefProd< edm::OwnVector >::operator!(), edm::RefProd< edm::OwnVector >::product(), and edm::Association< C >::setRef().

00132 {return !isNonnull();}

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

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

Definition at line 157 of file RefProd.h.

00157 {return product_.isTransient();}

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

Dereference operator.

Definition at line 196 of file RefProd.h.

References edm::RefProd< C >::product_.

00196                                        {
00197     return *(edm::template getProduct<C>(product_));
00198   }

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

Checks for null.

Definition at line 138 of file RefProd.h.

00138 {return isNull();}

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

Member dereference operator.

Definition at line 203 of file RefProd.h.

References edm::RefProd< C >::product_.

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

00203                                         {
00204     return edm::template getProduct<C>(product_);
00205   } 

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

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

00123                                         {
00124       return isNull() ? 0 : this->operator->();
00125     }

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

Accessor for product getter.

Definition at line 144 of file RefProd.h.

00144 {return product_.productGetter();}

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

Definition at line 127 of file RefProd.h.

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

00127                                    {
00128       return product_;
00129     }

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

Definition at line 210 of file RefProd.h.

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

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

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


Member Data Documentation

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

Definition at line 166 of file RefProd.h.

Referenced by edm::RefProd< edm::OwnVector >::hasCache(), edm::RefProd< edm::OwnVector >::id(), edm::RefProd< edm::OwnVector >::isAvailable(), edm::RefProd< edm::OwnVector >::isNonnull(), edm::RefProd< edm::OwnVector >::isTransient(), edm::RefProd< C >::operator *(), edm::RefProd< C >::operator->(), edm::RefProd< edm::OwnVector >::productGetter(), edm::RefProd< edm::OwnVector >::refCore(), and edm::RefProd< C >::swap().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:43:33 2009 for CMSSW by  doxygen 1.5.4