CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes | Friends

edm::FwdPtr< T > Class Template Reference

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

List of all members.

Public Types

typedef unsigned long key_type
typedef T value_type

Public Member Functions

Ptr< value_type > const & backPtr () const
template<typename C >
 FwdPtr (Ptr< C > f, Ptr< C > b)
 FwdPtr ()
 FwdPtr (FwdPtr< T > const &iOther)
T const * get () const
 Returns C++ pointer to the item.
bool hasProductCache () const
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 FwdPtr is transient (i.e. not persistable).
key_type key () const
bool operator! () const
 Checks for null.
T const & operator* () const
 Dereference operator.
T const * operator-> () const
 Member dereference operator.
void const * product () const
EDProductGetter const * productGetter () const
 Accessor for product getter.
Ptr< value_type > const & ptr () const
RefCore const & refCore () const
 ~FwdPtr ()
 Destructor.

Private Attributes

Ptr< value_typebackPtr_
Ptr< value_typeptr_

Friends

class FwdPtrVectorBase

Detailed Description

template<typename T>
class edm::FwdPtr< T >

Description: Persistent 'pointer' to an item in a collection where the collection is in the edm::Event

Usage: <usage>

Definition at line 41 of file FwdPtr.h.


Member Typedef Documentation

template<typename T>
typedef unsigned long edm::FwdPtr< T >::key_type

Definition at line 45 of file FwdPtr.h.

template<typename T>
typedef T edm::FwdPtr< T >::value_type

Definition at line 46 of file FwdPtr.h.


Constructor & Destructor Documentation

template<typename T>
template<typename C >
edm::FwdPtr< T >::FwdPtr ( Ptr< C >  f,
Ptr< C >  b 
) [inline]

Definition at line 50 of file FwdPtr.h.

                               :
    ptr_(f), backPtr_(b)
    {}
template<typename T>
edm::FwdPtr< T >::FwdPtr ( ) [inline]

Definition at line 54 of file FwdPtr.h.

          :
    ptr_(), backPtr_()
      {}
template<typename T>
edm::FwdPtr< T >::FwdPtr ( FwdPtr< T > const &  iOther) [inline]

Definition at line 58 of file FwdPtr.h.

                                 :
    ptr_(iOther.ptr_), backPtr_(iOther.backPtr_)
      {}
template<typename T>
edm::FwdPtr< T >::~FwdPtr ( ) [inline]

Destructor.

Definition at line 75 of file FwdPtr.h.

{}

Member Function Documentation

template<typename T>
Ptr<value_type> const& edm::FwdPtr< T >::backPtr ( ) const [inline]

Definition at line 124 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_.

Referenced by edm::operator==().

{ return backPtr_;}
template<typename T>
T const* edm::FwdPtr< T >::get ( void  ) const [inline]

Returns C++ pointer to the item.

Definition at line 86 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::get(), edm::Ptr< T >::isNonnull(), and edm::FwdPtr< T >::ptr_.

{ return ptr_.isNonnull() ? ptr_.get() : backPtr_.get();}
template<typename T>
bool edm::FwdPtr< T >::hasProductCache ( ) const [inline]

Definition at line 116 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::hasProductCache(), and edm::FwdPtr< T >::ptr_.

{ return ptr_.hasProductCache() || backPtr_.hasProductCache();} 
template<typename T>
ProductID edm::FwdPtr< T >::id ( void  ) const [inline]

Accessor for product ID.

Definition at line 106 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::id(), edm::Ptr< T >::isNonnull(), and edm::FwdPtr< T >::ptr_.

{return ptr_.isNonnull() ? ptr_.id() : backPtr_.id();}
template<typename T>
bool edm::FwdPtr< T >::isAvailable ( ) const [inline]

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

Definition at line 100 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::isAvailable(), and edm::FwdPtr< T >::ptr_.

{return ptr_.isAvailable() || backPtr_.isAvailable();}
template<typename T>
bool edm::FwdPtr< T >::isNonnull ( ) const [inline]

Checks for non-null.

Definition at line 94 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::isNonnull(), and edm::FwdPtr< T >::ptr_.

Referenced by edm::FwdPtr< T >::isNull().

{return ptr_.isNonnull() || backPtr_.isNonnull(); }
template<typename T>
bool edm::FwdPtr< T >::isNull ( ) const [inline]

Checks for null.

Definition at line 90 of file FwdPtr.h.

References edm::FwdPtr< T >::isNonnull().

Referenced by edm::FwdPtr< T >::operator!().

{return !isNonnull(); }
template<typename T>
bool edm::FwdPtr< T >::isTransient ( ) const [inline]

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

Definition at line 103 of file FwdPtr.h.

References edm::Ptr< T >::isTransient(), and edm::FwdPtr< T >::ptr_.

{return ptr_.isTransient();}
template<typename T>
key_type edm::FwdPtr< T >::key ( ) const [inline]

Definition at line 114 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::isNonnull(), edm::Ptr< T >::key(), and edm::FwdPtr< T >::ptr_.

{return ptr_.isNonnull() ? ptr_.key() : backPtr_.key() ;}
template<typename T>
bool edm::FwdPtr< T >::operator! ( ) const [inline]

Checks for null.

Definition at line 96 of file FwdPtr.h.

References edm::FwdPtr< T >::isNull().

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

Dereference operator.

Definition at line 79 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::isNonnull(), and edm::FwdPtr< T >::ptr_.

{ return ptr_.isNonnull() ? ptr_.operator*() : backPtr_.operator*();}
template<typename T>
T const* edm::FwdPtr< T >::operator-> ( ) const [inline]

Member dereference operator.

Definition at line 83 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::isNonnull(), and edm::FwdPtr< T >::ptr_.

{ return ptr_.isNonnull() ? ptr_.operator->() : backPtr_.operator->();}
template<typename T>
void const* edm::FwdPtr< T >::product ( ) const [inline]

Definition at line 121 of file FwdPtr.h.

{return 0;}
template<typename T>
EDProductGetter const* edm::FwdPtr< T >::productGetter ( ) const [inline]

Accessor for product getter.

Definition at line 109 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::productGetter(), and edm::FwdPtr< T >::ptr_.

                                                 {
      if ( ptr_.productGetter() ) return ptr_.productGetter();
      else return backPtr_.productGetter();
    }
template<typename T>
Ptr<value_type> const& edm::FwdPtr< T >::ptr ( ) const [inline]

Definition at line 123 of file FwdPtr.h.

References edm::FwdPtr< T >::ptr_.

Referenced by edm::operator==().

{ return ptr_;}
template<typename T>
RefCore const& edm::FwdPtr< T >::refCore ( ) const [inline]

Definition at line 118 of file FwdPtr.h.

References edm::FwdPtr< T >::backPtr_, edm::Ptr< T >::isNonnull(), edm::FwdPtr< T >::ptr_, and edm::Ptr< T >::refCore().

{return ptr_.isNonnull() ? ptr_.refCore() : backPtr_.refCore() ;}

Friends And Related Function Documentation

template<typename T>
friend class FwdPtrVectorBase [friend]

Definition at line 42 of file FwdPtr.h.


Member Data Documentation

template<typename T>
Ptr<value_type> edm::FwdPtr< T >::backPtr_ [private]
template<typename T>
Ptr<value_type> edm::FwdPtr< T >::ptr_ [private]