1 #ifndef DataFormats_Common_PtrVector_h 2 #define DataFormats_Common_PtrVector_h 28 #include <type_traits> 51 class PtrVectorItr :
public std::iterator<std::random_access_iterator_tag, Ptr<T> > {
59 : iter_(iItr), base_(iBase) {}
64 return base_->fromItr(iter_ + n);
107 difference_type
operator-(iterator
const& rhs)
const {
return this->iter_ - rhs.
iter_; }
117 std::vector<void const*>::const_iterator
iter_;
121 template <
typename T>
135 template <
typename U>
142 Ptr<T> operator[](
unsigned long const iIndex)
const {
return this->makePtr<Ptr<T> >(iIndex); }
144 const_iterator
begin()
const {
return const_iterator(this->void_begin(),
this); }
146 const_iterator
end()
const {
return const_iterator(this->void_end(),
this); }
150 this->push_back_base(
154 template <
typename U>
158 "Ptr used in push_back can not be converted to type used by PtrVector.");
159 this->push_back_base(
178 std::type_info
const& typeInfo()
const override {
return typeid(
T); }
181 Ptr<T> fromItr(std::vector<void const*>::const_iterator
const& iItr)
const {
return this->makePtr<Ptr<T> >(iItr); }
184 template <
typename T>
186 pointers.reserve(this->
size());
189 T const* address = ref.
isNull() ?
nullptr : &*ref;
190 pointers.push_back(address);
195 template <
typename T>
198 std::vector<void const*>& pointers,
203 template <
typename T>
209 template <
typename T>
Ptr< T > fromItr(std::vector< void const * >::const_iterator const &iItr) const
iterator operator+(difference_type n) const
std::vector< void const * >::const_iterator iter_
difference_type operator-(iterator const &rhs) const
void swap(PtrVector &other)
void push_back(Ptr< T > const &iPtr)
PtrVectorItr< T > const_iterator
bool operator<=(iterator const &rhs) const
void swap(PtrVectorBase &other)
swap
PtrVectorItr(std::vector< void const * >::const_iterator const &iItr, PtrVector< T > const *iBase)
PtrVector< T > const * base_
iterator & operator-=(difference_type n)
#define CMS_CLASS_VERSION(_version_)
PtrHolder< T > operator->() const
void swap(Association< C > &lhs, Association< C > &rhs)
const_iterator begin() const
void fillView(std::vector< void const * > &pointers, FillViewHelperVector &helpers) const
Container::value_type value_type
iterator operator-(difference_type n) const
std::iterator< std::random_access_iterator_tag, Ptr< T > >::difference_type difference_type
void fillView(AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper > const &obj, ProductID const &id, std::vector< void const * > &pointers, FillViewHelperVector &helpers)
bool isNull() const
Checks for null.
RefCore const & refCore() const
const_iterator end() const
PtrVector(ProductID const &iId)
iterator & operator+=(difference_type n)
Ptr< T > const operator*() const
void push_back(Ptr< U > const &iPtr)
PtrVector & operator=(PtrVector const &rhs)
PtrHolder(Ptr< T > const &iPtr)
bool hasProductCache() const
PtrVectorItr< T > iterator
Ptr< T > const & operator*() const
ProductID id() const
Accessor for product ID.
PtrVectorItr< T > iterator
bool operator>(iterator const &rhs) const
Ptr< T > const * operator->() const
Ptr< T > operator[](unsigned long const iIndex) const
bool operator<(iterator const &rhs) const
Ptr< T > const operator[](difference_type n) const
bool operator>=(iterator const &rhs) const
bool operator==(iterator const &rhs) const
PtrVector(PtrVector< T > const &iOther)
PtrVector(PtrVector< U > const &iOther)
bool operator!=(iterator const &rhs) const
std::vector< std::pair< edm::ProductID, unsigned long > > FillViewHelperVector