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

Description:

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

This is the type that is exposed to users of the 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 393 of file recycler.hpp.

#include <recycler.hpp>

Inheritance diagram for SharedRecycler< TAllocator, TNode >:
[legend]
Collaboration diagram for 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 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 SidiListHook< TNode >
using TNode
 An alias for the node type.
 

Additional Inherited Members

- Public Type Index: inherited from AllocatorMember< TAllocator >
using AllocatorType = TAllocator
 Exposes the allocator type.
 
- Protected Field Index: inherited from AllocatorMember< TAllocator >
TAllocator & allocator
 A reference to the allocator.
 
- Protected Field Index: inherited from SidiNodeBase< TNode >
TNode * n
 
- Protected Method Index: inherited from 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 SidiNodeBase< TNode >
 SidiNodeBase () noexcept=default
 Default constructor. (Does not initialize the pointer.)
 
 SidiNodeBase (const SidiNodeBase &)=delete
 
 SidiNodeBase (SidiNodeBase &&) noexcept=default
 Defaulted move constructor.
 
 SidiNodeBase (TNode *next) noexcept
 
TNode * addBehind (TNode *elem) noexcept
 
integer count (SidiNodeBase *end=nullptr) const noexcept
 
bool hasNext () const
 
TNode * next () const
 
void next (SidiNodeBase *p)
 
SidiNodeBaseoperator= (const SidiNodeBase &)=delete
 
SidiNodeBaseoperator= (SidiNodeBase &&) noexcept=default
 
bool pointsTo (const SidiNodeBase *elem) const
 
TNode * removeNext () noexcept
 
TNode * removeRangeBehind (TNode *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 398 of file recycler.hpp.

Type Definition Details:

◆ allocBase

template<typename TAllocator , typename TNode >
using allocBase = lang::AllocatorMember<TAllocator>
protected

Shortcut to a base class.

Definition at line 401 of file recycler.hpp.

◆ hookBase

template<typename TAllocator , typename TNode >
using hookBase = lang::SidiListHook<TNode>
protected

Shortcut to a base class.

Definition at line 404 of file recycler.hpp.

Constructor(s) / Destructor Details:

◆ SharedRecycler() [1/2]

template<typename TAllocator , typename TNode >
SharedRecycler ( )
inlinenoexcept

Constructor taking no allocator, used with HeapAllocator.

Definition at line 409 of file recycler.hpp.

◆ SharedRecycler() [2/2]

template<typename TAllocator , typename TNode >
SharedRecycler ( TAllocator & pAllocator)
inlinenoexcept

Constructor taking an allocator.

Parameters
pAllocatorThe allocator to use.

Definition at line 414 of file recycler.hpp.

◆ ~SharedRecycler()

template<typename TAllocator , typename TNode >
~SharedRecycler ( )
inlinenoexcept

Destructor. Deletes all recyclables with the allocator.

Definition at line 418 of file recycler.hpp.

Here is the call graph for this function:

Method Details:

◆ Count()

template<typename TAllocator , typename TNode >
integer Count ( ) const
inlinenoexcept

Counts the number of recyclables.

Returns
The number of recycled container elements available.

Definition at line 435 of file recycler.hpp.

Here is the call graph for this function:

◆ Reserve()

template<typename TAllocator , typename TNode >
void 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 441 of file recycler.hpp.

Here is the call graph for this function:

◆ Reset()

template<typename TAllocator , typename TNode >
void Reset ( )
inlinenoexcept

Reset. Deletes all recyclables with the allocator.

Definition at line 421 of file recycler.hpp.

Here is the call graph for this function:

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