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 ()
 
template<class T >
 RefToBaseVector (const RefToBaseVector< T > &iOther)
 
template<typename C >
 RefToBaseVector (Handle< C > const &)
 
 RefToBaseVector (RefToBaseVector const &)
 
template<class REFV >
 RefToBaseVector (REFV const &)
 
 RefToBaseVector (std::shared_ptr< reftobase::RefVectorHolderBase > p)
 
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

◆ const_iterator

Definition at line 37 of file RefToBaseVector.h.

◆ holder_type

Definition at line 35 of file RefToBaseVector.h.

◆ member_type

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

Definition at line 34 of file RefToBaseVector.h.

◆ size_type

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

Definition at line 36 of file RefToBaseVector.h.

◆ value_type

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

Definition at line 33 of file RefToBaseVector.h.

Constructor & Destructor Documentation

◆ RefToBaseVector() [1/6]

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

Definition at line 110 of file RefToBaseVector.h.

110 : holder_(nullptr) {}

◆ RefToBaseVector() [2/6]

template<class T>
edm::RefToBaseVector< T >::RefToBaseVector ( RefToBaseVector< T > const &  )

◆ RefToBaseVector() [3/6]

template<class T >
template<class REFV >
RefToBaseVector::RefToBaseVector ( REFV const &  iRef)
inlineexplicit

Definition at line 114 of file RefToBaseVector.h.

114 : holder_(new reftobase::VectorHolder<T, REFV>(iRef)) {}

◆ RefToBaseVector() [4/6]

template<typename T >
template<typename C >
RefToBaseVector::RefToBaseVector ( Handle< C > const &  h)
explicit

Definition at line 238 of file RefToBaseVector.h.

239  : holder_(new reftobase::VectorHolder<
240  T,
242  h.id())) {}

◆ RefToBaseVector() [5/6]

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)) {}

◆ ~RefToBaseVector()

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

Definition at line 137 of file RefToBaseVector.h.

137  {
138  delete holder_;
139  }

◆ RefToBaseVector() [6/6]

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) {}

Member Function Documentation

◆ at()

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

Definition at line 142 of file RefToBaseVector.h.

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  }

◆ begin()

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

◆ Class_Version()

template<class T>
static short edm::RefToBaseVector< T >::Class_Version ( )
inlinestatic

Definition at line 76 of file RefToBaseVector.h.

78 :

◆ clear()

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

Definition at line 165 of file RefToBaseVector.h.

165  {
166  if (holder_ != nullptr)
167  holder_->clear();
168  }

Referenced by MatchJet::matchCollections(), RecoTrackViewRefSelector::select(), and BeautifulSoup.Tag::setString().

◆ empty()

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

Definition at line 155 of file RefToBaseVector.h.

155  {
156  return holder_ ? holder_->empty() : true;
157  }

◆ end()

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

◆ fillView()

template<typename T >
void RefToBaseVector::fillView ( std::vector< void const * > &  pointers,
FillViewHelperVector helpers 
) const

Definition at line 191 of file RefToBaseVector.h.

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  }

◆ id()

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

Definition at line 171 of file RefToBaseVector.h.

171  {
172  return holder_ ? holder_->id() : ProductID();
173  }

Referenced by MatchJet::operator()().

◆ isAvailable()

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(); }

◆ isInvalid()

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

Definition at line 57 of file RefToBaseVector.h.

57 { return holder_ == nullptr; }

◆ isValid()

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

Definition at line 56 of file RefToBaseVector.h.

56 { return holder_ != nullptr; }

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

◆ operator=()

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

Definition at line 125 of file RefToBaseVector.h.

125  {
126  RefToBaseVector temp(iRHS);
127  this->swap(temp);
128  return *this;
129  }

◆ operator[]()

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

Definition at line 150 of file RefToBaseVector.h.

150  {
151  return at(idx);
152  }

◆ productGetter()

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

Definition at line 176 of file RefToBaseVector.h.

176  {
177  return holder_ ? holder_->productGetter() : nullptr;
178  }

◆ push_back()

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

◆ size()

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

◆ swap()

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

Definition at line 132 of file RefToBaseVector.h.

132  {
133  std::swap(holder_, other.holder_);
134  }

◆ vectorHolder()

template<typename T >
std::unique_ptr< reftobase::RefVectorHolderBase > RefToBaseVector::vectorHolder ( ) const

Definition at line 226 of file RefToBaseVector.h.

226  {
227  return holder_ ? holder_->vectorHolder() : std::unique_ptr<reftobase::RefVectorHolderBase>();
228  }

Member Data Documentation

◆ holder_

template<class T>
holder_type* edm::RefToBaseVector< T >::holder_
private
edm::RefToBaseVector::end
const_iterator end() const
Definition: RefToBaseVector.h:186
mps_fire.i
i
Definition: mps_fire.py:428
edm::errors::InvalidReference
Definition: EDMException.h:39
edm::reftobase::BaseVectorHolder::size
virtual size_type size() const =0
edm::RefToBaseVector::swap
void swap(RefToBaseVector &other)
Definition: RefToBaseVector.h:132
edm::reftobase::BaseVectorHolder::id
virtual ProductID id() const =0
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
reco::JetExtendedAssociation::RefVector
edm::RefVector< Container > RefVector
Definition: JetExtendedAssociation.h:34
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
edm::reftobase::BaseVectorHolder::empty
virtual bool empty() const =0
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
trackingPlots.other
other
Definition: trackingPlots.py:1464
h
edm::RefToBaseVector::const_iterator
holder_type::const_iterator const_iterator
Definition: RefToBaseVector.h:37
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::RefToBaseVector::at
value_type at(size_type idx) const
Definition: RefToBaseVector.h:142
helpers
Definition: makeCompositeCandidate.h:8
RefToBaseVector
RefToBase
edm::reftobase::BaseVectorHolder::push_back
virtual void push_back(BaseHolder< T > const *)=0
edm::reftobase::BaseVectorHolder::vectorHolder
virtual std::unique_ptr< RefVectorHolderBase > vectorHolder() const =0
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::RefToBaseVector::size
size_type size() const
Definition: RefToBaseVector.h:160
edm::reftobase::BaseVectorHolder::productGetter
virtual EDProductGetter const * productGetter() const =0
edm::RefToBaseVector::holder_type
reftobase::BaseVectorHolder< T > holder_type
Definition: RefToBaseVector.h:35
gen::C
C
Definition: PomwigHadronizer.cc:78
edm::reftobase::BaseVectorHolder::end
virtual const_iterator end() const =0
T
long double T
Definition: Basic3DVectorLD.h:48
edm::Exception::throwThis
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:83
edm::RefToBaseVector::holder_
holder_type * holder_
Definition: RefToBaseVector.h:79
edm::RefToBaseVector::begin
const_iterator begin() const
Definition: RefToBaseVector.h:181
edm::reftobase::BaseVectorHolder::isAvailable
virtual bool isAvailable() const =0
edm::RefToBaseVector::member_type
T member_type
Definition: RefToBaseVector.h:34
edm::refhelper::FindTrait::value
FindUsingAdvance< C, T > value
Definition: RefTraits.h:42
edm::reftobase::BaseVectorHolder::begin
virtual const_iterator begin() const =0
edm::reftobase::BaseVectorHolder::clear
virtual void clear()=0
edm::refhelper::ValueTrait::value
C::value_type value
Definition: RefTraits.h:57
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::reftobase::BaseVectorHolder::at
virtual const base_ref_type at(size_type idx) const =0