![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "lib/linked-elements.hpp"
Intrusive single linked list, possibly taking ownership of node elements.
Additional elements can be pushed (prepended) to the list; element access is per index number (slow) or through an Lumiera Forward Iterator traversing the linked list. There is no support for changing the list contents aside of discarding any element in the list.
The allocation and ownership related behaviour is controlled by a policy class provided as template parameter. When this policy supports creation of new elements, these might be created and prepended in one step.
sizeof(LinkedElements) == sizeof(N*) Definition at line 158 of file linked-elements.hpp.
Classes | |
| struct | IterationState |
| Iteration is just following the single linked list. More... | |
Public Types | |
| using | iterator = IterStateWrapper< IterationState, N & > |
| using | const_iterator = IterStateWrapper< IterationState, const N & > |
Public Member Functions | |
| ~LinkedElements () noexcept | |
| LinkedElements () | |
| LinkedElements (LinkedElements const &)=default | |
| LinkedElements (LinkedElements &&rr) | |
| LinkedElements (ALO::CustomAllocator allo) | |
| template<class IT > | |
| LinkedElements (IT &&elements) | |
| creating a LinkedElements list in RAII-style: | |
| void | clear () noexcept |
| template<class IT > | |
| void | pushAll (IT elements) |
| convenience shortcut to add all the elements yielded by the given Lumiera Forward Iterator | |
| template<typename TY > | |
| TY & | push (TY &elm) noexcept |
| accept the given element and prepend it to the list of elements; depending on the allocation policy, this might imply taking ownership | |
| template<class TY = N, typename... ARGS> | |
| TY & | emplace (ARGS &&...args) |
| prepend object of type TY, forwarding ctor args | |
| LinkedElements & | reverse () |
| Mutate the complete list to change the order of elements. | |
| N & | operator[] (size_t index) const |
| N & | top () const |
| size_t | size () const |
| bool | empty () const |
| iterator | begin () |
| const_iterator | begin () const |
| iterator | end () |
| const_iterator | end () const |
Private Attributes | |
| N * | head_ |
Additional Inherited Members | |
Private Types inherited from OwningAllocated< ALO > | |
| using | CustomAllocator = ALO |
Private Member Functions inherited from StdFactory< ALO > | |
| StdFactory (Allo allo=Allo{}) | |
| Create an instance of the adapter factory, forwarding to the embedded standard conforming allocator for object creation and destruction and memory management. | |
| template<class XALO > | |
| bool constexpr | operator== (StdFactory< XALO > const &o) const |
| template<class XALO > | |
| bool constexpr | operator!= (StdFactory< XALO > const &o) const |
| template<class TY , typename... ARGS> | |
| TY * | create (ARGS &&...args) |
| create new element using the embedded allocator | |
| template<class TY > | |
| void | dispose (TY *elm) |
| destroy the given element and discard the associated memory | |
Private Member Functions inherited from MoveOnly | |
| ~MoveOnly ()=default | |
| MoveOnly ()=default | |
| MoveOnly (MoveOnly &&)=default | |
| MoveOnly (MoveOnly const &)=delete | |
| MoveOnly & | operator= (MoveOnly &&)=delete |
| MoveOnly & | operator= (MoveOnly const &)=delete |
|
inlinenoexcept |
Definition at line 166 of file linked-elements.hpp.
References LinkedElements< N, ALO >::clear().
Here is the call graph for this function:
|
inline |
Definition at line 171 of file linked-elements.hpp.
|
default |
|
inline |
Definition at line 176 of file linked-elements.hpp.
|
inlineexplicit |
| allo | custom allocator or memory manager to be used by the policy for creating and discarding of node elements |
Definition at line 187 of file linked-elements.hpp.
|
inline |
creating a LinkedElements list in RAII-style:
| elements | iterator to provide all the elements to be pushed into this newly created collection |
Definition at line 200 of file linked-elements.hpp.
References LinkedElements< N, ALO >::clear(), lib::elements(), and LinkedElements< N, ALO >::pushAll().
Here is the call graph for this function:| using iterator = IterStateWrapper<IterationState, N&> |
Definition at line 397 of file linked-elements.hpp.
| using const_iterator = IterStateWrapper<IterationState, const N&> |
Definition at line 398 of file linked-elements.hpp.
|
inlinenoexcept |
Definition at line 218 of file linked-elements.hpp.
References ERROR_LOG_AND_IGNORE, and LinkedElements< N, ALO >::head_.
Referenced by LinkedElements< N, ALO >::LinkedElements(), LinkedElements< N, ALO >::~LinkedElements(), and AllocationCluster::StorageManager::discardAll().
Here is the caller graph for this function:
|
inline |
convenience shortcut to add all the elements yielded by the given Lumiera Forward Iterator
Definition at line 238 of file linked-elements.hpp.
References lib::elements(), and LinkedElements< N, ALO >::push().
Referenced by LinkedElements< N, ALO >::LinkedElements().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinenoexcept |
accept the given element and prepend it to the list of elements; depending on the allocation policy, this might imply taking ownership
Definition at line 253 of file linked-elements.hpp.
References LinkedElements< N, ALO >::head_.
Referenced by AllocationCluster::StorageManager::attach(), LinkedElements< N, ALO >::emplace(), LinkedElements< N, ALO >::pushAll(), and LinkedElements< N, ALO >::reverse().
Here is the caller graph for this function:
|
inline |
prepend object of type TY, forwarding ctor args
Definition at line 265 of file linked-elements.hpp.
References LinkedElements< N, ALO >::push().
Referenced by AllocationCluster::StorageManager::prependNextBlock().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Mutate the complete list to change the order of elements.
Definition at line 279 of file linked-elements.hpp.
References LinkedElements< N, ALO >::empty(), LinkedElements< N, ALO >::head_, and LinkedElements< N, ALO >::push().
Here is the call graph for this function:
|
inline |
Definition at line 300 of file linked-elements.hpp.
References LinkedElements< N, ALO >::head_, and LERR_.
|
inline |
Definition at line 319 of file linked-elements.hpp.
References LinkedElements< N, ALO >::head_.
Referenced by AllocationCluster::StorageManager::prependNextBlock().
Here is the caller graph for this function:
|
inline |
Definition at line 328 of file linked-elements.hpp.
References LinkedElements< N, ALO >::head_.
|
inline |
Definition at line 342 of file linked-elements.hpp.
References LinkedElements< N, ALO >::head_.
Referenced by LinkedElements< N, ALO >::reverse().
Here is the caller graph for this function:
|
inline |
Definition at line 401 of file linked-elements.hpp.
References LinkedElements< N, ALO >::head_.
Referenced by JobTicket::getPrerequisites().
Here is the caller graph for this function:
|
inline |
Definition at line 402 of file linked-elements.hpp.
References LinkedElements< N, ALO >::head_.
|
inline |
Definition at line 403 of file linked-elements.hpp.
|
inline |
Definition at line 404 of file linked-elements.hpp.
|
private |
Definition at line 161 of file linked-elements.hpp.
Referenced by LinkedElements< N, ALO >::begin(), LinkedElements< N, ALO >::begin(), LinkedElements< N, ALO >::clear(), LinkedElements< N, ALO >::empty(), LinkedElements< N, ALO >::operator[](), LinkedElements< N, ALO >::push(), LinkedElements< N, ALO >::reverse(), LinkedElements< N, ALO >::size(), and LinkedElements< N, ALO >::top().
Inheritance diagram for LinkedElements< N, ALO >:
Collaboration diagram for LinkedElements< N, ALO >: