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 &)
 
 RefToBaseVector (std::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 25 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 109 of file RefToBaseVector.h.

109  :
110  holder_(0)
111  { }
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 116 of file RefToBaseVector.h.

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

Definition at line 285 of file RefToBaseVector.h.

285  :
286  holder_(new reftobase::VectorHolder<T, RefVector<C, typename refhelper::ValueTrait<C>::value,
287  typename refhelper::FindTrait<C, T>::value> >(h.id())) {
288  }
holder_type * holder_
long double T
edm::RefVector< Container > RefVector
template<class T >
RefToBaseVector::RefToBaseVector ( std::shared_ptr< reftobase::RefVectorHolderBase p)
inline

Definition at line 128 of file RefToBaseVector.h.

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

Definition at line 150 of file RefToBaseVector.h.

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

Definition at line 122 of file RefToBaseVector.h.

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

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::errors::InvalidReference, and edm::Exception::throwThis().

159  {
160  if ( holder_ == 0 )
162  "Trying to dereference null RefToBaseVector<T> in method: at(",
163  idx,
164  ")\n");
165  return holder_->at( idx );
166  }
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
holder_type * holder_
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 70 of file RefToBaseVector.h.

72 :
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 235 of file RefToBaseVector.h.

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

Referenced by edm::fillView().

236  {
237  pointers.reserve(this->size());
238  for (const_iterator i=begin(), e=end(); i!=e; ++i) {
239  RefToBase<T> ref = * i;
240  member_type const * address = ref.isNull() ? 0 : & * ref;
241  pointers.push_back(address);
242  }
243  }
int i
Definition: DBlmapReader.cc:9
holder_type::const_iterator const_iterator
const_iterator end() const
size_type size() const
const_iterator begin() const
template<class T >
ProductID RefToBaseVector::id ( void  ) const
inline

Definition at line 204 of file RefToBaseVector.h.

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

Referenced by MatchJet::operator()().

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

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

Definition at line 50 of file RefToBaseVector.h.

Referenced by edm::operator==().

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

Definition at line 49 of file RefToBaseVector.h.

Referenced by core.AutoHandle.AutoHandle::ReallyLoad().

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

Definition at line 135 of file RefToBaseVector.h.

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

135  {
136  RefToBaseVector temp(iRHS);
137  this->swap(temp);
138  return *this;
139  }
void swap(RefToBaseVector &other)
template<class T >
RefToBaseVector< T >::value_type RefToBaseVector::operator[] ( size_type  idx) const
inline

Definition at line 171 of file RefToBaseVector.h.

References asciidump::at.

172  {
173  return at( idx );
174  }
value_type at(size_type idx) const
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
template<typename T >
const void * RefToBaseVector::product ( ) const

Definition at line 272 of file RefToBaseVector.h.

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

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

Definition at line 212 of file RefToBaseVector.h.

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

213  {
214  return holder_ ? holder_->productGetter() : 0;
215  }
virtual EDProductGetter const * productGetter() const =0
holder_type * holder_
template<typename T>
void RefToBaseVector::push_back ( const RefToBase< T > &  r)

Definition at line 258 of file RefToBaseVector.h.

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

Referenced by RecoMuonValidator::analyze(), TkConvValidator::analyze(), PhotonValidator::analyze(), TrackGenAssociatorByChi2Impl::associateGenToReco(), TrackGenAssociatorByChi2::associateGenToReco(), MuonToSimAssociatorByHits::associateMuons(), MuonToTrackingParticleAssociatorByHitsImpl::associateMuons(), TrackGenAssociatorByChi2Impl::associateRecoToGen(), TrackGenAssociatorByChi2::associateRecoToGen(), reco::TrackToTrackingParticleAssociatorBaseImpl::associateRecoToSim(), TrackAssociatorBase::associateRecoToSim(), reco::TrackToTrackingParticleAssociatorBaseImpl::associateSimToReco(), TrackAssociatorBase::associateSimToReco(), BTagPerformanceAnalyzerMC::getJetWithFlavour(), MatchJet::matchCollections(), helper::SelectionRefViewAdder< T >::operator()(), TagProbeMassProducer::produce(), MuonMCClassifier::produce(), and pat::helper::TriggerMatchHelper::triggerMatchCandidates().

258  {
259  if ( holder_ == 0 ) {
260  std::auto_ptr<reftobase::BaseVectorHolder<T> > p = r.holder_->makeVectorHolder();
261  holder_ = p.release();
262  }
263  holder_->push_back( r.holder_ );
264  }
virtual void push_back(BaseHolder< T > const *)=0
holder_type * holder_
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 144 of file RefToBaseVector.h.

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

Referenced by edm::swap().

144  {
145  std::swap(holder_, other.holder_);
146  }
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 267 of file RefToBaseVector.h.

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

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

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

Member Data Documentation

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