CMS 3D CMS Logo

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< Tholder_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, FillViewHelperVector &helpers) const
 
ProductID id () const
 
bool isAvailable () const
 
bool isInvalid () const
 
bool isValid () const
 
RefToBaseVectoroperator= (RefToBaseVector const &iRHS)
 
value_type operator[] (size_type idx) 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 REFV >
 RefToBaseVector (const REFV &iRef)
 
template<class T >
 RefToBaseVector (const RefToBaseVector< T > &iOther)
 
template<typename C >
 RefToBaseVector (const Handle< C > &h)
 
size_type size () const
 
void swap (RefToBaseVector &other)
 
std::unique_ptr< reftobase::RefVectorHolderBasevectorHolder () 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 29 of file EDProductfwd.h.

Member Typedef Documentation

Definition at line 37 of file RefToBaseVector.h.

Definition at line 35 of file RefToBaseVector.h.

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

Definition at line 34 of file RefToBaseVector.h.

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

Definition at line 36 of file RefToBaseVector.h.

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

Definition at line 33 of file RefToBaseVector.h.

Constructor & Destructor Documentation

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

Definition at line 110 of file RefToBaseVector.h.

110 : holder_(nullptr) {}
holder_type * holder_
template<class T>
edm::RefToBaseVector< T >::RefToBaseVector ( RefToBaseVector< T > const &  )
template<class T>
template<class REFV >
edm::RefToBaseVector< T >::RefToBaseVector ( REFV const &  )
explicit
template<class T>
template<typename C >
edm::RefToBaseVector< T >::RefToBaseVector ( Handle< C > const &  )
explicit
template<class T >
RefToBaseVector::RefToBaseVector ( std::shared_ptr< reftobase::RefVectorHolderBase p)
inline

Definition at line 121 of file RefToBaseVector.h.

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

Definition at line 137 of file RefToBaseVector.h.

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

137  {
138  delete holder_;
139  }
holder_type * holder_
template<class T>
template<class REFV >
edm::RefToBaseVector< T >::RefToBaseVector ( const REFV &  iRef)
inline

Definition at line 114 of file RefToBaseVector.h.

114 : holder_(new reftobase::VectorHolder<T, REFV>(iRef)) {}
holder_type * holder_
template<class T>
template<class T >
edm::RefToBaseVector< T >::RefToBaseVector ( const RefToBaseVector< T > &  iOther)
inline

Definition at line 117 of file RefToBaseVector.h.

118  : holder_(iOther.holder_ ? iOther.holder_->clone() : nullptr) {}
holder_type * holder_
template<class T>
template<typename C >
edm::RefToBaseVector< T >::RefToBaseVector ( const Handle< C > &  h)

Definition at line 238 of file RefToBaseVector.h.

239  : holder_(new reftobase::VectorHolder<
240  T,
242  h.id())) {}
holder_type * holder_
FindUsingAdvance< C, T > value
Definition: RefTraits.h:42
long double T
edm::RefVector< Container > RefVector

Member Function Documentation

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

Definition at line 142 of file RefToBaseVector.h.

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

Referenced by edm::RefToBaseVector< T >::operator[](), and MuonSimClassifier::produce().

142  {
143  if (holder_ == nullptr)
145  errors::InvalidReference, "Trying to dereference null RefToBaseVector<T> in method: at(", idx, ")\n");
146  return holder_->at(idx);
147  }
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:83
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 76 of file RefToBaseVector.h.

78 :
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,
FillViewHelperVector helpers 
) const

Definition at line 191 of file RefToBaseVector.h.

References edm::RefToBaseVector< T >::begin(), MillePedeFileConverter_cfg::e, edm::RefToBaseVector< T >::end(), mps_fire::i, edm::RefToBase< T >::id(), edm::RefToBase< T >::isNull(), edm::RefToBase< T >::key(), and edm::RefToBaseVector< T >::size().

Referenced by edm::fillView().

