Recti 1.2.4
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
RDllist Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RDllist()

RDllist::RDllist ( size_t  num_nodes,
bool  reverse = false 
)
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.

Parameters
[in]num_nodesThe number of nodes to create in the list
[in]reverseIf true, creates the list in reverse order

Member Function Documentation

◆ begin() [1/2]

auto RDllist::begin ( ) -> RDllIterator
inline

Get an iterator to the beginning of the list.

Returns
An RDllIterator to the first node.

◆ begin() [2/2]

auto RDllist::begin ( ) const -> RDllIterator
inline

Get an iterator to the beginning of the list (const).

Returns
An RDllIterator to the first node.

◆ from_node() [1/2]

auto RDllist::from_node ( size_t  k) -> RDllIterator
inline

Get an iterator starting from a given node (mutable).

Parameters
[in]kThe index of the starting node.
Returns
An RDllIterator beginning at the given node.

◆ from_node() [2/2]

auto RDllist::from_node ( size_t  k) const -> RDllIterator
inline

Get an iterator starting from a given node (const).

Parameters
[in]kThe index of the starting node.
Returns
An RDllIterator beginning at the given node.

◆ operator[]() [1/2]

auto RDllist::operator[] ( size_t  k) -> Dllink<size_t>&
inline

Access a node by index (mutable).

Parameters
[in]kThe index of the node to access.
Returns
A mutable reference to the Dllink at index k.

◆ operator[]() [2/2]

auto RDllist::operator[] ( size_t  k) const -> const Dllink<size_t>&
inline

Access a node by index (const).

Parameters
[in]kThe index of the node to access.
Returns
A const reference to the Dllink at index k.

Member Data Documentation

◆ cycle

std::vector<Dllink<size_t> > RDllist::cycle

Storage for all list nodes.


The documentation for this class was generated from the following file: