48#ifndef ATHCONTAINERS_DATAVECTORWITHALLOC_H
49#define ATHCONTAINERS_DATAVECTORWITHALLOC_H
64template <
class DV,
class ALLOC>
104 typedef typename std::reverse_iterator<iterator>
122 using DV::trackIndices;
123 using DV::testInsert;
124 using DV::getConstStore;
126 using DV::setConstStore;
127 using DV::setNonConstStore;
128 using DV::hasNonConstStore;
145 using DV::operator[];
178 using base_ptr = std::unique_ptr<base_value_type, UPDeleter>;
184 Ptr(std::nullptr_t)
noexcept;
187 Ptr& operator= (
Ptr&&) noexcept = default;
188 Ptr& operator= (
std::nullptr_t) noexcept;
225 using Base = std::unique_ptr<DataVectorWithAlloc>;
227 operator std::unique_ptr<const DV> () &&
noexcept
674 template <class...
Args>
775 using Base =
typename DV::Deleter;
796template <class DV, class ALLOC>
804#ifndef XAOD_STANDALONE
812template <
class DV,
class ALLOC>
833template <
class DV,
class ALLOC>
860template <
class DV,
class ALLOC,
class U>
864 static void init() { DV::dvlinfo(); }
872template <
class DV,
class ALLOC>
STL-style allocator wrapper for ArenaHeapAllocator.
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
An STL vector of pointers that by default owns its pointed-to elements.
void swap(DataVector< T > &a, DataVector< T > &b)
See DataVector<T, BASE>::swap().
char data[hepevt_bytes_allocation_ATLAS]
Proxy for lvalue access to DataVector/DataList elements.
(Non-const) Iterator class for DataVector/DataList.
Helper for unique_ptr conversions.
std::unique_ptr< DataVectorWithAlloc > Base
typename DV::Deleter Base
virtual void doDelete(value_type p) override
typename Base::PtrVector PtrVector
elt_allocator_type & heap() noexcept
elt_allocator_type m_heap
HeapDeleter(elt_allocator_type &&heap)
typename Base::value_type value_type
unique_ptr holding an element for this vector.
friend class DataVectorWithAlloc
std::unique_ptr< base_value_type, UPDeleter > base_ptr
base_ptr m_ptr
Underlying unique_ptr.
void swap(Ptr &other) noexcept
typename base_ptr::element_type element_type
void checkHeap(const elt_allocator_type *other_heap) const
typename base_ptr::pointer pointer
pointer release() noexcept
Ptr(std::nullptr_t) noexcept
pointer get() const noexcept
Internal helper to serve as a deleter for our unique_ptr class.
const elt_allocator_type * heap() const noexcept
elt_allocator_type * m_heap
DataVector using a custom allocator for the elements.
const SG::AuxVectorBase & auxbase() const
Convert to AuxVectorBase.
ElementProxy operator[](size_type n)
Access an element, as an lvalue.
DV::size_type size_type
Basic types, forwarded from the base.
friend void test2_assignelement1a()
DV::base_value_type base_value_type
elt_allocator_type * m_heap
Non-owning pointer to the heap.
static constexpr bool must_own
If true, then this type must own its contents.
ElementProxy at(size_type n)
Access an element, as an lvalue.
static ContainerUniquePtr make_unique()
Helper for unique_ptr conversions.
DataModel_detail::ElementProxy< DataVectorWithAlloc > ElementProxy
This type is used to proxy lvalue accesses to DataVector elements, in order to handle ownership.
ElementProxy to_element_proxy(typename BaseContainer::iterator i)
Convert an iterator of the base vector to an ElementProxy for the DataVectorWithAlloc.
size_type push_new(size_type n)
Create and add a number of new elements to the end of the container.
DataVectorWithAlloc(DataVectorWithAlloc &&rhs)
Move constructor.
iterator emplace(iterator position, Ptr pElem)
Add a new element to the collection.
DV::const_iterator const_iterator
iterator end() noexcept
Return an iterator pointing past the end of the collection.
DataVectorWithAlloc(const DataVectorWithAlloc &)=delete
static const bool has_virtual
This needs to be forwarded from the base as well.
reverse_iterator rend() noexcept
Return a reverse_iterator pointing at the beginning of the collection.
DV::const_pointer const_pointer
value_type emplace_back(Ptr pElem)
Add an element to the end of the collection.
DV::const_reverse_iterator const_reverse_iterator
DataVectorWithAlloc & operator=(const DataVectorWithAlloc &rhs)=delete
iterator insert(iterator position, Ptr pElem)
Add a new element to the collection.
void swapElement(size_type index, Ptr newElem, Ptr &oldElem)
Swap one element out of the container.
value_type push_back(Ptr pElem)
Add an element to the end of the collection.
void shrink_to_fit()
Change the vector capacity to match the current size.
static DV::iterator to_base_iterator(iterator it)
Convert a DataVectorWithAlloc::iterator to an iterator of the base DataVector.
void swap(DataVectorWithAlloc &rhs)
Swap this collection with another.
void assignElement(typename BaseContainer::iterator pos, Ptr newElem)
Handle element assignment.
DV::const_value_type const_value_type
std::reverse_iterator< iterator > reverse_iterator
Standard reverse_iterator.
ElementProxy front()
Access the first element in the collection as an lvalue.
ElementProxy back()
Access the last element in the collection as an lvalue.
iterator begin() noexcept
Return an iterator pointing at the beginning of the collection.
DV::difference_type difference_type
DV::value_type value_type
static void iter_swap(iterator a, iterator b)
Swap the referents of two DataVector iterators.
Ptr allocate(Args &&... args)
Allocate a new vector element.
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
ALLOC elt_allocator_type
Type of the allocator use for vector elements.
iterator erase(iterator position)
Remove element at a given position.
DataModel_detail::iterator< DataVectorWithAlloc > iterator
The iterator for this type.
reverse_iterator rbegin() noexcept
Return a reverse_iterator pointing past the end of the collection.
static const DataVectorWithAlloc * fromDataVector(const DV *dv)
Cast from a DataVector to a DataVectorWithAlloc.
DV::allocator_type allocator_type
elt_allocator_type & elt_allocator()
Return the underlying allocator.
void resortAux(iterator beg, iterator end)
Reset indices / reorder aux data after elements have been permuted.
const elt_allocator_type & elt_allocator() const
Return the underlying allocator.
DataVectorWithAlloc(elt_allocator_type &&eltAlloc=elt_allocator_type())
Default constructor.
std::true_type isSequence
void clear()
Erase all the elements in the collection.
iterator to_my_iterator(typename DV::iterator it)
Convert an iterator of the base DataVector to a DataVectorWithAlloc::iterator.
DataVectorWithAlloc(size_type n, elt_allocator_type &&eltAlloc=elt_allocator_type())
Sized constructor.
const DV * asDataVector() const
Return a pointer to this object, as a const DataVector.
DV::const_reference const_reference
virtual ~DataVectorWithAlloc()
Destructor.
DV::BaseContainer BaseContainer
DataVector< base_value_type > base_data_vector
Provide an interface for finding inheritance information at run time.
DataBucket class for DataVectorWithAlloc.
DVLDataVectorWithAllocBucket(DataVectorWithAlloc< DV, ALLOC > *data)
Constructor from a payload object.
DVLDataVectorWithAllocBucket(std::unique_ptr< DataVectorWithAlloc< DV, ALLOC > > data)
Constructor from a payload object.
static std::string release
Hook for unprotecting an arena.
static constexpr bool s_isConst
Default, invalid implementation of ClassID_traits.
SG::DVLDataVectorWithAllocBucket< DV, ALLOC > type
Metafunction to find the proper DataBucket class for T.