191  {
192  pointers.reserve(this->size());
193  helpers.reserve(this->size());
194  for (const_iterator i = begin(), e = end(); i != e; ++i) {
195  RefToBase<T> ref = *i;
196  member_type const* address = ref.isNull() ? nullptr : &*ref;
197  pointers.push_back(address);
198  helpers.push_back(FillViewHelperVector::value_type(ref.id(), ref.key()));
199  }
200  }
holder_type::const_iterator const_iterator
const_iterator end() const
size_type size() const
const_iterator begin() const
template<class T >
ProductID RefToBaseVector::id ( ) const
inline

Definition at line 171 of file RefToBaseVector.h.

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

Referenced by TrackingNtuple::fillVertices(), and MatchJet::operator()().

171  {
172  return holder_ ? holder_->id() : ProductID();
173  }
holder_type * holder_
virtual ProductID id() const =0
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 73 of file RefToBaseVector.h.

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

Definition at line 57 of file RefToBaseVector.h.

Referenced by edm::operator==().

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

Definition at line 56 of file RefToBaseVector.h.

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

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

Definition at line 125 of file RefToBaseVector.h.

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

125  {
126  RefToBaseVector temp(iRHS);
127  this->swap(temp);
128  return *this;
129  }
void swap(RefToBaseVector &other)
template<class T >
RefToBaseVector< T >::value_type RefToBaseVector::operator[] ( size_type  idx) const
inline

Definition at line 150 of file RefToBaseVector.h.

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

150  {
151  return at(idx);
152  }
value_type at(size_type idx) const
template<class T >
EDProductGetter const * RefToBaseVector::productGetter ( ) const
inline

Definition at line 176 of file RefToBaseVector.h.

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

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

Definition at line 217 of file RefToBaseVector.h.

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

Referenced by RecoMuonValidator::analyze(), TkConvValidator::analyze(), PhotonValidator::analyze(), TrackingNtuple::analyze(), TrackGenAssociatorByChi2Impl::associateGenToReco(), MuonToSimAssociatorByHits::associateMuons(), MuonToTrackingParticleAssociatorByHitsImpl::associateMuons(), TrackGenAssociatorByChi2Impl::associateRecoToGen(), MuonAssociatorByHits::associateRecoToSim(), reco::TrackToTrackingParticleAssociatorBaseImpl::associateRecoToSim(), reco::TrackToTrackingParticleAssociatorBaseImpl::associateSimToReco(), MuonAssociatorByHits::associateSimToReco(), MultiTrackValidator::dqmAnalyze(), TrackingNtuple::fillSeeds(), BTagPerformanceAnalyzerMC::getJetWithFlavour(), MatchJet::matchCollections(), helper::SelectionRefViewAdder< T >::operator()(), TagProbeMassProducer::produce(), PFRecoTauChargedHadronProducer::produce(), MuonMCClassifier::produce(), MuonSimClassifier::produce(), RecoTrackViewRefSelector::select(), and pat::helper::TriggerMatchHelper::triggerMatchCandidates().

217  {
218  if (holder_ == nullptr) {
219  std::unique_ptr<reftobase::BaseVectorHolder<T> > p = r.holder_->makeVectorHolder();
220  holder_ = p.release();
221  }
222  holder_->push_back(r.holder_);
223  }
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 132 of file RefToBaseVector.h.

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

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

132  {
133  std::swap(holder_, other.holder_);
134  }
holder_type * holder_
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
template<typename T >
std::unique_ptr< reftobase::RefVectorHolderBase > RefToBaseVector::vectorHolder ( ) const

Definition at line 226 of file RefToBaseVector.h.

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

226  {
227  return holder_ ? holder_->vectorHolder() : std::unique_ptr<reftobase::RefVectorHolderBase>();
228  }
holder_type * holder_
virtual std::unique_ptr< RefVectorHolderBase > vectorHolder() const =0

Member Data Documentation

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