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 T >
 RefToBaseVector (const RefToBaseVector< T > &iOther)
 
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) {}
holder_type * holder_

◆ 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)) {}
holder_type * holder_

◆ 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())) {}
holder_type * holder_
FindUsingAdvance< C, T > value
Definition: RefTraits.h:42
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
long double T
edm::RefVector< Container > RefVector

◆ 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)) {}
holder_type * holder_

◆ ~RefToBaseVector()

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

Definition at line 137 of file RefToBaseVector.h.

137  {
138  delete holder_;
139  }
holder_type * holder_

◆ 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) {}
holder_type * holder_

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  }
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:85
holder_type * holder_
virtual base_ref_type const at(size_type idx) const =0

◆ 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 :
reftobase::BaseVectorHolder< T > holder_type
holder_type * holder_

◆ clear()

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

Definition at line 165 of file RefToBaseVector.h.

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

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

◆ 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  }
holder_type * holder_
virtual bool empty() const =0

◆ 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  }
holder_type::const_iterator const_iterator
size_type size() const
const_iterator begin() const
const_iterator end() const

◆ id()

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

Definition at line 171 of file RefToBaseVector.h.

Referenced by MatchJet::operator()().

171  {
172  return holder_ ? holder_->id() : ProductID();
173  }
virtual ProductID id() const =0
holder_type * holder_

◆ 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(); }
virtual bool isAvailable() const =0
holder_type * holder_

◆ isInvalid()

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

Definition at line 57 of file RefToBaseVector.h.

57 { return holder_ == nullptr; }
holder_type * holder_

◆ isValid()

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_

◆ 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  }
void swap(RefToBaseVector &other)

◆ 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  }
value_type at(size_type idx) const

◆ 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  }
virtual EDProductGetter const * productGetter() const =0
holder_type * holder_

◆ 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  }
void swap(RefToBaseVector< T > &a, RefToBaseVector< T > &b)
holder_type * holder_

◆ 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  }
holder_type * holder_
virtual std::unique_ptr< RefVectorHolderBase > vectorHolder() const =0

Member Data Documentation

◆ holder_

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