Aleph-w 3.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

Tget_data () noexcept
 Return a modifiable reference to the data.
 
const Tget_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
 
Snodencremove_next () noexcept
 
Snodenc *& get_next () noexcept
 Return the node following to this
 
Snodencremove_first () noexcept
 
Snodenc *& get_first () const noexcept
 
- 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.
 
Slinkncoperator= (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.
 
Slinkncremove_next () noexcept
 
template<typename T >
Snodenc< T > * to_snodenc () noexcept
 Convert this to a Snodenc<T>.
 
template<typename T >
Tto_data () noexcept
 
template<typename T >
const Snodenc< T > * to_snodenc () const noexcept
 
template<typename T >
const Tto_data () const noexcept
 

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 279 of file htlist.H.

Constructor & Destructor Documentation

◆ Snodenc() [1/3]

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

Definition at line 293 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 301 of file htlist.H.

◆ Snodenc() [3/3]

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

Construct by moving item

Definition at line 309 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 291 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 287 of file htlist.H.

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

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

◆ get_first()

template<typename T >
Snodenc *& Aleph::Snodenc< T >::get_first ( ) const
inlinenoexcept
 Return the node following to `this`.

In the case where this is a pointer to the first node, returns the first node.

Returns
a pointer to the first node.

Definition at line 351 of file htlist.H.

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

◆ get_next()

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

Return the node following to this

Definition at line 332 of file htlist.H.

References Aleph::Slinknc::get_next().

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

◆ remove_first()

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

Definition at line 340 of file htlist.H.

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

◆ remove_next()

template<typename T >
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.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 325 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 281 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: