ATLAS Offline Software
Classes | Public Types | Static Public Attributes | List of all members
DataVectorWithAlloc< DV, ALLOC > Class Template Reference

DataVector using a custom allocator for the elements. More...

#include <DataVectorWithAlloc.h>

Inheritance diagram for DataVectorWithAlloc< DV, ALLOC >:
Collaboration diagram for DataVectorWithAlloc< DV, ALLOC >:

Classes

class  ContainerUniquePtr
 Helper for unique_ptr conversions. More...
 
class  HeapDeleter
 Internal helper to delete vector elements. More...
 
class  Ptr
 unique_ptr holding an element for this vector. More...
 
class  UPDeleter
 Internal helper to serve as a deleter for our unique_ptr class. More...
 

Public Types

typedef DV::size_type size_type
 Basic types, forwarded from the base. More...
 
typedef DV::difference_type difference_type
 
typedef DV::allocator_type allocator_type
 
typedef DV::base_value_type base_value_type
 
typedef DV::BaseContainer BaseContainer
 
typedef DV::DVL_BASE DVL_BASE
 
typedef DV::const_iterator const_iterator
 
typedef DV::const_reverse_iterator const_reverse_iterator
 
typedef DV::value_type value_type
 
typedef DV::const_value_type const_value_type
 
typedef DV::reference reference
 
typedef DV::const_reference const_reference
 
typedef DV::pointer pointer
 
typedef DV::const_pointer const_pointer
 
typedef ALLOC elt_allocator_type
 Type of the allocator use for vector elements. More...
 
typedef DataVector< base_value_typebase_data_vector
 
typedef DataModel_detail::ElementProxy< DataVectorWithAllocElementProxy
 This type is used to proxy lvalue accesses to DataVector elements, in order to handle ownership. More...
 
typedef DataModel_detail::iterator< DataVectorWithAllociterator
 The iterator for this type. More...
 
typedef std::reverse_iterator< iteratorreverse_iterator
 Standard reverse_iterator. More...
 
typedef boost::true_type isSequence
 

Public Member Functions

Constructors, destructors, assignment.
 DataVectorWithAlloc (elt_allocator_type &&eltAlloc=elt_allocator_type())
 Default constructor. More...
 
 DataVectorWithAlloc (size_type n, elt_allocator_type &&eltAlloc=elt_allocator_type())
 Sized constructor. More...
 
 DataVectorWithAlloc (const DataVectorWithAlloc &)=delete
 
DataVectorWithAllocoperator= (const DataVectorWithAlloc &rhs)=delete
 
 DataVectorWithAlloc (DataVectorWithAlloc &&rhs)
 Move constructor. More...
 
DataVectorWithAllocoperator= (DataVectorWithAlloc &&rhs)
 Move assignment. More...
 
virtual ~DataVectorWithAlloc ()
 Destructor. More...
 
const elt_allocator_typeelt_allocator () const
 Return the underlying allocator. More...
 
elt_allocator_typeelt_allocator ()
 Return the underlying allocator. More...
 
Size and capacity.
void reserve (size_type n)
 Attempt to preallocate enough memory for a specified number of elements. More...
 
void shrink_to_fit ()
 Change the vector capacity to match the current size. More...
 
Element access.
ElementProxy operator[] (size_type n)
 Access an element, as an lvalue. More...
 
ElementProxy at (size_type n)
 Access an element, as an lvalue. More...
 
ElementProxy front ()
 Access the first element in the collection as an lvalue. More...
 
ElementProxy back ()
 Access the last element in the collection as an lvalue. More...
 
Iterator creation.
iterator begin () noexcept
 Return an iterator pointing at the beginning of the collection. More...
 
iterator end () noexcept
 Return an iterator pointing past the end of the collection. More...
 
reverse_iterator rbegin () noexcept
 Return a reverse_iterator pointing past the end of the collection. More...
 
reverse_iterator rend () noexcept
 Return a reverse_iterator pointing at the beginning of the collection. More...
 
Insertion operations.
value_type push_back (Ptr pElem)
 Add an element to the end of the collection. More...
 
value_type emplace_back (Ptr pElem)
 Add an element to the end of the collection. More...
 
