CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
edm::RefToBaseVector< T > Class Template Reference

#include <EDProductfwd.h>

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 > &)
 
 RefToBaseVector ()
 
 RefToBaseVector (RefToBaseVector const &)
 
template<class REFV >
 RefToBaseVector (REFV const &)
 
template<typename C >
 RefToBaseVector (Handle< C > const &)
 
template<typename T1 >
 RefToBaseVector (Handle< View< T1 > > const &)
 
 RefToBaseVector (boost::shared_ptr< reftobase::RefVectorHolderBase > p)
 
template<class T >
 RefToBaseVector (const RefToBaseVector< T > &iOther)
 
size_type size () const
 
void swap (RefToBaseVector &other)
 
std::auto_ptr
< reftobase::RefVectorHolderBase
vectorHolder () const
 
 ~RefToBaseVector ()
 

Static Public Member Functions

static short Class_Version ()
 

Private Attributes

holder_typeholder_
 

Detailed Description

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

RefToBase<T> provides a mechanism to refer to an object of type T (or which has T as a public base), held in a collection (of type not known to RefToBase<T>) which itself it in an Event.

Definition at line 26 of file EDProductfwd.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.

111  :
112  holder_(0)
113  { }
holder_type * holder_
template<class T>
edm::RefToBaseVector< T >::RefToBaseVector ( RefToBaseVector< T > const &  )
template<class T >
template<class REFV >
RefToBaseVector::RefToBaseVector ( REFV const &  iRef)
inlineexplicit

Definition at line 118 of file RefToBaseVector.h.

118  :
119  holder_(new reftobase::VectorHolder<T,REFV>(iRef))
120  { }
holder_type * holder_
template<typename T >
template<typename C >
RefToBaseVector::RefToBaseVector ( Handle< C > const &  h)
explicit

Definition at line 288 of file RefToBaseVector.h.

288  :
289  holder_(new reftobase::VectorHolder<T, RefVector<C, typename refhelper::ValueTrait<C>::value,
290  typename refhelper::FindTrait<C, T>::value> >(h.id())) {
291  }
holder_type * holder_
long double T
edm::RefVector< Container > RefVector
template<typename T >
template<typename T1 >
RefToBaseVector::RefToBaseVector ( Handle< View< T1 > > const &  h)
explicit

Definition at line 295 of file RefToBaseVector.h.

295  :
296  holder_(h->refVector().holder_->cloneEmpty()) {
297  }
holder_type * holder_
template<class T >
RefToBaseVector::RefToBaseVector ( boost::shared_ptr< reftobase::RefVectorHolderBase p)
inline

Definition at line 130 of file RefToBaseVector.h.

130  :
131  holder_(new reftobase::IndirectVectorHolder<T>(p)) {
132  }
holder_type * holder_
template<class T >
RefToBaseVector::~RefToBaseVector ( )
inline

Definition at line 152 of file RefToBaseVector.h.

153  {
154  delete holder_;
155  }
holder_type * holder_
template<class T>
template<class T >
edm::RefToBaseVector< T >::RefToBaseVector ( const RefToBaseVector< T > &  iOther)
inline

Definition at line 124 of file RefToBaseVector.h.

124  :
125  holder_(iOther.holder_ ? iOther.holder_->clone() : 0)
126  { }
holder_type * holder_

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().

161  {
162  if ( holder_ == 0 )
164  "Trying to dereference null RefToBaseVector<T> in method: at(",
165  idx,
166  ")\n");
167  return holder_->at( idx );
168  }
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
holder_type * holder_
virtual base_ref_type const at(size_type idx) const =0
template<class T >
RefToBaseVector< T >::const_iterator RefToBaseVector::begin ( void  ) const
inline
template<class T>
static short edm::RefToBaseVector< T >::Class_Version ( )
inlinestatic

Definition at line 72 of file RefToBaseVector.h.

74 :
reftobase::BaseVectorHolder< T > holder_type
holder_type * holder_
template<class T >
void RefToBaseVector::clear ( void  )
inline
template<class T >
bool RefToBaseVector::empty ( ) const
inline
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, alignCSCRings::e, end, i, edm::RefToBase< T >::isNull(), and findQualityFiles::size.

Referenced by edm::fillView().

238  {
239  pointers.reserve(this->size());
240  for (const_iterator i=begin(), e=end(); i!=e; ++i) {
241  RefToBase<T> ref = * i;
242  member_type const * address = ref.isNull() ? 0 : & * ref;
243  pointers.push_back(address);
244  }
245  }
int i
Definition: DBlmapReader.cc:9
holder_type::const_iterator const_iterator
char * address
Definition: mlp_lapack.h:14
const_iterator end() const
size_type size() const
const_iterator begin() const
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()().

207  {
208  return holder_ ? holder_->id() : ProductID();
209  }
virtual ProductID id() const =0
holder_type * holder_
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.

69 { return holder_->isAvailable(); }
virtual bool isAvailable() const =0
holder_type * holder_
template<class T>
bool edm::RefToBaseVector< T >::isInvalid ( ) const
inline

Definition at line 52 of file RefToBaseVector.h.

Referenced by edm::operator==().

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

Definition at line 51 of file RefToBaseVector.h.

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

Definition at line 137 of file RefToBaseVector.h.

References edm::swap(), and groupFilesInBlocks::temp.

137  {
138  RefToBaseVector temp(iRHS);
139  this->swap(temp);
140  return *this;
141  }
void swap(RefToBaseVector &other)
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.

174  {
175  return at( idx );
176  }
value_type at(size_type idx) const
template<typename T >
const void * RefToBaseVector::product ( ) const

Definition at line 274 of file RefToBaseVector.h.

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

274  {
275  return holder_ ? holder_->product() : 0;
276  }
virtual void const * product() const =0
holder_type * holder_
template<class T >
EDProductGetter const * RefToBaseVector::productGetter ( ) const
inline

Definition at line 214 of file RefToBaseVector.h.

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

215  {
216  return holder_ ? holder_->productGetter() : 0;
217  }
virtual EDProductGetter const * productGetter() const =0
holder_type * holder_
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 std::swap().

Referenced by edm::swap().

146  {
147  std::swap(holder_, other.holder_);
148  }
holder_type * holder_
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
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().

269  {
270  return holder_ ? holder_->vectorHolder() : std::auto_ptr<reftobase::RefVectorHolderBase>();
271  }
holder_type * holder_
virtual std::auto_ptr< RefVectorHolderBase > vectorHolder() const =0

Member Data Documentation

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