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

Singly linked list node (non-circular). More...

#include <slink_nc.H>

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

Classes

class  Iterator
 

Public Member Functions

 Slink_Nc ()
 Empty constructor.
 
 Slink_Nc (const Slink_Nc &)
 Copy constructor; sets the next link to nullptr.
 
 ~Slink_Nc ()
 
Slink_Ncoperator= (const Slink_Nc &link)
 Assignment; sets the next link to nullptr.
 
void reset ()
 Resets the link to nullptr.
 
bool is_empty () const
 Returns true if this is empty (points to nullptr).
 
Slink_Nc *& get_next ()
 Returns the next link.
 
const Slink_Ncget_next () const
 Returns the next link (constant version).
 
void insert (Slink_Nc *p)
 Inserts link p after this.
 
Slink_Ncremove_next ()
 Removes the link following this.
 

Protected Attributes

Slink_Ncnext
 

Detailed Description

Singly linked list node (non-circular).

Slink_Nc models a pointer to a node within a non-circular singly linked list.

See also
Snode Slist DynSlist Dlink

Definition at line 55 of file slink_nc.H.

Constructor & Destructor Documentation

◆ Slink_Nc() [1/2]

Aleph::Slink_Nc::Slink_Nc ( )
inline

Empty constructor.

Definition at line 62 of file slink_nc.H.

◆ Slink_Nc() [2/2]

Aleph::Slink_Nc::Slink_Nc ( const Slink_Nc )
inline

Copy constructor; sets the next link to nullptr.

Definition at line 65 of file slink_nc.H.

◆ ~Slink_Nc()

Aleph::Slink_Nc::~Slink_Nc ( )
inline

Definition at line 67 of file slink_nc.H.

Member Function Documentation

◆ get_next() [1/2]

◆ get_next() [2/2]

const Slink_Nc * Aleph::Slink_Nc::get_next ( ) const
inline

Returns the next link (constant version).

Returns
a constant pointer to the next link.
Exceptions
none

Definition at line 107 of file slink_nc.H.

References Aleph::divide_and_conquer_partition_dp(), and next.

◆ insert()

void Aleph::Slink_Nc::insert ( Slink_Nc p)
inline

Inserts link p after this.

insert(p) inserts a simple node whose link is p after the node whose link is this.

Parameters
[in]pthe simple link to insert.

Definition at line 120 of file slink_nc.H.

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

Referenced by Aleph::Dyn_Slist_Nc< T >::append(), and Aleph::Dyn_Slist_Nc< T >::insert().

◆ is_empty()

◆ operator=()

Slink_Nc & Aleph::Slink_Nc::operator= ( const Slink_Nc link)
inline

Assignment; sets the next link to nullptr.

Definition at line 70 of file slink_nc.H.

References ah_invalid_argument_if, Aleph::divide_and_conquer_partition_dp(), is_empty(), and next.

◆ remove_next()

Slink_Nc * Aleph::Slink_Nc::remove_next ( )
inline

Removes the link following this.

remove_next() removes the simple node situated after the node whose link is this and returns the address of the removed link.

Returns
the removed link.

Definition at line 137 of file slink_nc.H.

References Aleph::divide_and_conquer_partition_dp(), next, and reset().

Referenced by Aleph::Snode_Nc< T >::remove_next().

◆ reset()

void Aleph::Slink_Nc::reset ( )
inline

Resets the link to nullptr.

Definition at line 83 of file slink_nc.H.

References Aleph::divide_and_conquer_partition_dp(), and next.

Referenced by Aleph::Dyn_Slist_Nc< T >::empty(), and remove_next().

Member Data Documentation

◆ next

Slink_Nc* Aleph::Slink_Nc::next
protected

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