ALib C++ Library
Library Version: 2510 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 List::SharedRecyclerType or HashTable::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 397 of file recycling.inl.

Inheritance diagram for alib::containers::detail::SharedRecycler< TAllocator, TNode >:
[legend]
Collaboration diagram for alib::containers::detail::SharedRecycler< TAllocator, TNode >:
[legend]

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 >
 AllocatorMember ()=delete
 Deleted default constructor. (The allocator has to be given with construction)
 
 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.
 
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
 A reference to the allocator.
 
- 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 () noexcept
 Default constructor. Initializes this list to be empty.
 
 SidiListHook (const SidiListHook &copy)=delete
 
 SidiListHook (const SidiListHook &copy)=delete
 
 SidiListHook (SidiListHook &&) noexcept=default
 
 SidiListHook (SidiListHook &&) noexcept=default
 
integer count (TNode *end=nullptr) const noexcept
 
integer count (TNode *end=nullptr) const noexcept
 
TNodefindAndRemove (TNode *elem) noexcept
 
TNodefindAndRemove (TNode *elem) noexcept
 
TNodefindLast () const noexcept
 
TNodefindLast () const noexcept
 
TNodefindLast (TNode *hint) const noexcept
 
TNodefindLast (TNode *hint) const noexcept
 
TNodefindLastBefore (TNode *elem) noexcept
 
TNodefindLastBefore (TNode *elem) noexcept
 
TNodefirst () const noexcept
 
TNodefirst () const noexcept
 
bool isEmpty () const noexcept
 
bool isEmpty () const noexcept
 
SidiListHookoperator= (const SidiListHook &) noexcept=delete
 
SidiListHookoperator= (const SidiListHook &) noexcept=delete
 
SidiListHookoperator= (SidiListHook &&) noexcept=default
 
SidiListHookoperator= (SidiListHook &&) noexcept=default
 
TNodepopFront () noexcept
 
TNodepopFront () noexcept
 
void pushFront (TNode *elem) noexcept
 
void pushFront (TNode *elem) noexcept
 
void pushFront (TNode *first, TNode *last)
 
void pushFront (TNode *first, TNode *last)
 
void reset () noexcept
 Resets this list to zero elements.
 
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
 

Friends And Related Entity Details:

◆ RecyclerShared

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

Definition at line 402 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 405 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 408 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 413 of file recycling.inl.

Here is the call graph for this function:

◆ 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 418 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 422 of file recycling.inl.

Here is the call graph for this function:

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 439 of file recycling.inl.

Here is the call graph for this function:

◆ 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 445 of file recycling.inl.

Here is the call graph for this function:

◆ 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 425 of file recycling.inl.

Here is the call graph for this function:

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