|
Recti 1.2.4
|
Circular doubly-linked list implementation. More...
#include <rdllist.hpp>
Public Member Functions | |
| RDllist (size_t num_nodes, bool reverse=false) | |
| Construct a new RDllist object. | |
| auto | operator[] (size_t k) -> Dllink< size_t > & |
| Access a node by index (mutable). | |
| auto | operator[] (size_t k) const -> const Dllink< size_t > & |
| Access a node by index (const). | |
| auto | from_node (size_t k) -> RDllIterator |
| Get an iterator starting from a given node (mutable). | |
| auto | from_node (size_t k) const -> RDllIterator |
| Get an iterator starting from a given node (const). | |
| auto | begin () -> RDllIterator |
| Get an iterator to the beginning of the list. | |
| auto | begin () const -> RDllIterator |
| Get an iterator to the beginning of the list (const). | |
Public Attributes | |
| std::vector< Dllink< size_t > > | cycle |
| Storage for all list nodes. | |
Circular doubly-linked list implementation.
This class implements a circular doubly-linked list using the Dllink template with size_t as the data type. It provides efficient node management and supports both forward and reverse ordering.
|
inlineexplicit |
Construct a new RDllist object.
Creates a circular doubly-linked list with the specified number of nodes. The nodes are linked together in a circular fashion, with the last node pointing back to the first.
| [in] | num_nodes | The number of nodes to create in the list |
| [in] | reverse | If true, creates the list in reverse order |
|
inline |
Get an iterator to the beginning of the list.
|
inline |
Get an iterator to the beginning of the list (const).
|
inline |
Get an iterator starting from a given node (mutable).
| [in] | k | The index of the starting node. |
|
inline |
Get an iterator starting from a given node (const).
| [in] | k | The index of the starting node. |
|
inline |
Access a node by index (mutable).
| [in] | k | The index of the node to access. |
|
inline |
Access a node by index (const).
| [in] | k | The index of the node to access. |
| std::vector<Dllink<size_t> > RDllist::cycle |
Storage for all list nodes.