ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::containers::List< T, TAllocator, TRecycling > Class Template Reference

Description:

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
class alib::containers::List< T, TAllocator, TRecycling >

TODO(251224 09:26): Add a template parameter which enables element counting. Add a size method that is available only if size counting is activated. TODO(251224 09:26): Implement forwardList. Ich weiss, es ist kaum nötig, aber die basis-typen sind einfach unbrauchbar. Vielleicht kann die KI es ja machen ;-) Implements a doubly linked list, likewise std::list does. Memory for inserted elements is allocated using the Allocator provided with construction.

Elements that are erased from the list will by default be recycled with subsequent insert operations. With that, remove and insert operations do not lead to leaked memory when a monotonic allocator is used.

This type is not a full re-write of type std::list. Among others, as of today, methods splice, merge, or sort are not provided.

See also
Template Parameters
TThe type of the contained objects.
TAllocatorThe allocator type to use.
TRecyclingDenotes the type of recycling that is to be performed. Possible values are None, Private (the default), or Shared.

Definition at line 62 of file list.inl.

Inheritance diagram for alib::containers::List< T, TAllocator, TRecycling >:
alib::lang::BidiListHook< detail::ListElement< T > > alib::lang::DbgCriticalSections

Inner Type Index:

struct  TIterator

Public Type Index:

using AllocatorType = TAllocator
 The allocator type that TAllocator specifies.
using const_iterator = TIterator<const T>
 The constant iterator exposed by this container.
using const_reverse_iterator = std::reverse_iterator<const_iterator>
 The constant iterator exposed by this container.
using iterator = TIterator< T>
 The mutable iterator exposed by this container.
using reverse_iterator = std::reverse_iterator<iterator>
 The mutable iterator exposed by this container.
using SharedRecyclerType
using size_type = integer
 The type defining sizes of this container.
using value_type = T
 Exposes template parameter T to the outer world in a std compatible way.

Public Method Index:

std::iterator_traits Interface
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
const_iterator cbegin () const
const_iterator cend () const
reverse_iterator rbegin ()
reverse_iterator rend ()
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const
const_reverse_iterator crbegin () const
const_reverse_iterator crend () const
 List ()
 List (std::initializer_list< T > initList)
 List (const List &copy)
 List (List &&move)
 List (AllocatorType &pAllocator)
 List (AllocatorType &pAllocator, std::initializer_list< T > initList)
template<typename TSharedRecycler = SharedRecyclerType>
 List (TSharedRecycler &pSharedRecycler)
template<typename TSharedRecycler = SharedRecyclerType>
 List (TSharedRecycler &pSharedRecycler, std::initializer_list< T > initList)
 ~List ()
 Destructor. Invokes Clear.
Allocation
AllocatorTypeGetAllocator ()
integer RecyclablesCount () const
Size and Capacity
integer size () const
bool empty () const
bool IsNotEmpty () const
void Clear ()
void Reset ()
void ReserveRecyclables (integer qty, lang::ValueReference reference)
Element Access
T & ElementAt (integer idx)
const T & ElementAt (integer idx) const
T & front ()
const T & front () const
T & back ()
const T & back () const
Element Insertion
iterator Insert (const_iterator position, const T &copy)
iterator Insert (const_iterator position, T &&move)
T & push_back (const T &copy)
T & push_back (T &&move)
T & push_front (const T &copy)
T & push_front (T &&move)
template<typename... TArgs>
iterator emplace (const_iterator position, TArgs &&... args)
template<typename... TArgs>
T & emplace_back (TArgs &&... args)
template<typename... TArgs>
T & emplace_front (TArgs &&... args)
Element Removal
iterator erase (const_iterator position)
iterator erase (const_iterator begin, const_iterator end)
void pop_front ()
 Removes the first element.
void pop_back ()
 Removes the last element.
Public Method Index: inherited from alib::lang::DbgCriticalSections
 DbgCriticalSections (const char *name)
 ~DbgCriticalSections ()
 Destructor. Checks that this instance is unused.
void Acquire (const CallerInfo &ci) const
void AcquireShared (const CallerInfo &ci) const
void doAssert (bool cond, const CallerInfo &ciAssert, const CallerInfo &ci, const char *headline) const
void Release (const CallerInfo &ci) const
void ReleaseShared (const CallerInfo &ci) const
void yieldOrSleep () const

