Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Slink Class Reference

Singly linked handle to list nodes. More...

#include <slink.H>

Inheritance diagram for Aleph::Slink:
[legend]
Collaboration diagram for Aleph::Slink:
[legend]

Public Member Functions

 Slink ()
 Default constructor.
 
void reset () noexcept
 Reset the link so it points to itself.
 
constexpr bool is_empty () const noexcept
 Return true if this link is empty (points to itself).
 
constexpr Slink *& get_next () noexcept
 Return the next link.
 
constexpr const Slinkget_next () const noexcept
 Return the next link (const overload).
 
void insert_next (Slink *p)
 Insert link p right after this.
 
Slinkremove_next ()
 Remove the link right after this.
 

Protected Attributes

Slinknext
 

Detailed Description

Singly linked handle to list nodes.

Slink models a pointer to a node inside a singly linked list.

See also
Snode Slist DynSlist Dlink

Definition at line 61 of file slink.H.

Constructor & Destructor Documentation

◆ Slink()

Aleph::Slink::Slink ( )
inline

Default constructor.

Definition at line 70 of file slink.H.

Member Function Documentation

◆ get_next() [1/2]

constexpr const Slink * Aleph::Slink::get_next ( ) const
inlineconstexprnoexcept

Return the next link (const overload).

Definition at line 90 of file slink.H.

References next.

◆ get_next() [2/2]

constexpr Slink *& Aleph::Slink::get_next ( )
inlineconstexprnoexcept

◆ insert_next()

void Aleph::Slink::insert_next ( Slink p)
inline

Insert link p right after this.

insert_next(p) inserts the single link p after the node whose link is this.

Parameters
[in]psingle link to insert

Definition at line 102 of file slink.H.

References is_empty(), Aleph::maps(), and next.

Referenced by Aleph::Slist< T >::insert_first(), TEST(), and TEST().

◆ is_empty()

constexpr bool Aleph::Slink::is_empty ( ) const
inlineconstexprnoexcept

◆ remove_next()

Slink * Aleph::Slink::remove_next ( )
inline

Remove the link right after this.

remove_next() removes the next single link and returns its address.

Returns
pointer to the removed link

Definition at line 118 of file slink.H.

References is_empty(), Aleph::maps(), next, and Aleph::HTList::reset().

Referenced by Aleph::Snode< T >::remove_next(), TEST(), and TEST().

◆ reset()

void Aleph::Slink::reset ( )
inlinenoexcept

Reset the link so it points to itself.

Definition at line 73 of file slink.H.

References next.

Referenced by TEST(), and TEST().

Member Data Documentation

◆ next

Slink* Aleph::Slink::next
protected

Definition at line 65 of file slink.H.

Referenced by get_next(), get_next(), insert_next(), is_empty(), remove_next(), and reset().


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