iterator insert (iterator position, Ptr pElem)
 Add a new element to the collection. More...
 
iterator emplace (iterator position, Ptr pElem)
 Add a new element to the collection. More...
 
Erasure operations.
iterator erase (iterator position)
 Remove element at a given position. More...
 
iterator erase (iterator first, iterator last)
 Remove a range of elements. More...
 
void clear ()
 Erase all the elements in the collection. More...
 
Relational operators.
bool operator< (const DataVectorWithAlloc &b) const
 Vector ordering relation. More...
 
bool operator> (const DataVectorWithAlloc &b) const
 Based on operator<. More...
 
bool operator<= (const DataVectorWithAlloc &b) const
 Based on operator<. More...
 
bool operator>= (const DataVectorWithAlloc &b) const
 Based on operator<. More...
 
bool operator== (const DataVectorWithAlloc &b) const
 Vector equality comparison. More...
 
bool operator!= (const DataVectorWithAlloc &b) const
 Based on operator==. More...
 

Static Public Attributes

static const bool has_virtual = DV::has_virtual
 This needs to be forwarded from the base as well. More...
 
static constexpr bool must_own = true
 If true, then this type must own its contents. More...
 

Smart pointer.

using unique_type = Ptr
 
static ContainerUniquePtr make_unique ()
 Helper for unique_ptr conversions. More...
 

Swap and sort.

static void iter_swap (iterator a, iterator b)
 Swap the referents of two DataVector iterators. More...
 
void swap (DataVectorWithAlloc &rhs)
 Swap this collection with another. More...
 

Non-standard operations.

static const DataVectorWithAllocfromDataVector (const DV *dv)
 Cast from a DataVector to a DataVectorWithAlloc. More...
 
void swapElement (size_type index, Ptr newElem, Ptr &oldElem)
 Swap one element out of the container. More...
 
void swapElement (iterator pos, Ptr newElem, Ptr &oldElem)
 Swap one element out of the container. More...
 
const DV * asDataVector () const
 Return a pointer to this object, as a const DataVector. More...
 
void resortAux (iterator beg, iterator end)
 Reset indices / reorder aux data after elements have been permuted. More...
 
const SG::AuxVectorBaseauxbase () const
 Convert to AuxVectorBase. More...
 
template<class... Args>
Ptr allocate (Args &&... args)
 Allocate a new vector element. More...
 

Private helpers.

class DataModel_detail::ElementProxy< DataVectorWithAlloc >
 
void test2_assignelement1a ()
 
elt_allocator_typem_heap
 Non-owning pointer to the heap. More...
 
void assignElement (typename BaseContainer::iterator pos, Ptr newElem)
 Handle element assignment. More...
 
iterator to_my_iterator (typename DV::iterator it)
 Convert an iterator of the base DataVector to a DataVectorWithAlloc::iterator. More...
 
ElementProxy to_element_proxy (typename BaseContainer::iterator i)
 Convert an iterator of the base vector to an ElementProxy for the DataVectorWithAlloc. More...
 
static DV::iterator to_base_iterator (iterator it)
 Convert a DataVectorWithAlloc::iterator to an iterator of the base DataVector. More...
 

Detailed Description

template<class DV, class ALLOC>
class DataVectorWithAlloc< DV, ALLOC >

DataVector using a custom allocator for the elements.

The ALLOC argument defaulta to ArenaHeapSTLAllocator (see DataVectorWithAllocFwd.h).

Definition at line 65 of file DataVectorWithAlloc.h.

Member Typedef Documentation

◆ allocator_type

template<class DV , class ALLOC >
typedef DV::allocator_type DataVectorWithAlloc< DV, ALLOC >::allocator_type

Definition at line 72 of file DataVectorWithAlloc.h.

◆ base_data_vector

template<class DV , class ALLOC >
typedef DataVector<base_value_type> DataVectorWithAlloc< DV, ALLOC >::base_data_vector

Definition at line 89 of file DataVectorWithAlloc.h.

◆ base_value_type

template<class DV , class ALLOC >
typedef DV::base_value_type DataVectorWithAlloc< DV, ALLOC >::base_value_type

