CMS 3D CMS Logo

edm::RefToBaseVector< T > Class Template Reference

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

List of all members.

Public Types

typedef holder_type::const_iterator const_iterator
typedef
reftobase::BaseVectorHolder< T > 
holder_type
typedef T member_type
typedef holder_type::size_type size_type
typedef RefToBase< T > value_type

Public Member Functions

value_type at (size_type idx) const
const_iterator begin () const
void clear ()
bool empty () const
const_iterator end () const
void fillView (std::vector< void const * > &pointers) const
ProductID id () const
bool isAvailable () const
 Checks if collection is in memory or available in the Event.
bool isInvalid () const
bool isValid () const
RefToBaseVectoroperator= (RefToBaseVector const &iRHS)
value_type operator[] (size_type idx) const
const voidproduct () const
EDProductGetter const * productGetter () const
void push_back (const RefToBase< T > &)
 RefToBaseVector (boost::shared_ptr< reftobase::RefVectorHolderBase > p)
template<typename T1>
 RefToBaseVector (Handle< View< T1 > > const &)
template<typename C>
 RefToBaseVector (Handle< C > const &)
template<class REFV>
 RefToBaseVector (REFV const &)
 RefToBaseVector (RefToBaseVector const &)
 RefToBaseVector ()
size_type size () const
void swap (RefToBaseVector &other)
std::auto_ptr
< reftobase::RefVectorHolderBase
vectorHolder () const
 ~RefToBaseVector ()

Private Attributes

holder_typeholder_


Detailed Description

template<class T>
class edm::RefToBaseVector< T >

Definition at line 26 of file RefToBaseVector.h.


Member Typedef Documentation

template<class T>
typedef holder_type::const_iterator edm::RefToBaseVector< T >::const_iterator

Definition at line 32 of file RefToBaseVector.h.

template<class T>
typedef reftobase::BaseVectorHolder<T> edm::RefToBaseVector< T >::holder_type

Definition at line 30 of file RefToBaseVector.h.

template<class T>
typedef T edm::RefToBaseVector< T >::member_type

Definition at line 29 of file RefToBaseVector.h.

template<class T>
typedef holder_type::size_type edm::RefToBaseVector< T >::size_type

Definition at line 31 of file RefToBaseVector.h.

template<class T>
typedef RefToBase<T> edm::RefToBaseVector< T >::value_type

Definition at line 28 of file RefToBaseVector.h.


Constructor & Destructor Documentation

template<class T>
RefToBaseVector::RefToBaseVector (  )  [inline]

Definition at line 109 of file RefToBaseVector.h.

00109                                       : 
00110     holder_(0) 
00111   { }

template<class T>
RefToBaseVector::RefToBaseVector ( RefToBaseVector< T > const &  iOther  )  [inline]

Definition at line 122 of file RefToBaseVector.h.

00122                                                                       : 
00123     holder_(iOther.holder_ ? iOther.holder_->clone() : 0)
00124   { }

template<class T>
template<class REFV>
RefToBaseVector::RefToBaseVector ( REFV const &  iRef  )  [inline, explicit]

Definition at line 116 of file RefToBaseVector.h.

00116                                                       :
00117     holder_(new reftobase::VectorHolder<T,REFV>(iRef)) 
00118   { }

template<typename T>
template<typename C>
RefToBaseVector::RefToBaseVector ( Handle< C > const &  h  )  [inline, explicit]

Definition at line 284 of file RefToBaseVector.h.

00284                                                           :
00285     holder_(new reftobase::VectorHolder<T, RefVector<C, typename refhelper::ValueTrait<C>::value, 
00286             typename refhelper::FindTrait<C, T>::value> >(h.id())) {
00287   }

template<typename T>
template<typename T1>
RefToBaseVector::RefToBaseVector ( Handle< View< T1 > > const &  h  )  [inline, explicit]

Definition at line 291 of file RefToBaseVector.h.

00291                                                                   :
00292     holder_(h->refVector().holder_->cloneEmpty()) {
00293   }

template<class T>
RefToBaseVector::RefToBaseVector ( boost::shared_ptr< reftobase::RefVectorHolderBase p  )  [inline]

Definition at line 128 of file RefToBaseVector.h.

00128                                                                                      : 
00129     holder_(new reftobase::IndirectVectorHolder<T>(p)) {
00130   }

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

Definition at line 150 of file RefToBaseVector.h.

References edm::RefToBaseVector< T >::holder_.

00151   {
00152     delete holder_; 
00153   }


Member Function Documentation

