CMS 3D CMS Logo

edm::OrphanHandle< T > Class Template Reference

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

List of all members.

Public Types

typedef T element_type

Public Member Functions

void clear ()
ProductID id () const
bool isValid () const
T const & operator * () const
T const * operator-> () const
OrphanHandle< T > & operator= (const OrphanHandle< T > &rhs)
 OrphanHandle (T const *prod, ProductID const &id)
 OrphanHandle (const OrphanHandle< T > &h)
 OrphanHandle ()
T const * product () const
void swap (OrphanHandle< T > &other)
 ~OrphanHandle ()

Private Attributes

ProductID id_
T const * prod_


Detailed Description

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

Definition at line 32 of file OrphanHandle.h.


Member Typedef Documentation

template<typename T>
typedef T edm::OrphanHandle< T >::element_type

Definition at line 34 of file OrphanHandle.h.


Constructor & Destructor Documentation

template<class T>
edm::OrphanHandle< T >::OrphanHandle (  )  [inline]

Definition at line 66 of file OrphanHandle.h.

00066                                 :
00067     prod_(0),
00068     id_(0)
00069   { }

template<class T>
edm::OrphanHandle< T >::OrphanHandle ( const OrphanHandle< T > &  h  )  [inline]

Definition at line 72 of file OrphanHandle.h.

00072                                                         :
00073     prod_(h.prod_),
00074     id_(h.id_)
00075   { }

template<class T>
edm::OrphanHandle< T >::OrphanHandle ( T const *  prod,
ProductID const &  id 
) [inline]

Definition at line 78 of file OrphanHandle.h.

References edm::OrphanHandle< T >::prod_.

00078                                                                      :
00079     prod_(prod),
00080     id_(theId) { 
00081       assert(prod_);
00082   }

template<class T>
edm::OrphanHandle< T >::~OrphanHandle (  )  [inline]

Definition at line 85 of file OrphanHandle.h.

References edm::OrphanHandle< T >::clear().

00085                                  { 
00086     // Really nothing to do -- we do not own the things to which we
00087     // point.  For help in debugging, we clear the data.
00088     clear();
00089   }


Member Function Documentation

template<class T>
void edm::OrphanHandle< T >::clear ( void   )  [inline]

Definition at line 93 of file OrphanHandle.h.

References edm::OrphanHandle< T >::id_, and edm::OrphanHandle< T >::prod_.

Referenced by edm::OrphanHandle< T >::~OrphanHandle().

00094   {
00095     prod_ = 0;
00096     id_ = ProductID();
00097   }

template<class T>
ProductID edm::OrphanHandle< T >::id ( void   )  const [inline]

Definition at line 142 of file OrphanHandle.h.

References edm::OrphanHandle< T >::id_.

Referenced by pat::PATGenCandsFromSimTracksProducer::produce(), and TrackClusterRemover::produce().

00142                             {
00143     return id_;
00144   }

template<class T>
bool edm::OrphanHandle< T >::isValid ( void   )  const [inline]

Definition at line 117 of file OrphanHandle.h.

References edm::OrphanHandle< T >::id_, and edm::OrphanHandle< T >::prod_.

Referenced by PFBlockAlgo::muAssocToTrack(), PFBlockAlgo::niAssocToTrack(), HybridClusterProducer::produce(), EgammaHLTHybridClusterProducer::produce(), and PFBlockAlgo::v0AssocToTrack().

00117                                  {
00118     return prod_ != 0 && id_ != ProductID();
00119   }

template<class T>
T const & edm::OrphanHandle< T >::operator * (  )  const [inline]

Definition at line 136 of file OrphanHandle.h.

References edm::OrphanHandle< T >::product().

00136                                    {
00137     return *product();
00138   }

template<class T>
T const * edm::OrphanHandle< T >::operator-> (  )  const [inline]

Definition at line 130 of file OrphanHandle.h.

References edm::OrphanHandle< T >::product().

00130                                     {
00131     return product();
00132   }

template<class T>
OrphanHandle< T > & edm::OrphanHandle< T >::operator= ( const OrphanHandle< T > &  rhs  )  [inline]

Definition at line 109 of file OrphanHandle.h.

References edm::OrphanHandle< T >::swap(), and pyDBSRunClass::temp.

00109                                                        {
00110     OrphanHandle<T> temp(rhs);
00111     this->swap(temp);
00112     return *this;
00113   }

template<class T>
T const * edm::OrphanHandle< T >::product (  )  const [inline]

Definition at line 123 of file OrphanHandle.h.

References edm::OrphanHandle< T >::prod_.

Referenced by edm::OrphanHandle< T >::operator *(), edm::OrphanHandle< GenericObjectOwner >::operator->(), edm::OrphanHandle< T >::operator->(), edm::Ref< C, T, F >::Ref(), and edm::RefProd< edm::OwnVector >::RefProd().

00123                                  {
00124     // Should we throw if the pointer is null?
00125     return prod_;
00126   }

template<class T>
void edm::OrphanHandle< T >::swap ( OrphanHandle< T > &  other  )  [inline]

Definition at line 101 of file OrphanHandle.h.

References edm::OrphanHandle< T >::id_, edm::OrphanHandle< T >::prod_, and std::swap().

Referenced by edm::OrphanHandle< GenericObjectOwner >::operator=(), edm::OrphanHandle< T >::operator=(), and edm::swap().

00101                                               {
00102     using std::swap;
00103     std::swap(prod_, other.prod_);
00104     swap(id_, other.id_);
00105   }


Member Data Documentation

template<typename T>
ProductID edm::OrphanHandle< T >::id_ [private]

Definition at line 62 of file OrphanHandle.h.

Referenced by edm::OrphanHandle< T >::clear(), edm::OrphanHandle< T >::id(), edm::OrphanHandle< GenericObjectOwner >::id(), edm::OrphanHandle< T >::isValid(), edm::OrphanHandle< T >::swap(), and edm::OrphanHandle< GenericObjectOwner >::swap().

template<typename T>
T const* edm::OrphanHandle< T >::prod_ [private]

Definition at line 61 of file OrphanHandle.h.

Referenced by edm::OrphanHandle< T >::clear(), edm::OrphanHandle< GenericObjectOwner >::isValid(), edm::OrphanHandle< T >::isValid(), edm::OrphanHandle< GenericObjectOwner >::operator *(), edm::OrphanHandle< T >::OrphanHandle(), edm::OrphanHandle< GenericObjectOwner >::product(), edm::OrphanHandle< T >::product(), edm::OrphanHandle< T >::swap(), and edm::OrphanHandle< GenericObjectOwner >::swap().


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