Protected Type Index:

using allocBase = lang::AllocatorMember<TAllocator>
 The type of the base class that stores the allocator.
using Element = detail::ListElement<T>
 The list element type.
using hook = lang::BidiListHook<detail::ListElement<T>>
 The hook type.
using recyclerType
 The recycler type.

Additional Inherited Members

Public Static Field Index: inherited from alib::lang::DbgCriticalSections
static const char * ASSERTION_FORMAT
Public Field Index: inherited from alib::lang::DbgCriticalSections
CallerInfo DCSAcq
 Source location of acquirement.
AssociatedLockDCSLock {nullptr}
const char * DCSName
 The name of this DCS. Used for debug-output.
std::atomic< int > DCSReaderCnt {0}
 Tracks enter/exit calls of readers.
CallerInfo DCSRel
 Source location of the last "reader" seen.
CallerInfo DCSSAcq
 Source location of acquirement.
CallerInfo DCSSRel
 Source location of the last "reader" seen.
std::atomic< int > DCSWriterCnt {0}
 Tracks enter/exit calls (including readers).
int DCSYieldOrSleepTimeInNS = -1
Private Type Index: inherited from alib::lang::BidiListHook< detail::ListElement< T > >
using TFNode
 An alias for the base type of the node type of this list.
using TNode
 An alias for the node type of this list.
Private Field Index: inherited from alib::lang::BidiListHook< detail::ListElement< T > >
TNode hook
 The root node. Points twice to itself when the list is empty.
Private Method Index: inherited from alib::lang::BidiListHook< detail::ListElement< T > >
 BidiListHook () noexcept
 Default constructor. Initializes this list to be empty.
 BidiListHook (BidiListHook &&move) noexcept
 BidiListHook (const BidiListHook &)=delete
 Deleted copy constructor.
 BidiListHook (detail::ListElement< T > *first) noexcept
 BidiListHook (detail::ListElement< T > *first, detail::ListElement< T > *last) noexcept
integer count (const TNode *end=nullptr) const noexcept
detail::ListElement< T > * end () const noexcept
detail::ListElement< T > * first () const noexcept
bool isEmpty () const noexcept
bool isFirst (const detail::ListElement< T > *elem) const noexcept
bool isLast (const detail::ListElement< T > *elem) const noexcept
detail::ListElement< T > * last () const noexcept
BidiListHookoperator= (BidiListHook &&) noexcept=default
BidiListHookoperator= (const BidiListHook &)=delete
detail::ListElement< T > * popEnd () noexcept
detail::ListElement< T > * popFront () noexcept
void pushEnd (detail::ListElement< T > *elem) noexcept
void pushEnd (detail::ListElement< T > *first, detail::ListElement< T > *last) noexcept
void pushFront (detail::ListElement< T > *elem) noexcept
void pushFront (detail::ListElement< T > *first, detail::ListElement< T > *last) noexcept
void reset () noexcept
 Resets this list to zero elements.

Type Definition Details:

◆ AllocatorType

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
using alib::containers::List< T, TAllocator, TRecycling >::AllocatorType = TAllocator

The allocator type that TAllocator specifies.

Definition at line 95 of file list.inl.

◆ allocBase

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
using alib::containers::List< T, TAllocator, TRecycling >::allocBase = lang::AllocatorMember<TAllocator>
protected

The type of the base class that stores the allocator.

Definition at line 77 of file list.inl.

◆ const_iterator

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
using alib::containers::List< T, TAllocator, TRecycling >::const_iterator = TIterator<const T>

The constant iterator exposed by this container.

Definition at line 206 of file list.inl.

◆ const_reverse_iterator

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
using alib::containers::List< T, TAllocator, TRecycling >::const_reverse_iterator = std::reverse_iterator<const_iterator>

The constant iterator exposed by this container.

Definition at line 212 of file list.inl.

◆ Element

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
using alib::containers::List< T, TAllocator, TRecycling >::Element = detail::ListElement<T>
protected

The list element type.

Definition at line 80 of file list.inl.