Definition at line 73 of file DataVectorWithAlloc.h.

◆ BaseContainer

template<class DV , class ALLOC >
typedef DV::BaseContainer DataVectorWithAlloc< DV, ALLOC >::BaseContainer

Definition at line 74 of file DataVectorWithAlloc.h.

◆ const_iterator

template<class DV , class ALLOC >
typedef DV::const_iterator DataVectorWithAlloc< DV, ALLOC >::const_iterator

Definition at line 76 of file DataVectorWithAlloc.h.

◆ const_pointer

template<class DV , class ALLOC >
typedef DV::const_pointer DataVectorWithAlloc< DV, ALLOC >::const_pointer

Definition at line 83 of file DataVectorWithAlloc.h.

◆ const_reference

template<class DV , class ALLOC >
typedef DV::const_reference DataVectorWithAlloc< DV, ALLOC >::const_reference

Definition at line 81 of file DataVectorWithAlloc.h.

◆ const_reverse_iterator

template<class DV , class ALLOC >
typedef DV::const_reverse_iterator DataVectorWithAlloc< DV, ALLOC >::const_reverse_iterator

Definition at line 77 of file DataVectorWithAlloc.h.

◆ const_value_type

template<class DV , class ALLOC >
typedef DV::const_value_type DataVectorWithAlloc< DV, ALLOC >::const_value_type

Definition at line 79 of file DataVectorWithAlloc.h.

◆ difference_type

template<class DV , class ALLOC >
typedef DV::difference_type DataVectorWithAlloc< DV, ALLOC >::difference_type

Definition at line 71 of file DataVectorWithAlloc.h.

◆ DVL_BASE

template<class DV , class ALLOC >
typedef DV::DVL_BASE DataVectorWithAlloc< DV, ALLOC >::DVL_BASE

Definition at line 75 of file DataVectorWithAlloc.h.

◆ ElementProxy

template<class DV , class ALLOC >
typedef DataModel_detail::ElementProxy<DataVectorWithAlloc> DataVectorWithAlloc< DV, ALLOC >::ElementProxy

This type is used to proxy lvalue accesses to DataVector elements, in order to handle ownership.

Definition at line 97 of file DataVectorWithAlloc.h.

◆ elt_allocator_type

template<class DV , class ALLOC >
typedef ALLOC DataVectorWithAlloc< DV, ALLOC >::elt_allocator_type

Type of the allocator use for vector elements.

Definition at line 86 of file DataVectorWithAlloc.h.

◆ isSequence

template<class DV , class ALLOC >
typedef boost::true_type DataVectorWithAlloc< DV, ALLOC >::isSequence

Definition at line 107 of file DataVectorWithAlloc.h.

◆ iterator

template<class DV , class ALLOC >
typedef DataModel_detail::iterator<DataVectorWithAlloc> DataVectorWithAlloc< DV, ALLOC >::iterator

The iterator for this type.

Definition at line 100 of file DataVectorWithAlloc.h.

◆ pointer

template<class DV , class ALLOC >
typedef DV::pointer DataVectorWithAlloc< DV, ALLOC >::pointer

Definition at line 82 of file DataVectorWithAlloc.h.

◆ reference

template<class DV , class ALLOC >
typedef DV::reference DataVectorWithAlloc< DV, ALLOC >::reference

Definition at line 80 of file DataVectorWithAlloc.h.

◆ reverse_iterator

template<class DV , class ALLOC >
typedef std::reverse_iterator<iterator> DataVectorWithAlloc< DV, ALLOC >::reverse_iterator

Standard reverse_iterator.

Note that lvalue references here will yield an ElementProxy, not a reference.

Definition at line 105 of file DataVectorWithAlloc.h.

◆ size_type

template<class DV , class ALLOC >
typedef DV::size_type DataVectorWithAlloc< DV, ALLOC >::size_type

Basic types, forwarded from the base.

Definition at line 70 of file DataVectorWithAlloc.h.

◆ unique_type

template<class DV , class ALLOC >
using DataVectorWithAlloc< DV, ALLOC >::unique_type = Ptr

Definition at line 215 of file DataVectorWithAlloc.h.

◆ value_type

