Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Snode< T > Class Template Reference

Singly linked node that stores data of type T. More...

#include <tpl_snode.H>

Inheritance diagram for Aleph::Snode< T >:
[legend]
Collaboration diagram for Aleph::Snode< T >:
[legend]

Public Member Functions

Tget_data ()
 Return a modifiable reference to the stored data.
 
const Tget_data () const
 Return a constant reference to the stored data.
 
 Snode ()=default
 Default constructor.
 
 Snode (const T &_data)
 Constructor that copies the value.
 
 Snode (T &&_data)
 Constructor that moves the value.
 
Snoderemove_next ()
 Remove the node right after this and return it.
 
Snode *& get_next ()
 Return the next node after this.
 
const Snodeget_next () const
 Return the next node after this (const overload).
 
Snoderemove_first ()
 Remove and return the first node (for symmetry with list front).
 
const Snodeget_first () const
 Return the first node (const alias of get_next).
 

Private Attributes

T data
 

Additional Inherited Members

Detailed Description

template<typename T>
class Aleph::Snode< T >

Singly linked node that stores data of type T.

Snode inherits the Slink interface and adds the payload held by the node.

Template Parameters
Ttype of the stored value
See also
DynSlist Snode Slink

Definition at line 65 of file tpl_snode.H.

Constructor & Destructor Documentation

◆ Snode() [1/3]

template<typename T >
Aleph::Snode< T >::Snode ( )
default

Default constructor.

◆ Snode() [2/3]

template<typename T >
Aleph::Snode< T >::Snode ( const T _data)
inline

Constructor that copies the value.

Definition at line 82 of file tpl_snode.H.

◆ Snode() [3/3]

template<typename T >
Aleph::Snode< T >::Snode ( T &&  _data)
inline

Constructor that moves the value.

Definition at line 85 of file tpl_snode.H.

Member Function Documentation

◆ get_data() [1/2]

template<typename T >
T & Aleph::Snode< T >::get_data ( )
inline

Return a modifiable reference to the stored data.

Definition at line 73 of file tpl_snode.H.

References Aleph::Snode< T >::data.

Referenced by Aleph::DynSlist< T >::Iterator::get_curr(), Aleph::DynSlist< T >::Iterator::get_curr(), Aleph::DynSlist< T >::operator[](), TEST(), and TEST().

◆ get_data() [2/2]

template<typename T >
const T & Aleph::Snode< T >::get_data ( ) const
inline

Return a constant reference to the stored data.

Definition at line 76 of file tpl_snode.H.

References Aleph::Snode< T >::data.

◆ get_first()

template<typename T >
const Snode * Aleph::Snode< T >::get_first ( ) const
inline

Return the first node (const alias of get_next).

Definition at line 103 of file tpl_snode.H.

References Aleph::Snode< T >::get_next().

◆ get_next() [1/2]

◆ get_next() [2/2]

template<typename T >
const Snode * Aleph::Snode< T >::get_next ( ) const
inline

Return the next node after this (const overload).

Definition at line 94 of file tpl_snode.H.

References Aleph::Slink::get_next().

◆ remove_first()

template<typename T >
Snode * Aleph::Snode< T >::remove_first ( )
inline

Remove and return the first node (for symmetry with list front).

Definition at line 100 of file tpl_snode.H.

References Aleph::Snode< T >::remove_next().

Referenced by TEST().

◆ remove_next()

template<typename T >
Snode * Aleph::Snode< T >::remove_next ( )
inline

Remove the node right after this and return it.

Definition at line 88 of file tpl_snode.H.

References Aleph::Slink::remove_next().

Referenced by Aleph::Slist< T >::remove_first(), Aleph::Snode< T >::remove_first(), Aleph::Slist< T >::remove_first_ne(), and TEST().

Member Data Documentation

◆ data


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