1 #ifndef DataFormats_Common_PtrVectorBase_h 2 #define DataFormats_Common_PtrVectorBase_h 38 void const* prodPtr =
nullptr,
98 (*cachedItems_).reserve(
n);
106 void const*
product()
const {
return nullptr; }
116 std::vector<void const*>::const_iterator
void_begin()
const {
121 return (*cachedItems_).begin();
123 std::vector<void const*>::const_iterator
void_end()
const {
128 return (*cachedItems_).end();
131 template <
typename TPtr>
134 return TPtr(reinterpret_cast<typename TPtr::value_type const*>((*
cachedItems_)[iIndex]),
indicies_[iIndex]);
138 this->
id(), reinterpret_cast<typename TPtr::value_type const*>((*
cachedItems_)[iIndex]),
indicies_[iIndex]);
143 template <
typename TPtr>
144 TPtr
makePtr(std::vector<void const*>::const_iterator
const iIt)
const {
146 return TPtr(reinterpret_cast<typename TPtr::value_type const*>(*iIt),
indicies_[iIt - (*cachedItems_).begin()]);
149 return TPtr(this->
id(),
150 reinterpret_cast<typename TPtr::value_type const*>(*iIt),
151 indicies_[iIt - (*cachedItems_).begin()]);
168 static const std::vector<void const*>&
emptyCache();
void push_back_base(RefCore const &core, key_type iKey, void const *iData)
size_type size() const
Size of the RefVector.
size_type capacity() const
Capacity of the RefVector.
bool isNull() const
Checks for null.
EDProductGetter const * productGetter() const
Accessor for product getter.
PtrVectorBase & operator=(const PtrVectorBase &)=delete
void swap(PtrVectorBase &other)
swap
void setProductGetter(EDProductGetter *iGetter) const
bool isNonnull() const
Checks for non-null.
bool operator==(PtrVectorBase const &iRHS) const
TEMPL(T2) struct Divides void
bool empty() const
Is the RefVector empty.
bool operator!() const
Checks for null.
void const * product() const
std::vector< key_type > indicies_
std::atomic< std::vector< void const * > * > cachedItems_
bool checkCachedItems() const
ProductID id() const
Accessor for product ID.
std::vector< void const * >::const_iterator void_end() const
static const std::vector< void const * > & emptyCache()
TPtr makePtr(std::vector< void const *>::const_iterator const iIt) const
void reserve(size_type n)
Reserve space for RefVector.
void clear()
Clear the PtrVector.
PtrVectorBase(ProductID const &productID, void const *prodPtr=nullptr, EDProductGetter const *prodGetter=nullptr)
virtual std::type_info const & typeInfo() const
std::vector< void const * >::const_iterator void_begin() const
EDProductGetter const * productGetter() const
void setProductGetter(EDProductGetter const *prodGetter) const
TPtr makePtr(unsigned long iIndex) const