template<class DV , class ALLOC >
typedef DV::value_type DataVectorWithAlloc< DV, ALLOC >::value_type

Definition at line 78 of file DataVectorWithAlloc.h.

Constructor & Destructor Documentation

◆ DataVectorWithAlloc() [1/4]

template<class DV , class ALLOC >
DataVectorWithAlloc< DV, ALLOC >::DataVectorWithAlloc ( elt_allocator_type &&  eltAlloc = elt_allocator_type())
explicit

Default constructor.

Parameters
eltAllocThe element allocator.

◆ DataVectorWithAlloc() [2/4]

template<class DV , class ALLOC >
DataVectorWithAlloc< DV, ALLOC >::DataVectorWithAlloc ( size_type  n,
elt_allocator_type &&  eltAlloc = elt_allocator_type() 
)
explicit

Sized constructor.

Parameters
nThe size of the container.
eltAllocThe element allocator.

Note that unlike the standard vector constructor, you can't specify an initial value here. The container will be initialized with 0's.

◆ DataVectorWithAlloc() [3/4]

template<class DV , class ALLOC >
DataVectorWithAlloc< DV, ALLOC >::DataVectorWithAlloc ( const DataVectorWithAlloc< DV, ALLOC > &  )
delete

◆ DataVectorWithAlloc() [4/4]

template<class DV , class ALLOC >
DataVectorWithAlloc< DV, ALLOC >::DataVectorWithAlloc ( DataVectorWithAlloc< DV, ALLOC > &&  rhs)

Move constructor.

Parameters
rhsThe container from which to move.

Any auxiliary data will be moved along with the container contents.

The existing allocator is moved. rhs will be left with a new, default-initialized, allocator.

◆ ~DataVectorWithAlloc()

template<class DV , class ALLOC >
virtual DataVectorWithAlloc< DV, ALLOC >::~DataVectorWithAlloc ( )
virtual

Destructor.

Member Function Documentation

◆ allocate()

template<class DV , class ALLOC >
template<class... Args>
Ptr DataVectorWithAlloc< DV, ALLOC >::allocate ( Args &&...  args)

Allocate a new vector element.

Arguments will be forwarded to the element constructor.

◆ asDataVector()

template<class DV , class ALLOC >
const DV* DataVectorWithAlloc< DV, ALLOC >::asDataVector ( ) const

Return a pointer to this object, as a const DataVector.

◆ assignElement()

template<class DV , class ALLOC >
void DataVectorWithAlloc< DV, ALLOC >::assignElement ( typename BaseContainer::iterator  pos,
Ptr  newElem 
)
private

Handle element assignment.

Parameters
posPosition in the container to assign.
newElemThe new element to assign.

Auxiliary data are copied if appropriate.

◆ at()

template<class DV , class ALLOC >
ElementProxy DataVectorWithAlloc< DV, ALLOC >::at ( size_type  n)

Access an element, as an lvalue.

Parameters
nArray index to access.
Returns
Proxy to the element at n.

Will raise std::out_of_range if the index is out-of-bounds. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ auxbase()

template<class DV , class ALLOC >
const SG::AuxVectorBase& DataVectorWithAlloc< DV, ALLOC >::auxbase ( ) const

Convert to AuxVectorBase.

Needed to get @x AuxVectorBase from a ConstDataVector. Present in DataVector as well for consistency.

◆ back()

template<class DV , class ALLOC >
ElementProxy DataVectorWithAlloc< DV, ALLOC >::back ( )

Access the last element in the collection as an lvalue.

Returns
Proxy to the last element in the collection.

No checking is done to ensure that the container is not empty. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ begin()

template<class DV , class ALLOC >
iterator DataVectorWithAlloc< DV, ALLOC >::begin ( )
noexcept

Return an iterator pointing at the beginning of the collection.

Returns
An iterator.

Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ clear()

template<class DV , class ALLOC >
void DataVectorWithAlloc< DV, ALLOC >::clear ( )

Erase all the elements in the collection.

The removed elements will be deleted.

◆ elt_allocator() [1/2]

template<class DV , class ALLOC >
elt_allocator_type& DataVectorWithAlloc< DV, ALLOC >::elt_allocator ( )