template<class T>
RefToBaseVector< T >::value_type RefToBaseVector::at ( size_type  idx  )  const [inline]

Definition at line 158 of file RefToBaseVector.h.

References edm::reftobase::BaseVectorHolder< T >::at(), edm::RefToBaseVector< T >::holder_, and edm::errors::InvalidReference.

Referenced by edm::RefToBaseVector< T >::operator[]().

00159   {
00160     if ( holder_ == 0 )
00161       throw edm::Exception( edm::errors::InvalidReference ) 
00162         << "Trying to dereference null RefToBaseVector<T> in method: at(" << idx  <<")\n";
00163     return holder_->at( idx );
00164   }

template<class T>
RefToBaseVector< T >::const_iterator RefToBaseVector::begin (  )  const [inline]

Definition at line 218 of file RefToBaseVector.h.

References edm::reftobase::BaseVectorHolder< T >::begin(), and edm::RefToBaseVector< T >::holder_.

Referenced by TrackAssociatorByHits::associateRecoToSim(), MuonAssociatorByHits::associateRecoToSim(), TrackAssociatorByChi2::associateRecoToSim(), MuonAssociatorByHits::associateSimToReco(), TrackAssociatorByChi2::associateSimToReco(), TrackAssociatorByHits::associateSimToReco(), edm::RefToBaseVector< T >::fillView(), edm::operator==(), and CandViewRefMerger::produce().

00219   {
00220     return holder_ ? holder_->begin() : const_iterator();
00221   }

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

Definition at line 193 of file RefToBaseVector.h.

References edm::reftobase::BaseVectorHolder< T >::clear(), and edm::RefToBaseVector< T >::holder_.

00194   {
00195     if ( holder_ != 0 )
00196       holder_->clear();
00197   }

template<class T>
bool RefToBaseVector::empty (  )  const [inline]

Definition at line 177 of file RefToBaseVector.h.

References edm::reftobase::BaseVectorHolder< T >::empty(), and edm::RefToBaseVector< T >::holder_.

00178   {
00179     return holder_ ? holder_->empty() : true;
00180   }

template<class T>
RefToBaseVector< T >::const_iterator RefToBaseVector::end (  )  const [inline]

Definition at line 226 of file RefToBaseVector.h.

References edm::reftobase::BaseVectorHolder< T >::end(), and edm::RefToBaseVector< T >::holder_.

Referenced by TrackAssociatorByHits::associateRecoToSim(), MuonAssociatorByHits::associateRecoToSim(), TrackAssociatorByChi2::associateRecoToSim(), MuonAssociatorByHits::associateSimToReco(), TrackAssociatorByChi2::associateSimToReco(), TrackAssociatorByHits::associateSimToReco(), edm::RefToBaseVector< T >::fillView(), edm::operator==(), and CandViewRefMerger::produce().

00227   {
00228     return  holder_ ? holder_->end() : const_iterator();
00229   }

template<typename T>
void RefToBaseVector::fillView ( std::vector< void const * > &  pointers  )  const [inline]

Definition at line 233 of file RefToBaseVector.h.

References edm::RefToBaseVector< T >::begin(), e, edm::RefToBaseVector< T >::end(), i, and edm::RefToBase< T >::isNull().

Referenced by edm::fillView().

00234   {
00235     pointers.reserve(this->size());
00236     for (const_iterator i=begin(), e=end(); i!=e; ++i) {
00237       RefToBase<T> ref = * i;
00238       member_type const * address = ref.isNull() ? 0 : & * ref;
00239       pointers.push_back(address);
00240     }
00241   }

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

Definition at line 202 of file RefToBaseVector.h.

References edm::RefToBaseVector< T >::holder_, and edm::reftobase::BaseVectorHolder< T >::id().

00203   {
00204     return holder_ ? holder_->id() : ProductID();
00205   }

template<class T>
bool edm::RefToBaseVector< T >::isAvailable (  )  const [inline]

Checks if collection is in memory or available in the Event.

No type checking is done.

Definition at line 71 of file RefToBaseVector.h.

00071 { return holder_->isAvailable(); }

template<class T>
bool edm::RefToBaseVector< T >::isInvalid (  )  const [inline]

Definition at line 54 of file RefToBaseVector.h.

Referenced by edm::operator==().

00054 { return holder_ == 0; }

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

Definition at line 53 of file RefToBaseVector.h.

00053 { return holder_ != 0; }

template<class T>
RefToBaseVector< T > & RefToBaseVector::operator= ( RefToBaseVector< T > const &  iRHS  )  [inline]

Definition at line 135 of file RefToBaseVector.h.

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

