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 574 of file recycling.inl.
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. | |
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 | base = lang::AllocatorMember<TAllocator> |
| The base 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 |
The base type.
Definition at line 578 of file recycling.inl.
|
inlinenoexcept |
Defaulted default constructor.
| pAllocator | The allocator to use. |
Definition at line 586 of file recycling.inl.
|
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 599 of file recycling.inl.
|
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 661 of file recycling.inl.
|
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 629 of file recycling.inl.
|
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 636 of file recycling.inl.
|
inlinenodiscard |
Allocates a new one.
Definition at line 608 of file recycling.inl.
|
inlinestaticconstexprnoexcept |
false to indicate that this is a non-recycling version. Definition at line 593 of file recycling.inl.
|
inlinenoexcept |
Frees an element.
| elem | The element to store. |
Definition at line 612 of file recycling.inl.
|
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 647 of file recycling.inl.
|
inlinenoexcept |
Frees the list.
| begin | The first element of the list store, must not be nullptr. |
Definition at line 616 of file recycling.inl.
|
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 623 of file recycling.inl.
|
inlinenoexcept |
Does nothing. In debug-compilations a warning is raised.
Definition at line 602 of file recycling.inl.
|
inlinenoexcept |
Does nothing. Shared recyclers can't be reset.
Definition at line 590 of file recycling.inl.