Return the underlying allocator.

◆ elt_allocator() [2/2]

template<class DV , class ALLOC >
const elt_allocator_type& DataVectorWithAlloc< DV, ALLOC >::elt_allocator ( ) const

Return the underlying allocator.

◆ emplace()

template<class DV , class ALLOC >
iterator DataVectorWithAlloc< DV, ALLOC >::emplace ( iterator  position,
Ptr  pElem 
)

Add a new element to the collection.

Parameters
positionIterator before which the element will be added.
pElemThe element to add to the collection.
Returns
An iterator that points to the inserted data.

Note: this method may only be called using the most derived DataVector in the hierarchy.

For DataVector, this is just the same as insert. It's included just for interface compatibility with std::vector.

◆ emplace_back()

template<class DV , class ALLOC >
value_type DataVectorWithAlloc< DV, ALLOC >::emplace_back ( Ptr  pElem)

Add an element to the end of the collection.

Parameters
pElemThe element to add to the collection.

Note: this method may only be called using the most derived DataVector in the hierarchy.

For DataVector, this is like the same as push_back, and it returns the pushed element. It's included just for interface compatibility with std::vector.

◆ end()

template<class DV , class ALLOC >
iterator DataVectorWithAlloc< DV, ALLOC >::end ( )
noexcept

Return an iterator pointing past the end of the collection.

Returns
An iterator.

Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ erase() [1/2]

template<class DV , class ALLOC >
iterator DataVectorWithAlloc< DV, ALLOC >::erase ( iterator  first,
iterator  last 
)

Remove a range of elements.

Parameters
firstIterator pointing to the first element to be removed.
lastIterator pointing one past the last element to be removed.
Returns
An iterator pointing to the element pointed to by last prior to erasing (or end()).

The removed elements will be deleted.

◆ erase() [2/2]

template<class DV , class ALLOC >
iterator DataVectorWithAlloc< DV, ALLOC >::erase ( iterator  position)

Remove element at a given position.

Parameters
positionIterator pointing to the element to be removed.
Returns
An iterator pointing to the next element (or end()).

The pointed-to element will be deleted.

◆ fromDataVector()

template<class DV , class ALLOC >
static const DataVectorWithAlloc* DataVectorWithAlloc< DV, ALLOC >::fromDataVector ( const DV *  dv)
static

Cast from a DataVector to a DataVectorWithAlloc.

Parameters
dvPointer to object to cast.

Return DV cast to a DataVectorWithAlloc.

◆ front()

template<class DV , class ALLOC >
ElementProxy DataVectorWithAlloc< DV, ALLOC >::front ( )

Access the first element in the collection as an lvalue.

Returns
Proxy to the first element in the collection.

No checking is done to ensure that the container is not empty. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ insert()

template<class DV , class ALLOC >
iterator DataVectorWithAlloc< DV, ALLOC >::insert ( iterator  position,
Ptr  pElem 
)

Add a new element to the collection.

Parameters
positionIterator before which the element will be added.
pElemThe element to add to the collection.
Returns
An iterator that points to the inserted data.

Note: this method may only be called using the most derived DataVector in the hierarchy.

◆ iter_swap()

template<class DV , class ALLOC >
static void DataVectorWithAlloc< DV, ALLOC >::iter_swap ( iterator  a,
iterator  b 
)
static

Swap the referents of two DataVector iterators.

Parameters
aThe first iterator for the swap.
bThe second iterator for the swap.

The iterators must both refer to the same container.

◆ make_unique()

template<class DV , class ALLOC >
static ContainerUniquePtr DataVectorWithAlloc< DV, ALLOC >::make_unique ( )
inlinestatic

Helper for unique_ptr conversions.

If we do

auto c = std::make_unique<DataVectorWithAlloc<DV> >();

we may later want to convert this to a std::unique_ptr<const DV>. We can do this via asDataVector, but actually doing that is a bit awkward. To help with this, we introduce the type ContainerUniquePtr, made with the static method here, that supports an implicit move conversion to std::unique_ptr<const DV>.

Definition at line 248 of file DataVectorWithAlloc.h.

249  {
250  return ContainerUniquePtr (new DataVectorWithAlloc);
251  }

