Implements internal recycling interface. Used by container types of module ALib Containers that omit recycling (when their template parameter TRecycling evaluates to None).
TAllocator | The allocator to store and use. |
TNode | The type to recycle. Has to be derived of lang::SidiNodeBase. |
Definition at line 570 of file recycler.hpp.
#include <recycler.hpp>
Public Static Method Index: | |
static constexpr bool | IsRecycling () noexcept |
Public Method Index: | |
RecyclerVoid ()=default | |
Parameterless constructor. Used with type HeapAllocator. | |
RecyclerVoid (TAllocator &pAllocator) noexcept | |
constexpr integer | Count () const noexcept |
template<typename TChunk > | |
void | DisposeChunk (TChunk *chunk, size_t length) noexcept |
void | DisposeList (TNode *begin) noexcept |
std::pair< TNode *, integer > | DisposeList (TNode *begin, TNode *end) noexcept |
TNode * | Get () |
void | Recycle (TNode *elem) noexcept |
template<typename TChunk > | |
constexpr void | RecycleChunk (TChunk *chunk, size_t length) noexcept |
void | RecycleList (TNode *begin) noexcept |
std::pair< TNode *, integer > | RecycleList (TNode *begin, TNode *end) noexcept |
void | Reserve (integer) noexcept |
Does nothing. In debug-compilations a warning is raised. | |
void | Reset () noexcept |
Does nothing. Shared recyclers can't be reset. | |
![]() | |
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 | base = lang::AllocatorMember<TAllocator> |
The base type. | |
Additional Inherited Members | |
![]() | |
using | AllocatorType = TAllocator |
Exposes the allocator type. | |
![]() | |
TAllocator & | allocator |
A reference to the allocator. | |
|
protected |
The base type.
Definition at line 574 of file recycler.hpp.
|
inlinenoexcept |
Defaulted default constructor.
pAllocator | The allocator to use. |
Definition at line 582 of file recycler.hpp.
|
inlinenodiscardconstexprnoexcept |
This recycler just returns 0
. Attention: With other implementations, this method may run in linear time.
0
, which in this case is always the number of available elements. Definition at line 595 of file recycler.hpp.
|
inlinenoexcept |
Frees the given memory. Note that the shared recycler calls RecycleChunk with this method.
TChunk | The type of array that is to be freed. |
chunk | The chunk array to convert into nodes |
length | The length of the chunk array (pass 1 if the chunk is not an array type). |
Definition at line 657 of file recycler.hpp.
|
inlinenoexcept |
Deletes a list of elements (from the begin element to the last one).
begin | The first element of the list recycle, must not be nullptr . |
Definition at line 625 of file recycler.hpp.
|
inlinenoexcept |
Deletes a list of elements for recycling. Both given nodes have to exist.
begin | The first element of the list to free. |
end | The first element not to be freed. |
Definition at line 632 of file recycler.hpp.
|
inlinenodiscard |
Allocates a new one.
Definition at line 604 of file recycler.hpp.
|
inlinestaticconstexprnoexcept |
false
to indicate that this is a non-recycling version. Definition at line 589 of file recycler.hpp.
|
inlinenoexcept |
Frees an element.
elem | The element to store. |
Definition at line 608 of file recycler.hpp.
|
inlineconstexprnoexcept |
With other recyclers, this method converts a given chunk of memory, previously allocated with the same allocator that this type uses, into recyclable node objects.
This recycler just frees the object.
TChunk | The type of array that is to be cut into node elements. |
chunk | The chunk array to convert into nodes |
length | The length of the chunk array (pass 1 if the chunk is not an array type). |
Definition at line 643 of file recycler.hpp.
|
inlinenoexcept |
Frees the list.
begin | The first element of the list store, must not be nullptr . |
Definition at line 612 of file recycler.hpp.
|
inlinenoexcept |
Frees the list (as this is a non-recycling recycler).
begin | The first element of the list recycled. |
end | The first element not to be recycled. |
Definition at line 619 of file recycler.hpp.
|
inlinenoexcept |
Does nothing. In debug-compilations a warning is raised.
Definition at line 598 of file recycler.hpp.
|
inlinenoexcept |
Does nothing. Shared recyclers can't be reset.
Definition at line 586 of file recycler.hpp.