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

Description:

template<typename TAllocator, typename TNode>
class alib::containers::detail::SharedRecycler< TAllocator, TNode >

This is the type exposed to users of the ALib containers in case shared recycling is chosen, for example, with SharedRecyclerType or SharedRecyclerType.
A user has to pass an instance of this type to the constructor of the container. Constructors that accept this type do not accept an allocator instance, as this is embedded already here.

Template Parameters
TAllocatorThe allocator to store and use.
TNodeThe node type to recycle.

Definition at line 367 of file recycling.inl.

Inheritance diagram for alib::containers::detail::SharedRecycler< TAllocator, TNode >:
alib::lang::AllocatorMember< TAllocator > alib::lang::SidiListHook< TNode > alib::lang::SidiNodeBase< TElement >

Public Method Index:

 SharedRecycler () noexcept
 Constructor taking no allocator, used with HeapAllocator.
 SharedRecycler (TAllocator &pAllocator) noexcept
 ~SharedRecycler () noexcept
 Destructor. Deletes all recyclables with the allocator.
integer Count () const noexcept
void Reserve (integer qty, lang::ValueReference reference)
void Reset () noexcept
 Reset. Deletes all recyclables with the allocator.
Public Method Index: inherited from alib::lang::AllocatorMember< TAllocator >
template<typename TIf = TAllocator>
 AllocatorMember ()
 AllocatorMember (TAllocator &pAllocator) noexcept
AllocatorInterface< TAllocator > AI () const noexcept
TAllocator & GetAllocator () const noexcept

Protected Type Index:

using allocBase = lang::AllocatorMember<TAllocator>
 Shortcut to a base class.
using hookBase = lang::SidiListHook<TNode>
 Shortcut to a base class.
Protected Type Index: inherited from alib::lang::SidiListHook< TNode >
using TNode
 An alias for the node type.

Additional Inherited Members

Public Type Index: inherited from alib::lang::AllocatorMember< TAllocator >
using AllocatorType = TAllocator
 Exposes the allocator type.
Protected Field Index: inherited from alib::lang::AllocatorMember< TAllocator >
TAllocator * allocator
 The allocator stored.
Protected Field Index: inherited from alib::lang::SidiNodeBase< TElement >
TElement * n
Protected Method Index: inherited from alib::lang::SidiListHook< TNode >
 SidiListHook () noexcept
 Default constructor. Initializes this list to be empty.
 SidiListHook (const SidiListHook &copy)=delete
 SidiListHook (SidiListHook &&) noexcept=default
integer count (TNode *end=nullptr) const noexcept
TNodefindAndRemove (TNode *elem) noexcept
TNodefindLast () const noexcept
TNodefindLast (TNode *hint) const noexcept
TNodefindLastBefore (TNode *elem) noexcept
TNodefirst () const noexcept
bool isEmpty () const noexcept
SidiListHookoperator= (const SidiListHook &) noexcept=delete
SidiListHookoperator= (SidiListHook &&) noexcept=default
TNodepopFront () noexcept
void pushFront (TNode *elem) noexcept
void pushFront (TNode *first, TNode *last)
void reset () noexcept
 Resets this list to zero elements.
Protected Method Index: inherited from alib::lang::SidiNodeBase< TElement >
 SidiNodeBase () noexcept=default
 Default constructor. (Does not initialize the pointer.).
 SidiNodeBase (const SidiNodeBase &)=delete
 SidiNodeBase (SidiNodeBase &&) noexcept=default
 Defaulted move constructor.
 SidiNodeBase (TElement *next) noexcept
TElement * addBehind (TElement *elem) noexcept
integer count (SidiNodeBase *end=nullptr) const noexcept
bool hasNext () const
TElement * next () const
void next (SidiNodeBase *p)
SidiNodeBaseoperator= (const SidiNodeBase &)=delete
SidiNodeBaseoperator= (SidiNodeBase &&) noexcept=default
bool pointsTo (const SidiNodeBase *elem) const
TElement * removeNext () noexcept
TElement * removeRangeBehind (TElement *last) noexcept

◆ RecyclerShared

template<typename TAllocator, typename TNode>
template<typename TAllocator1, typename TNode1>
friend class RecyclerShared
friend

Definition at line 372 of file recycling.inl.

Type Definition Details:

◆ allocBase

template<typename TAllocator, typename TNode>
using alib::containers::detail::SharedRecycler< TAllocator, TNode >::allocBase = lang::AllocatorMember<TAllocator>
protected

Shortcut to a base class.

Definition at line 375 of file recycling.inl.

◆ hookBase

template<typename TAllocator, typename TNode>
using alib::containers::detail::SharedRecycler< TAllocator, TNode >::hookBase = lang::SidiListHook<TNode>
protected

Shortcut to a base class.

Definition at line 378 of file recycling.inl.

Constructor(s) / Destructor Details:

◆ SharedRecycler() [1/2]

template<typename TAllocator, typename TNode>
alib::containers::detail::SharedRecycler< TAllocator, TNode >::SharedRecycler ( )
inlinenoexcept

Constructor taking no allocator, used with HeapAllocator.

Definition at line 383 of file recycling.inl.

◆ SharedRecycler() [2/2]

template<typename TAllocator, typename TNode>
alib::containers::detail::SharedRecycler< TAllocator, TNode >::SharedRecycler ( TAllocator & pAllocator)
inlinenoexcept

Constructor taking an allocator.

Parameters
pAllocatorThe allocator to use.

Definition at line 388 of file recycling.inl.

◆ ~SharedRecycler()

template<typename TAllocator, typename TNode>
alib::containers::detail::SharedRecycler< TAllocator, TNode >::~SharedRecycler ( )
inlinenoexcept

Destructor. Deletes all recyclables with the allocator.

Definition at line 392 of file recycling.inl.

Method Details:

◆ Count()

template<typename TAllocator, typename TNode>
integer alib::containers::detail::SharedRecycler< TAllocator, TNode >::Count ( ) const
inlinenoexcept

Counts the number of recyclables.

Returns
The number of recycled container elements available.

Definition at line 407 of file recycling.inl.

◆ Reserve()

template<typename TAllocator, typename TNode>
void alib::containers::detail::SharedRecycler< TAllocator, TNode >::Reserve ( integer qty,
lang::ValueReference reference )
inline

Reserves space for at least the given number of recyclables.

Parameters
qtyThe expected number or increase of elements to be stored in the containers that share this recycler.
referenceDenotes whether expected is meant as an absolute size or an increase .

Definition at line 413 of file recycling.inl.

◆ Reset()

template<typename TAllocator, typename TNode>
void alib::containers::detail::SharedRecycler< TAllocator, TNode >::Reset ( )
inlinenoexcept

Reset. Deletes all recyclables with the allocator.

Definition at line 395 of file recycling.inl.


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