◆ operator!=()

template<class DV , class ALLOC >
bool DataVectorWithAlloc< DV, ALLOC >::operator!= ( const DataVectorWithAlloc< DV, ALLOC > &  b) const

Based on operator==.

◆ operator<()

template<class DV , class ALLOC >
bool DataVectorWithAlloc< DV, ALLOC >::operator< ( const DataVectorWithAlloc< DV, ALLOC > &  b) const

Vector ordering relation.

Parameters
bA DataVectorWithAlloc of the same type as *this.
Returns
True iff a is lexicographically less than b.

This is a total ordering relation. It is linear in the size of the vectors. Comparisons are done on the pointer values of the elements.

See std::lexicographical_compare() for how the determination is made.

◆ operator<=()

template<class DV , class ALLOC >
bool DataVectorWithAlloc< DV, ALLOC >::operator<= ( const DataVectorWithAlloc< DV, ALLOC > &  b) const

Based on operator<.

◆ operator=() [1/2]

template<class DV , class ALLOC >
DataVectorWithAlloc& DataVectorWithAlloc< DV, ALLOC >::operator= ( const DataVectorWithAlloc< DV, ALLOC > &  rhs)
delete

◆ operator=() [2/2]

template<class DV , class ALLOC >
DataVectorWithAlloc& DataVectorWithAlloc< DV, ALLOC >::operator= ( DataVectorWithAlloc< DV, ALLOC > &&  rhs)

Move assignment.

Parameters
rhsThe container from which to move.

Any auxiliary data will be moved along with the container contents.

The existing allocator is moved. rhs will be left with a new, default-initialized, allocator.

◆ operator==()

template<class DV , class ALLOC >
bool DataVectorWithAlloc< DV, ALLOC >::operator== ( const DataVectorWithAlloc< DV, ALLOC > &  b) const

Vector equality comparison.

Parameters
bA DataVectorWithAlloc of the same type as *this.
Returns
True iff the size and elements of the vectors are equal.

This is an equivalence relation. It is linear in the size of the vectors. Vectors are considered equivalent if their sizes are equal, and if corresponding elements compare equal.

◆ operator>()

template<class DV , class ALLOC >
bool DataVectorWithAlloc< DV, ALLOC >::operator> ( const DataVectorWithAlloc< DV, ALLOC > &  b) const

Based on operator<.

◆ operator>=()

template<class DV , class ALLOC >
bool DataVectorWithAlloc< DV, ALLOC >::operator>= ( const DataVectorWithAlloc< DV, ALLOC > &  b) const

Based on operator<.

◆ operator[]()

template<class DV , class ALLOC >
ElementProxy DataVectorWithAlloc< DV, ALLOC >::operator[] ( size_type  n)

Access an element, as an lvalue.

Parameters
nArray index to access.
Returns
Proxy to the element at n.

No bounds checking is done. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ push_back()

template<class DV , class ALLOC >
value_type DataVectorWithAlloc< DV, ALLOC >::push_back ( Ptr  pElem)

Add an element to the end of the collection.

Parameters
pElemThe element to add to the collection.

Note: this method may only be called using the most derived DataVector in the hierarchy.

Returns the pushed pointer.

◆ rbegin()

template<class DV , class ALLOC >
reverse_iterator DataVectorWithAlloc< DV, ALLOC >::rbegin ( )
noexcept

Return a reverse_iterator pointing past the end of the collection.

Returns
A reverse_iterator.

Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ rend()

template<class DV , class ALLOC >
reverse_iterator DataVectorWithAlloc< DV, ALLOC >::rend ( )
noexcept

Return a reverse_iterator pointing at the beginning of the collection.

Returns
A reverse_iterator.

Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ reserve()

template<class DV , class ALLOC >
void DataVectorWithAlloc< DV, ALLOC >::reserve ( size_type  n)

Attempt to preallocate enough memory for a specified number of elements.

Parameters
nNumber of elements required.

◆ resortAux()

template<class DV , class ALLOC >
void DataVectorWithAlloc< DV, ALLOC >::resortAux ( iterator  beg,
iterator  end 
)