◆ hook

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
using alib::containers::List< T, TAllocator, TRecycling >::hook = lang::BidiListHook<detail::ListElement<T>>
protected

The hook type.

Definition at line 74 of file list.inl.

◆ iterator

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
using alib::containers::List< T, TAllocator, TRecycling >::iterator = TIterator< T>

The mutable iterator exposed by this container.

Definition at line 209 of file list.inl.

◆ recyclerType

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
using alib::containers::List< T, TAllocator, TRecycling >::recyclerType
protected
Initial value:

The recycler type.

Definition at line 83 of file list.inl.

◆ reverse_iterator

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
using alib::containers::List< T, TAllocator, TRecycling >::reverse_iterator = std::reverse_iterator<iterator>

The mutable iterator exposed by this container.

Definition at line 215 of file list.inl.

◆ SharedRecyclerType

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
using alib::containers::List< T, TAllocator, TRecycling >::SharedRecyclerType
Initial value:
::template HookType<TAllocator, detail::ListElement<T> >

This type definition may be used to define an externally managed shared recycler, which can be passed to the alternative constructor of this class when template parameter TRecycling equals Shared.

See also
Chapter 4.3 Shared Recycling of the Programmer's Manual for this ALib Module.

Definition at line 103 of file list.inl.

◆ size_type

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
using alib::containers::List< T, TAllocator, TRecycling >::size_type = integer

The type defining sizes of this container.

Definition at line 91 of file list.inl.

◆ value_type

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
using alib::containers::List< T, TAllocator, TRecycling >::value_type = T

Exposes template parameter T to the outer world in a std compatible way.

Definition at line 88 of file list.inl.

Constructor(s) / Destructor Details:

◆ List() [1/8]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
alib::containers::List< T, TAllocator, TRecycling >::List ( )
inline

Constructor neither requiring an allocator, nor a shared recycler.

Note
This constructor is not available if the template argument TRecycling equals Shared and if argument TAllocator does not equal type HeapAllocator.

Definition at line 278 of file list.inl.

◆ List() [2/8]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
alib::containers::List< T, TAllocator, TRecycling >::List ( std::initializer_list< T > initList)
inline

Constructor that takes an initializer list, but neither a n allocator, nor a shared recycler.

Note
This constructor is not available if the template argument TRecycling equals Shared.
Parameters
initListThe initial lists of elements to add.

Definition at line 291 of file list.inl.

◆ List() [3/8]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
alib::containers::List< T, TAllocator, TRecycling >::List ( const List< T, TAllocator, TRecycling > & copy)
inline

Copy constructor. Invokes the implementation-dependent copy constructor of recycler, copies the pointer to the allocator and then copies each element.

Parameters
copyThe list to copy.

Definition at line 298 of file list.inl.

◆ List() [4/8]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
alib::containers::List< T, TAllocator, TRecycling >::List ( List< T, TAllocator, TRecycling > && move)
inline

Move constructor. Invokes the implementation-dependent move constructor of recycler, moves the pointer to the allocator and then copies each element.

Parameters
moveThe private recycler to move.

Definition at line 314 of file list.inl.

◆ List() [5/8]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
alib::containers::List< T, TAllocator, TRecycling >::List ( AllocatorType & pAllocator)
inline

Constructor accepting an allocator.

Note
This constructor is not available if the template argument TRecycling equals Shared and if argument TAllocator does not equal type HeapAllocator.
Parameters
pAllocatorThe allocator to use.

Definition at line 325 of file list.inl.

◆ List() [6/8]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
alib::containers::List< T, TAllocator, TRecycling >::List ( AllocatorType & pAllocator,
std::initializer_list< T > initList )
inline

Constructor that takes an allocator and an initializer list.

Note
This constructor is not available if the template argument TRecycling equals Shared.
Parameters
pAllocatorThe allocator to use.
initListThe initial lists of elements to add.

Definition at line 340 of file list.inl.

◆ List() [7/8]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
template<typename TSharedRecycler = SharedRecyclerType>
alib::containers::List< T, TAllocator, TRecycling >::List ( TSharedRecycler & pSharedRecycler)
inline

Constructor taking a shared recycler. This constructor is not available if the template argument TRecycling does not equal Shared.

