CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

edm::RefToBaseVector< T > Class Template Reference

#include <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< Tvalue_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
bool isInvalid () const
bool isValid () const
RefToBaseVectoroperator= (RefToBaseVector const &iRHS)
value_type operator[] (size_type idx) const
const void * product () const
EDProductGetter const * productGetter () const
void push_back (const RefToBase< T > &)
template<typename T1 >
 RefToBaseVector (Handle< View< T1 > > const &)
template<typename C >
 RefToBaseVector (Handle< C > const &)
 RefToBaseVector (RefToBaseVector const &)
template<class REFV >
 RefToBaseVector (REFV const &)
 RefToBaseVector (boost::shared_ptr< reftobase::RefVectorHolderBase > p)
template<class T >
 RefToBaseVector (const RefToBaseVector< T > &iOther)
 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 24 of file RefToBaseVector.h.


Member Typedef Documentation

Definition at line 30 of file RefToBaseVector.h.

Definition at line 28 of file RefToBaseVector.h.

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

Definition at line 27 of file RefToBaseVector.h.

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

Definition at line 29 of file RefToBaseVector.h.

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

Definition at line 26 of file RefToBaseVector.h.


Constructor & Destructor Documentation

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

Definition at line 111 of file RefToBaseVector.h.

                                      : 
    holder_(0) 
  { }
template<class T>
edm::RefToBaseVector< T >::RefToBaseVector ( RefToBaseVector< T > const &  )
template<class T >
template<class REFV >
RefToBaseVector::RefToBaseVector ( REFV const &  iRef) [inline, explicit]

Definition at line 118 of file RefToBaseVector.h.

                                                      :
    holder_(new reftobase::VectorHolder<T,REFV>(iRef)) 
  { }
template<typename T >
template<typename C >
RefToBaseVector::RefToBaseVector ( Handle< C > const &  h) [explicit]

Definition at line 288 of file RefToBaseVector.h.

                                                          :
    holder_(new reftobase::VectorHolder<T, RefVector<C, typename refhelper::ValueTrait<C>::value, 
            typename refhelper::FindTrait<C, T>::value> >(h.id())) {
  }
template<typename T >
template<typename T1 >
RefToBaseVector::RefToBaseVector ( Handle< View< T1 > > const &  h) [explicit]

Definition at line 295 of file RefToBaseVector.h.

                                                                  :
    holder_(h->refVector().holder_->cloneEmpty()) {
  }
template<class T >
RefToBaseVector::RefToBaseVector ( boost::shared_ptr< reftobase::RefVectorHolderBase p) [inline]

Definition at line 130 of file RefToBaseVector.h.

                                                                                     : 
    holder_(new reftobase::IndirectVectorHolder<T>(p)) {
  }
template<class T >
RefToBaseVector::~RefToBaseVector ( ) [inline]

Definition at line 152 of file RefToBaseVector.h.

  {
    delete holder_; 
  }
template<class T>
template<class T >
edm::RefToBaseVector< T >::RefToBaseVector ( const RefToBaseVector< T > &  iOther) [inline]

Definition at line 124 of file RefToBaseVector.h.

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

Member Function Documentation

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

Definition at line 160 of file RefToBaseVector.h.

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

Referenced by reco::tautools::CastedRefProducer< DerivedCollection, BaseType >::produce().

  {
    if ( holder_ == 0 )
      Exception::throwThis( errors::InvalidReference,
        "Trying to dereference null RefToBaseVector<T> in method: at(",
        idx,
        ")\n");
    return holder_->at( idx );
  }
template<class T >
RefToBaseVector< T >::const_iterator RefToBaseVector::begin ( void  ) const [inline]
template<class T >
void RefToBaseVector::clear ( void  ) [inline]

Definition at line 197 of file RefToBaseVector.h.

References edm::reftobase::BaseVectorHolder< T >::clear().

Referenced by MatchJet::matchCollections().

  {
    if ( holder_ != 0 )
      holder_->clear();
  }
template<class T >
bool RefToBaseVector::empty ( ) const [inline]

Definition at line 181 of file RefToBaseVector.h.

References edm::reftobase::BaseVectorHolder< T >::empty().

  {
    return holder_ ? holder_->empty() : true;
  }
template<class T >
RefToBaseVector< T >::const_iterator RefToBaseVector::end ( void  ) const [inline]
template<typename T >
void RefToBaseVector::fillView ( std::vector< void const * > &  pointers) const

Definition at line 237 of file RefToBaseVector.h.

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

Referenced by edm::fillView().

  {
    pointers.reserve(this->size());
    for (const_iterator i=begin(), e=end(); i!=e; ++i) {
      RefToBase<T> ref = * i;
      member_type const * address = ref.isNull() ? 0 : & * ref;
      pointers.push_back(address);
    }
  }
template<class T >
ProductID RefToBaseVector::id ( void  ) const [inline]

Definition at line 206 of file RefToBaseVector.h.

References edm::reftobase::BaseVectorHolder< T >::id().

Referenced by MatchJet::operator()().

  {
    return holder_ ? holder_->id() : ProductID();
  }
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 69 of file RefToBaseVector.h.

{ return holder_->isAvailable(); }
template<class T>
bool edm::RefToBaseVector< T >::isInvalid ( ) const [inline]

Definition at line 52 of file RefToBaseVector.h.

Referenced by edm::operator==().

{ return holder_ == 0; }
template<class T>
bool edm::RefToBaseVector< T >::isValid ( void  ) const [inline]

Definition at line 51 of file RefToBaseVector.h.

{ return holder_ != 0; }
template<class T >
RefToBaseVector< T > & RefToBaseVector::operator= ( RefToBaseVector< T > const &  iRHS) [inline]

Definition at line 137 of file RefToBaseVector.h.

References edm::swap(), and cond::rpcobtemp::temp.

                                                           {
    RefToBaseVector temp(iRHS);
    this->swap(temp);
    return *this;
  }
template<class T >
RefToBaseVector< T >::value_type RefToBaseVector::operator[] ( size_type  idx) const [inline]

Definition at line 173 of file RefToBaseVector.h.

References asciidump::at.

  {
    return at( idx ); 
  }
template<typename T >
const void * RefToBaseVector::product ( ) const

Definition at line 274 of file RefToBaseVector.h.

References edm::reftobase::BaseVectorHolder< T >::product().

                                                 {
    return holder_ ? holder_->product() : 0;
  }
template<class T >
EDProductGetter const * RefToBaseVector::productGetter ( ) const [inline]

Definition at line 214 of file RefToBaseVector.h.

References edm::reftobase::BaseVectorHolder< T >::productGetter().

  {
    return holder_ ? holder_->productGetter() : 0;
  }
template<typename T>
void RefToBaseVector::push_back ( const RefToBase< T > &  r)
template<class T >
RefToBaseVector< T >::size_type RefToBaseVector::size ( void  ) const [inline]
template<class T >
void RefToBaseVector::swap ( RefToBaseVector< T > &  other) [inline]

Definition at line 146 of file RefToBaseVector.h.

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

Referenced by edm::swap().

                                                 {
    std::swap(holder_, other.holder_);
  }
template<typename T >
std::auto_ptr< reftobase::RefVectorHolderBase > RefToBaseVector::vectorHolder ( ) const

Definition at line 269 of file RefToBaseVector.h.

References edm::reftobase::BaseVectorHolder< T >::vectorHolder().

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

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

Member Data Documentation

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