Reset indices / reorder aux data after elements have been permuted.

Parameters
begStart of the range of elements to process.
endEnd of the range of elements to process.

◆ shrink_to_fit()

template<class DV , class ALLOC >
void DataVectorWithAlloc< DV, ALLOC >::shrink_to_fit ( )

Change the vector capacity to match the current size.

Note: this does not affect auxiliary data.

◆ swap()

template<class DV , class ALLOC >
void DataVectorWithAlloc< DV, ALLOC >::swap ( DataVectorWithAlloc< DV, ALLOC > &  rhs)

Swap this collection with another.

Parameters
rhsThe collection with which to swap.

Ownership is swapped along with the collection content.

Note: this method may only be called using the most-derived DataVector in the hierarchy. The rhs must also be referenced using the most-derived DataVector.

◆ swapElement() [1/2]

template<class DV , class ALLOC >
void DataVectorWithAlloc< DV, ALLOC >::swapElement ( iterator  pos,
Ptr  newElem,
Ptr oldElem 
)

Swap one element out of the container.

Parameters
posThe element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference to receive the element removed from the container.

Reference oldElem is initialized with element pos of the collection (no bounds checking). Then element index is set to newElem.

Note: this method may only be called using the most derived DataList in the hierarchy.

◆ swapElement() [2/2]

template<class DV , class ALLOC >
void DataVectorWithAlloc< DV, ALLOC >::swapElement ( size_type  index,
Ptr  newElem,
Ptr oldElem 
)

Swap one element out of the container.

Parameters
indexIndex of the element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference to receive the element removed from the container.

Reference oldElem is initialized with element index of the collection (no bounds checking). Then element index is set to newElem.

Note: this method may only be called using the most derived DataVector in the hierarchy.

◆ to_base_iterator()

template<class DV , class ALLOC >
static DV::iterator DataVectorWithAlloc< DV, ALLOC >::to_base_iterator ( iterator  it)
staticprivate

Convert a DataVectorWithAlloc::iterator to an iterator of the base DataVector.

Parameters
itThe DataVectorWithAlloc::iterator to convert.

◆ to_element_proxy()

template<class DV , class ALLOC >
ElementProxy DataVectorWithAlloc< DV, ALLOC >::to_element_proxy ( typename BaseContainer::iterator  i)
private

Convert an iterator of the base vector to an ElementProxy for the DataVectorWithAlloc.

Parameters
itThe base vector iterator to convert.

◆ to_my_iterator()

template<class DV , class ALLOC >
iterator DataVectorWithAlloc< DV, ALLOC >::to_my_iterator ( typename DV::iterator  it)
private

Convert an iterator of the base DataVector to a DataVectorWithAlloc::iterator.

Parameters
itThe base DataVector iterator to convert.

Friends And Related Function Documentation

◆ DataModel_detail::ElementProxy< DataVectorWithAlloc >

template<class DV , class ALLOC >
friend class DataModel_detail::ElementProxy< DataVectorWithAlloc >
friend

Definition at line 705 of file DataVectorWithAlloc.h.

◆ test2_assignelement1a

template<class DV , class ALLOC >
void test2_assignelement1a ( )
friend

Member Data Documentation

◆ has_virtual

template<class DV , class ALLOC >
const bool DataVectorWithAlloc< DV, ALLOC >::has_virtual = DV::has_virtual
static

This needs to be forwarded from the base as well.

Definition at line 93 of file DataVectorWithAlloc.h.

◆ m_heap

template<class DV , class ALLOC >
elt_allocator_type* DataVectorWithAlloc< DV, ALLOC >::m_heap
private

Non-owning pointer to the heap.

Definition at line 778 of file DataVectorWithAlloc.h.

◆ must_own

template<class DV , class ALLOC >
constexpr bool DataVectorWithAlloc< DV, ALLOC >::must_own = true
staticconstexpr

If true, then this type must own its contents.

Definition at line 110 of file DataVectorWithAlloc.h.


The documentation for this class was generated from the following file:
DataVectorWithAlloc
DataVector using a custom allocator for the elements.
Definition: DataVectorWithAlloc.h:67
python.compressB64.c
def c
Definition: compressB64.py:93