|
| List () |
| Initialize empty list.
|
|
| ~List () |
| Release ownership of containing objects.
|
|
size_t | size () const |
| Get number of elements in list.
|
|
bool | is_empty () const |
| Check if size is zero.
|
|
bool | contains (const T &elem) |
| Check if element belongs to list.
|
|
Pointer | front () const |
| Get first list element.
|
|
Pointer | back () const |
| Get last list element.
|
|
Pointer | nextof (T &elem) const |
| Get list element next to given one.
|
|
Pointer | prevof (T &elem) const |
| Get list element previous to given one.
|
|
void | push_front (T &elem) |
| Prepend element to list.
|
|
void | push_back (T &elem) |
| Append element to list.
|
|
void | pop_front () |
| Pop first element from list.
|
|
void | pop_back () |
| Pop last element from list.
|
|
void | insert_before (T &elem, T &before) |
| Insert element into list.
|
|
void | insert_after (T &elem, T &after) |
| Insert element into list.
|
|
void | remove (T &elem) |
| Remove element from list.
|
|
template<class T, template< class TT > class OwnershipPolicy = RefCountedOwnership, class Node = ListNode<>>
class roc::core::List< T, OwnershipPolicy, Node >
Intrusive doubly-linked list.
Does not perform allocations. Provides O(1) size check, membership check, insertion, and removal.
- Template Parameters
-
T | defines object type, it must inherit ListNode. |
OwnershipPolicy | defines ownership policy which is used to acquire an element ownership when it's added to the list and release ownership when it's removed from the list. |
Node | defines base class of list nodes. It is needed if ListNode is used with non-default tag. |
Definition at line 40 of file list.h.