|
|
Go to the documentation of this file. 1 #ifndef DataFormats_Common_PtrVectorBase_h
2 #define DataFormats_Common_PtrVectorBase_h
38 void const* prodPtr =
nullptr,
96 (*cachedItems_).reserve(
n);
104 void const*
product()
const {
return nullptr; }
114 std::vector<void const*>::const_iterator
void_begin()
const {
119 return (*cachedItems_).begin();
121 std::vector<void const*>::const_iterator
void_end()
const {
126 return (*cachedItems_).end();
129 template <
typename TPtr>
132 return TPtr(reinterpret_cast<typename TPtr::value_type const*>((*
cachedItems_)[iIndex]),
indicies_[iIndex]);
136 this->
id(), reinterpret_cast<typename TPtr::value_type const*>((*
cachedItems_)[iIndex]),
indicies_[iIndex]);
141 template <
typename TPtr>
142 TPtr
makePtr(std::vector<void const*>::const_iterator
const iIt)
const {
144 return TPtr(reinterpret_cast<typename TPtr::value_type const*>(*iIt),
indicies_[iIt - (*cachedItems_).begin()]);
147 return TPtr(this->
id(),
148 reinterpret_cast<typename TPtr::value_type const*>(*iIt),
149 indicies_[iIt - (*cachedItems_).begin()]);
168 static const std::vector<void const*>&
emptyCache();
PtrVectorBase(ProductID const &productID, void const *prodPtr=nullptr, EDProductGetter const *prodGetter=nullptr)
void setProductGetter(EDProductGetter const *prodGetter) const
size_type size() const
Size of the RefVector.
bool isNull() const
Checks for null.
void push_back_base(RefCore const &core, key_type iKey, void const *iData)
EDProductGetter const * productGetter() const
Accessor for product getter.
void const * product() const
size_type capacity() const
Capacity of the RefVector.
bool checkCachedItems() const
EDProductGetter const * productGetter() const
void setProductGetter(EDProductGetter *iGetter) const
std::vector< key_type > indicies_
bool isNonnull() const
Checks for non-null.
bool operator!() const
Checks for null.
bool operator==(PtrVectorBase const &iRHS) const
bool empty() const
Is the RefVector empty.
std::atomic< std::vector< void const * > * > cachedItems_
static const std::vector< void const * > & emptyCache()
ProductID id() const
Accessor for product ID.
void clear()
Clear the PtrVector.
std::vector< void const * >::const_iterator void_end() const
virtual std::type_info const & typeInfo() const
std::vector< void const * >::const_iterator void_begin() const
TEMPL(T2) struct Divides void
TPtr makePtr(unsigned long iIndex) const
PtrVectorBase & operator=(const PtrVectorBase &)=delete
TPtr makePtr(std::vector< void const * >::const_iterator const iIt) const
void swap(PtrVectorBase &other)
swap
void reserve(size_type n)
Reserve space for RefVector.