Parameters
pSharedRecyclerThe shared recycler.

Definition at line 349 of file list.inl.

◆ List() [8/8]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
template<typename TSharedRecycler = SharedRecyclerType>
alib::containers::List< T, TAllocator, TRecycling >::List ( TSharedRecycler & pSharedRecycler,
std::initializer_list< T > initList )
inline

Constructor taking a shared recycler and an initializer list. This constructor is not available if the template argument TRecycling does not equal Shared.

Parameters
pSharedRecyclerThe shared recycler.
initListThe initial lists of elements to add.

Definition at line 364 of file list.inl.

◆ ~List()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
alib::containers::List< T, TAllocator, TRecycling >::~List ( )
inline

Destructor. Invokes Clear.

Definition at line 368 of file list.inl.

Method Details:

◆ back() [1/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
T & alib::containers::List< T, TAllocator, TRecycling >::back ( )
inline

Returns a non-constant reference to the last object of the list.

Returns
A mutable reference to T.

Definition at line 505 of file list.inl.

◆ back() [2/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
const T & alib::containers::List< T, TAllocator, TRecycling >::back ( ) const
inline

Returns a constant reference to the last object of the list.

Returns
A constant reference to T.

Definition at line 513 of file list.inl.

◆ begin() [1/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
iterator alib::containers::List< T, TAllocator, TRecycling >::begin ( )
inline

Returns an iterator pointing to a mutable value at the start of this list.

Returns
The start of this list.

Definition at line 222 of file list.inl.

◆ begin() [2/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
const_iterator alib::containers::List< T, TAllocator, TRecycling >::begin ( ) const
inline

Returns an iterator pointing to a constant value at the start of this list.

Returns
The start of this list.

Definition at line 230 of file list.inl.

◆ cbegin()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
const_iterator alib::containers::List< T, TAllocator, TRecycling >::cbegin ( ) const
inline

Returns an iterator pointing to a constant value at the start of this list.

Returns
The start of this list.

Definition at line 238 of file list.inl.

◆ cend()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
const_iterator alib::containers::List< T, TAllocator, TRecycling >::cend ( ) const
inline

Returns an iterator pointing to the first element behind this list.

Returns
The end of this list.

Definition at line 242 of file list.inl.

◆ Clear()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
void alib::containers::List< T, TAllocator, TRecycling >::Clear ( )
inline

Invokes the destructor of all elements and empties the list. All allocated internal elements are kept for future recycling.

Definition at line 408 of file list.inl.

◆ crbegin()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
const_reverse_iterator alib::containers::List< T, TAllocator, TRecycling >::crbegin ( ) const
inline

Returns a reverse iterator pointing to a constant value at the end of this list.

Returns
The start of this list.

Definition at line 262 of file list.inl.

◆ crend()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
const_reverse_iterator alib::containers::List< T, TAllocator, TRecycling >::crend ( ) const
inline

Returns a reverse iterator pointing to the first element behind the start of this list.

Returns
The end of this list.

Definition at line 266 of file list.inl.

◆ ElementAt() [1/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
T & alib::containers::List< T, TAllocator, TRecycling >::ElementAt ( integer idx)
inline

Traverses the list to return the item with the given idx. (Executes in linear time O(N).)

Parameters
idxThe index of the element to retrieve.
Returns
A mutable reference to T.

Definition at line 456 of file list.inl.

◆ ElementAt() [2/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
const T & alib::containers::List< T, TAllocator, TRecycling >::ElementAt ( integer idx) const
inline

Traverses the list to return the item with the given idx. (Executes in linear time O(N).)

Parameters
idxThe index of the element to retrieve.
Returns
A constant reference to T.

Definition at line 473 of file list.inl.

◆ emplace()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
template<typename... TArgs>
iterator alib::containers::List< T, TAllocator, TRecycling >::emplace ( const_iterator position,
TArgs &&... args )
inline

Adds a new element before the given position.

Template Parameters
TArgsTypes of variadic parameters given with parameter args.
Parameters
positionThe position to emplace the new element.
argsVariadic parameters to be forwarded to the constructor of type T.
Returns
A constant reference to the element added.

Definition at line 595 of file list.inl.

◆ emplace_back()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
template<typename... TArgs>
T & alib::containers::List< T, TAllocator, TRecycling >::emplace_back ( TArgs &&... args)
inline

Adds a new element at the end of the list.

Template Parameters
TArgsTypes of variadic parameters given with parameter args.
Parameters
argsVariadic parameters to be forwarded to the constructor of type T.
Returns
A reference to the element added.

Definition at line 608 of file list.inl.

◆ emplace_front()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
template<typename... TArgs>
T & alib::containers::List< T, TAllocator, TRecycling >::emplace_front ( TArgs &&... args)
inline

Adds a new element at the end of the list.

Template Parameters
TArgsTypes of variadic parameters given with parameter args.
Parameters
argsVariadic parameters to be forwarded to the constructor of type T.
Returns
A reference to the element added.

Definition at line 621 of file list.inl.

◆ empty()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
bool alib::containers::List< T, TAllocator, TRecycling >::empty ( ) const
inline

Tests this container for emptiness.

Returns
true if this list is empty, false otherwise.

Definition at line 400 of file list.inl.

◆ end() [1/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
iterator alib::containers::List< T, TAllocator, TRecycling >::end ( )
inline

Returns an iterator pointing to the first element behind this list.

Returns
The end of this list.

Definition at line 226 of file list.inl.

◆ end() [2/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
const_iterator alib::containers::List< T, TAllocator, TRecycling >::end ( ) const
inline

Returns an iterator pointing to the first element behind this list.

Returns
The end of this list.

Definition at line 234 of file list.inl.

◆ erase() [1/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
iterator alib::containers::List< T, TAllocator, TRecycling >::erase ( const_iterator begin,
const_iterator end )
inline

Removes a range of elements defined by iterators first and last.

Parameters
beginThe start of the range to remove.
endThe first element behind the range to remove.
Returns
A mutable iterator referring to the given last.

Definition at line 659 of file list.inl.

◆ erase() [2/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
iterator alib::containers::List< T, TAllocator, TRecycling >::erase ( const_iterator position)
inline

Removes an element at the given position.

Parameters
positionA constant iterator pointing to the element to be removed. Mutable iterators are inherently converted with the invocation of this method.
Returns
A mutable iterator pointing behind the removed element. If position refers to the last element of the list, iterator end is returned.

Definition at line 640 of file list.inl.

◆ front() [1/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
T & alib::containers::List< T, TAllocator, TRecycling >::front ( )
inline

Returns a non-constant reference to the first object of the list.

Returns
A mutable reference to T.

Definition at line 488 of file list.inl.

◆ front() [2/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
const T & alib::containers::List< T, TAllocator, TRecycling >::front ( ) const
inline

Returns a constant reference to the first object of the list.

Returns
A constant reference to T.

Definition at line 497 of file list.inl.

◆ GetAllocator()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
AllocatorType & alib::containers::List< T, TAllocator, TRecycling >::GetAllocator ( )
inline

Returns the allocator that was passed to the constructor of this container.

Returns
The allocator this container uses.

Definition at line 375 of file list.inl.

◆ Insert() [1/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
iterator alib::containers::List< T, TAllocator, TRecycling >::Insert ( const_iterator position,
const T & copy )
inline

Adds a new element before the given position.

Parameters
positionThe position to emplace the new element.
copyThe value to copy and insert.
Returns
A constant reference to the element added.

Definition at line 526 of file list.inl.

◆ Insert() [2/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
iterator alib::containers::List< T, TAllocator, TRecycling >::Insert ( const_iterator position,
T && move )
inline

Moves a value into this container before the given position.

Parameters
positionThe position to emplace the new element.
moveThe value to move into this container.
Returns
A constant reference to the element moved.

Definition at line 538 of file list.inl.

◆ IsNotEmpty()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
bool alib::containers::List< T, TAllocator, TRecycling >::IsNotEmpty ( ) const
inline

Tests this container for emptiness.

Returns
true if this list is empty, false otherwise.

Definition at line 404 of file list.inl.

◆ pop_back()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
void alib::containers::List< T, TAllocator, TRecycling >::pop_back ( )
inline

Removes the last element.

Definition at line 679 of file list.inl.

◆ pop_front()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
void alib::containers::List< T, TAllocator, TRecycling >::pop_front ( )
inline

Removes the first element.

Definition at line 672 of file list.inl.

◆ push_back() [1/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
T & alib::containers::List< T, TAllocator, TRecycling >::push_back ( const T & copy)
inline

Adds a new element at the end of the list.

Parameters
copyThe value to copy and insert.
Returns
A reference to the element added.

Definition at line 549 of file list.inl.

◆ push_back() [2/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
T & alib::containers::List< T, TAllocator, TRecycling >::push_back ( T && move)
inline

Moves a value to the end of this list.

Parameters
moveThe value to move into this container.
Returns
A reference to the element moved.

Definition at line 560 of file list.inl.

◆ push_front() [1/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
T & alib::containers::List< T, TAllocator, TRecycling >::push_front ( const T & copy)
inline

Adds a new element at the start of the list.

Parameters
copyThe value to copy and insert.
Returns
A reference to the element added.

Definition at line 571 of file list.inl.

◆ push_front() [2/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
T & alib::containers::List< T, TAllocator, TRecycling >::push_front ( T && move)
inline

Moves a value to the start of this list.

Parameters
moveThe value to move into this container.
Returns
A reference to the element moved.

Definition at line 581 of file list.inl.

◆ rbegin() [1/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
reverse_iterator alib::containers::List< T, TAllocator, TRecycling >::rbegin ( )
inline

Returns a reverse iterator pointing to a mutable value at the end of this list.

Returns
The start of this list.

Definition at line 246 of file list.inl.

◆ rbegin() [2/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
const_reverse_iterator alib::containers::List< T, TAllocator, TRecycling >::rbegin ( ) const
inline

Returns a reverse iterator pointing to a constant value at the end of this list.

Returns
The start of this list.

Definition at line 254 of file list.inl.

◆ RecyclablesCount()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
integer alib::containers::List< T, TAllocator, TRecycling >::RecyclablesCount ( ) const
inline

Counts the number of currently allocated but unused (not contained) list elements that will be recycled with upcoming insertions.

Note
This method is provided for completeness and unit-testing. It should not be of relevance for common usage.
Furthermore, this method is not available (aka does not compile) with instantiations that specify template parameter TRecycling as None.
Returns
The number of removed and not yet recycled elements.

Definition at line 388 of file list.inl.

◆ rend() [1/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
reverse_iterator alib::containers::List< T, TAllocator, TRecycling >::rend ( )
inline

Returns a reverse iterator pointing to the first element behind the start of this list.

Returns
The end of this list.

Definition at line 250 of file list.inl.

◆ rend() [2/2]

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
const_reverse_iterator alib::containers::List< T, TAllocator, TRecycling >::rend ( ) const
inline

Returns a reverse iterator pointing to the first element behind the start of this list.

Returns
The end of this list.

Definition at line 258 of file list.inl.

◆ ReserveRecyclables()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
void alib::containers::List< T, TAllocator, TRecycling >::ReserveRecyclables ( integer qty,
lang::ValueReference reference )
inline

Allocates the required memory for the number of additional elements expected.

See also
Chapter 4.5 Reserving Capacity of the Programmer's Manual.
Parameters
qtyThe expected resulting number (or increase) of elements to be stored in this container.
referenceDenotes whether qty is meant as an absolute size or an increase.

Definition at line 437 of file list.inl.

◆ Reset()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
void alib::containers::List< T, TAllocator, TRecycling >::Reset ( )
inline

Same as clear, but does not recycle internal nodes. Furthermore, all recyclables are deleted. The latter is done only if recycling type is not Shared. In this case, the elements are still recycled.

This method is useful with monotonic allocators, that can be reset as well, after this instance is reset.

Definition at line 421 of file list.inl.

◆ size()

template<typename T, typename TAllocator, Recycling TRecycling = Recycling::Private>
integer alib::containers::List< T, TAllocator, TRecycling >::size ( ) const
inline

Evaluates the size of the list by traversing all elements.

Returns
The number of elements contained in this listed.

Definition at line 396 of file list.inl.


The documentation for this class was generated from the following file: