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

Iterator on single links. More...

#include <htlist.H>

Collaboration diagram for Aleph::Slinknc::Iterator:
[legend]

Public Member Functions

 Iterator () noexcept
 
 Iterator (Slinknc &list) noexcept
 Initialize an iterator on the first node of list
 
 Iterator (Slinknc *_head, Slinknc *_curr) noexcept
 Initialize an iterator on the list pointed by _head, but on a node pointed by curr
 
bool has_curr () const noexcept
 Return true if the iterator is positioned on a valid link.
 
Slinkncget_curr () const
 Return the current link on which the iterator is positioned.
 
Slinkncget_curr_ne () const noexcept
 Return the current link guaranteeing no exception. Be careful.
 
void next_ne () noexcept
 Move the iterator one position forward guaranteeing no exception.
 
void next ()
 Move the iterator one position forward.
 
void reset_first () noexcept
 Reset the iterator to the first link on the list.
 

Private Member Functions

void init () noexcept
 

Private Attributes

Slinknchead
 
Slinknccurr
 

Detailed Description

Iterator on single links.

Definition at line 211 of file htlist.H.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

Aleph::Slinknc::Iterator::Iterator ( )
inlinenoexcept

Definition at line 223 of file htlist.H.

◆ Iterator() [2/3]

Aleph::Slinknc::Iterator::Iterator ( Slinknc list)
inlinenoexcept

Initialize an iterator on the first node of list

Definition at line 231 of file htlist.H.

References Aleph::init.

◆ Iterator() [3/3]

Aleph::Slinknc::Iterator::Iterator ( Slinknc _head,
Slinknc _curr 
)
inlinenoexcept

Initialize an iterator on the list pointed by _head, but on a node pointed by curr

Definition at line 247 of file htlist.H.

Member Function Documentation

◆ get_curr()

Slinknc * Aleph::Slinknc::Iterator::get_curr ( ) const
inline

Return the current link on which the iterator is positioned.

Throw overflow_error if there is no current link.

Definition at line 273 of file htlist.H.

References ah_overflow_error_if, Aleph::has_curr(), and Aleph::maps().

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

◆ get_curr_ne()

Slinknc * Aleph::Slinknc::Iterator::get_curr_ne ( ) const
inlinenoexcept

Return the current link guaranteeing no exception. Be careful.

Definition at line 281 of file htlist.H.

◆ has_curr()

bool Aleph::Slinknc::Iterator::has_curr ( ) const
inlinenoexcept

Return true if the iterator is positioned on a valid link.

Definition at line 259 of file htlist.H.

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

◆ init()

void Aleph::Slinknc::Iterator::init ( )
inlineprivatenoexcept

Definition at line 216 of file htlist.H.

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

◆ next()

void Aleph::Slinknc::Iterator::next ( )
inline

Move the iterator one position forward.

Throw overflow_error if there is no current link.

Definition at line 296 of file htlist.H.

References ah_overflow_error_if, Aleph::has_curr(), Aleph::maps(), and Aleph::Slinknc::next.

Referenced by TEST(), and TEST_F().

◆ next_ne()

void Aleph::Slinknc::Iterator::next_ne ( )
inlinenoexcept

Move the iterator one position forward guaranteeing no exception.

Be careful.

Definition at line 285 of file htlist.H.

References Aleph::Slinknc::next.

◆ reset_first()

void Aleph::Slinknc::Iterator::reset_first ( )
inlinenoexcept

Reset the iterator to the first link on the list.

Definition at line 306 of file htlist.H.

References Aleph::init.

Referenced by TEST_F().

Member Data Documentation

◆ curr

Slinknc* Aleph::Slinknc::Iterator::curr
private

Definition at line 214 of file htlist.H.

◆ head

Slinknc* Aleph::Slinknc::Iterator::head
private

Definition at line 213 of file htlist.H.


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