1 #ifndef DataFormats_Common_PtrVectorBase_h
2 #define DataFormats_Common_PtrVectorBase_h
40 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
85 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
115 std::vector<void const*>::const_iterator
void_begin()
const {
120 return (*cachedItems_).begin();
122 std::vector<void const*>::const_iterator
void_end()
const {
127 return (*cachedItems_).end();
130 template<
typename TPtr>
133 return TPtr(reinterpret_cast<typename TPtr::value_type const*>((*
cachedItems_)[iIndex]),
137 return TPtr(this->
id(),
138 reinterpret_cast<typename TPtr::value_type const*>((*
cachedItems_)[iIndex]),
144 template<
typename TPtr>
145 TPtr
makePtr(std::vector<void const*>::const_iterator
const iIt)
const {
147 return TPtr(reinterpret_cast<typename TPtr::value_type const*>(*iIt),
148 indicies_[iIt - (*cachedItems_).begin()]);
151 return TPtr(this->
id(),
152 reinterpret_cast<typename TPtr::value_type const*>(*iIt),
153 indicies_[iIt - (*cachedItems_).begin()]);
163 return *
reinterpret_cast<const std::type_info*
>(0);
172 static const std::vector<void const*>&
emptyCache();
177 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
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
PtrVectorBase(ProductID const &productID, void const *prodPtr=0, EDProductGetter const *prodGetter=0)
bool isNull() const
Checks for null.
bool checkCachedItems() const
TPtr makePtr(unsigned long iIndex) const
PtrVectorBase & operator=(const PtrVectorBase &)
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.
void setProductGetter(EDProductGetter const *prodGetter) const
EDProductGetter const * productGetter() const
Accessor for product getter.
void const * product() const