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.
std::vector< void const * >::const_iterator void_begin() const
bool isNull() const
Checks for null.
bool checkCachedItems() const
TPtr makePtr(unsigned long iIndex) const
PtrVectorBase & operator=(const PtrVectorBase &)=delete
bool empty() const
Is the RefVector empty.
void swap(PtrVectorBase &other)
swap
virtual std::type_info const & typeInfo() const
static const std::vector< void const * > & emptyCache()
ProductID id() const
Accessor for product ID.
bool operator!() const
Checks for null.
bool isNonnull() const
Checks for non-null.
std::vector< key_type > indicies_
std::atomic< std::vector< void const * > * > cachedItems_
bool operator==(PtrVectorBase const &iRHS) const
void setProductGetter(EDProductGetter *iGetter) const
size_type capacity() const
Capacity of the RefVector.
std::vector< void const * >::const_iterator void_end() const
TPtr makePtr(std::vector< void const * >::const_iterator const iIt) const
EDProductGetter const * productGetter() 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)
void setProductGetter(EDProductGetter const *prodGetter) const
EDProductGetter const * productGetter() const
Accessor for product getter.
void const * product() const