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

#include <htlist.H>

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

Public Member Functions

T & get_data () noexcept
 Return a modifiable reference to the data.
 
const T & get_data () const noexcept
 Return a constant reference to the data.
 
 Snodenc ()
 
 Snodenc (const T &item)
 Construct with copy of item
 
 Snodenc (T &&item)
 Construct by moving item
 
Snodenc * remove_next () noexcept
 
Snodenc *& get_next () noexcept
 Return the node following to this
 
Snodenc * remove_first () noexcept
 See remove_next().
 
Snodenc *& get_first () noexcept
 Return the first node of the list whose header is this.
 
- Public Member Functions inherited from Aleph::Slinknc
virtual ~Slinknc ()=default
 
constexpr bool is_empty () const noexcept
 Return true if this is empty.
 
 Slinknc () noexcept
 Init to nullptr.
 
 Slinknc (const Slinknc &) noexcept
 Dummy copy constructor.
 
void reset () noexcept
 Reset the link to nullptr.
 
Slinknc & operator= (const Slinknc &) noexcept
 Dummy asignation; link is set to nullptr.
 
Slinknc *& get_next () noexcept
 
void insert (Slinknc *p) noexcept
 insert(p) inserts the node pointed by p after this.
 
Slinknc * remove_next () noexcept
 
template<typename T >
Snodenc< T > * to_snodenc () noexcept
 Convert this to a Snodenc<T>.
 
template<typename T >
T & to_data () noexcept
 Return the item of the Snodenc<T> that this is.
 
template<typename T >
const Snodenc< T > * to_snodenc () const noexcept
 Convert this to a constant Snodenc<T>, as the other overload.
 
template<typename T >
const T & to_data () const noexcept
 Return the constant item of the Snodenc<T> that this is.
 

Private Attributes

T data
 

Detailed Description

template<typename T>
class Aleph::Snodenc< T >
 Node belonging to a single non-circular linked list without header

node.

Definition at line 288 of file htlist.H.

Constructor & Destructor Documentation

◆ Snodenc() [1/3]

template<typename T >
Aleph::Snodenc< T >::Snodenc ( )
inline

Definition at line 307 of file htlist.H.

◆ Snodenc() [2/3]

template<typename T >
Aleph::Snodenc< T >::Snodenc ( const T &  item)
inline

Construct with copy of item

Definition at line 314 of file htlist.H.

◆ Snodenc() [3/3]

template<typename T >
Aleph::Snodenc< T >::Snodenc ( T &&  item)
inline

Construct by moving item

Definition at line 321 of file htlist.H.

Member Function Documentation

◆ get_data() [1/2]

template<typename T >
const T & Aleph::Snodenc< T >::get_data ( ) const
inlinenoexcept

Return a constant reference to the data.

Definition at line 302 of file htlist.H.

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

◆ get_data() [2/2]

template<typename T >
T & Aleph::Snodenc< T >::get_data ( )
inlinenoexcept

Return a modifiable reference to the data.

Definition at line 295 of file htlist.H.

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

Referenced by Aleph::DynList< T >::get_last_ne(), Aleph::DynList< T >::get_last_ne(), print(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), and Aleph::Slinknc::to_data().

◆ get_first()

template<typename T >
Snodenc *& Aleph::Snodenc< T >::get_first ( )
inlinenoexcept

Return the first node of the list whose header is this.

It is the node following to this, as in get_next().

Returns
a reference to the link of this, so that assigning to it changes the list. The link is null if the list is empty.

Definition at line 363 of file htlist.H.

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

Referenced by TEST(), TEST(), and TEST().

◆ get_next()

template<typename T >
Snodenc *& Aleph::Snodenc< T >::get_next ( )
inlinenoexcept

Return the node following to this

Definition at line 342 of file htlist.H.

References Aleph::Slinknc::get_next().

Referenced by Aleph::DynList< T >::empty(), Aleph::Snodenc< T >::get_first(), and TEST().

◆ remove_first()

template<typename T >
Snodenc * Aleph::Snodenc< T >::remove_first ( )
inlinenoexcept

See remove_next().

Definition at line 350 of file htlist.H.

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

Referenced by TEST().

◆ remove_next()

template<typename T >
Snodenc * Aleph::Snodenc< T >::remove_next ( )
inlinenoexcept
     Remove the node following to `this`.

remove_next()removes the node linked after this and returns its address.

Returns
a pointer to the removed node.

Definition at line 335 of file htlist.H.

References Aleph::Slinknc::remove_next().

Referenced by Aleph::Snodenc< T >::remove_first().

Member Data Documentation

◆ data

template<typename T >
T Aleph::Snodenc< T >::data
private

Definition at line 290 of file htlist.H.

Referenced by Aleph::Snodenc< T >::get_data(), and Aleph::Snodenc< T >::get_data().


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