00135                                                            {
00136     RefToBaseVector temp(iRHS);
00137     this->swap(temp);
00138     return *this;
00139   }

template<class T>
RefToBaseVector< T >::value_type RefToBaseVector::operator[] ( size_type  idx  )  const [inline]

Definition at line 169 of file RefToBaseVector.h.

References edm::RefToBaseVector< T >::at().

00170   {
00171     return at( idx ); 
00172   }

template<typename T>
const void * RefToBaseVector::product (  )  const [inline]

Definition at line 270 of file RefToBaseVector.h.

References edm::RefToBaseVector< T >::holder_, and edm::reftobase::BaseVectorHolder< T >::product().

00270                                                  {
00271     return holder_ ? holder_->product() : 0;
00272   }

template<class T>
EDProductGetter const * RefToBaseVector::productGetter (  )  const [inline]

Definition at line 210 of file RefToBaseVector.h.

References edm::RefToBaseVector< T >::holder_, and edm::reftobase::BaseVectorHolder< T >::productGetter().

00211   {
00212     return holder_ ? holder_->productGetter() : 0;
00213   }

template<typename T>
void RefToBaseVector::push_back ( const RefToBase< T > &  r  )  [inline]

Definition at line 256 of file RefToBaseVector.h.

References edm::RefToBase< T >::holder_, edm::RefToBaseVector< T >::holder_, p, and edm::reftobase::BaseVectorHolder< T >::push_back().

Referenced by MuonAssociatorByHits::associateRecoToSim(), TrackAssociatorBase::associateRecoToSim(), TrackAssociatorBase::associateSimToReco(), MuonAssociatorByHits::associateSimToReco(), helper::SelectionRefViewAdder< T >::operator()(), and pat::helper::TriggerMatchHelper::triggerMatchCandidates().

00256                                                              {
00257     if ( holder_ == 0 ) {
00258       std::auto_ptr<reftobase::BaseVectorHolder<T> > p = r.holder_->makeVectorHolder();
00259       holder_ = p.release();
00260     }
00261     holder_->push_back( r.holder_ );
00262   }

template<class T>
RefToBaseVector< T >::size_type RefToBaseVector::size ( void   )  const [inline]

Definition at line 185 of file RefToBaseVector.h.

References edm::RefToBaseVector< T >::holder_, and edm::reftobase::BaseVectorHolder< T >::size().

Referenced by TrackAssociatorByHits::associateRecoToSim(), MuonAssociatorByHits::associateRecoToSim(), TrackAssociatorByPosition::associateRecoToSim(), TrackAssociatorByPosition::associateSimToReco(), TrackAssociatorByHits::associateSimToReco(), and edm::operator==().

00186   {
00187     return holder_ ? holder_->size() : 0;
00188   }

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

Definition at line 144 of file RefToBaseVector.h.

References edm::RefToBaseVector< T >::holder_, and std::swap().

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

00144                                                  {
00145     std::swap(holder_, other.holder_);
00146   }

template<typename T>
std::auto_ptr< reftobase::RefVectorHolderBase > RefToBaseVector::vectorHolder (  )  const [inline]

Definition at line 265 of file RefToBaseVector.h.

References edm::RefToBaseVector< T >::holder_, and edm::reftobase::BaseVectorHolder< T >::vectorHolder().

Referenced by edm::helpers::ViewFiller< RefToBaseVector< T > >::fill().

00265                                                                                    {
00266     return holder_ ? holder_->vectorHolder() : std::auto_ptr<reftobase::RefVectorHolderBase>();
00267   }


Member Data Documentation

template<class T>
holder_type* edm::RefToBaseVector< T >::holder_ [private]

Definition at line 73 of file RefToBaseVector.h.

Referenced by edm::RefToBaseVector< T >::at(), edm::RefToBaseVector< T >::begin(), edm::RefToBaseVector< T >::clear(), edm::RefToBaseVector< T >::empty(), edm::RefToBaseVector< T >::end(), edm::RefToBaseVector< T >::id(), edm::RefToBaseVector< reco::CaloCluster >::isAvailable(), edm::RefToBaseVector< reco::CaloCluster >::isInvalid(), edm::RefToBaseVector< reco::CaloCluster >::isValid(), edm::RefToBaseVector< T >::product(), edm::RefToBaseVector< T >::productGetter(), edm::RefToBaseVector< T >::push_back(), edm::RefToBaseVector< T >::size(), edm::RefToBaseVector< T >::swap(), edm::RefToBaseVector< T >::vectorHolder(), and edm::RefToBaseVector< T >::~RefToBaseVector().


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