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

Iterator on HTList. More...

#include <htlist.H>

Inheritance diagram for Aleph::HTList::Iterator:
[legend]
Collaboration diagram for Aleph::HTList::Iterator:
[legend]

Public Member Functions

 Iterator () noexcept=default
 
 Iterator (const HTList &list) noexcept
 Initialize iterator on at the first item of list
 
void reset () noexcept
 Reset the iterator at the first item.
 
long get_pos () const noexcept
 Return the current position.
 
void reset_first () noexcept
 
void reset_last ()
 It has O(n) of performance.
 
void end () noexcept
 Set the iterator to its end position, which has not current item.
 
Iteratoroperator= (const Iterator &it) noexcept
 Assignation.
 
bool has_curr () const noexcept
 Return true if iterator has current item.
 
bool is_last () const noexcept
 
bool is_in_first () const noexcept
 Return true if the iterator is positioned on the first item.
 
bool is_in_last () const noexcept
 Return true if the iterator is positioned on the last item.
 
Slinkncget_curr () const
 Return the current node 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 item forward.
 
Slinkncdel_ne () noexcept
 
Slinkncdel ()
 Remove the current item.
 

Private Attributes

HTListlptr = nullptr
 
Slinknccurr = nullptr
 
Slinkncprev = nullptr
 
long pos = 0
 

Detailed Description

Iterator on HTList.

Definition at line 1082 of file htlist.H.

Constructor & Destructor Documentation

◆ Iterator() [1/2]

Aleph::HTList::Iterator::Iterator ( )
defaultnoexcept

◆ Iterator() [2/2]

Aleph::HTList::Iterator::Iterator ( const HTList list)
inlinenoexcept

Initialize iterator on at the first item of list

Definition at line 1097 of file htlist.H.

Member Function Documentation

◆ del()

Slinknc * Aleph::HTList::Iterator::del ( )
inline

Remove the current item.

del() removes the current item of iterator and advaces it a position forward.

Returns
a valid pointer to the removed item
Exceptions
overflow_errorif iterator has not current item

Definition at line 1276 of file htlist.H.

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

Referenced by Aleph::DynList< T >::Iterator::del().

◆ del_ne()

Slinknc * Aleph::HTList::Iterator::del_ne ( )
inlinenoexcept

◆ end()

void Aleph::HTList::Iterator::end ( )
inlinenoexcept

Set the iterator to its end position, which has not current item.

Definition at line 1133 of file htlist.H.

References curr.

Referenced by TEST().

◆ get_curr()

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

Return the current node on which the iterator is positioned.

Exceptions
overflow_errorif iterator has not current node

Definition at line 1177 of file htlist.H.

References ah_overflow_error_if, and curr.

Referenced by Aleph::DynList< T >::Iterator::get_curr(), Aleph::insert_sorted(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ get_curr_ne()

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

Return the current link guaranteeing no exception. Be careful.

Definition at line 1186 of file htlist.H.

References curr.

Referenced by Aleph::DynList< T >::Iterator::get_curr_ne().

◆ get_pos()

long Aleph::HTList::Iterator::get_pos ( ) const
inlinenoexcept

Return the current position.

Definition at line 1111 of file htlist.H.

References pos.

Referenced by TEST().

◆ has_curr()

◆ is_in_first()

bool Aleph::HTList::Iterator::is_in_first ( ) const
inlinenoexcept

Return true if the iterator is positioned on the first item.

Definition at line 1158 of file htlist.H.

References curr, Aleph::HTList::head, Aleph::HTList::is_empty(), lptr, and Aleph::maps().

Referenced by TEST().

◆ is_in_last()

bool Aleph::HTList::Iterator::is_in_last ( ) const
inlinenoexcept

Return true if the iterator is positioned on the last item.

Definition at line 1164 of file htlist.H.

References is_last().

Referenced by TEST().

◆ is_last()

bool Aleph::HTList::Iterator::is_last ( ) const
inlinenoexcept

Definition at line 1152 of file htlist.H.

References curr, Aleph::HTList::is_empty(), lptr, Aleph::maps(), and Aleph::HTList::tail.

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

◆ next()

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

Move the iterator one item forward.

Throw overflow_error if iterator has not current item

Definition at line 1222 of file htlist.H.

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

Referenced by Aleph::GiftWrappingConvexHull::get_lowest_point(), Aleph::insert_sorted(), Aleph::QuickHull::search_extremes(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ next_ne()

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

◆ operator=()

Iterator & Aleph::HTList::Iterator::operator= ( const Iterator it)
inlinenoexcept

Assignation.

Definition at line 1139 of file htlist.H.

References curr, lptr, pos, and prev.

◆ reset()

Aleph::HTList::Iterator::reset ( )
inlinenoexcept

Reset the iterator at the first item.

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

References curr, Aleph::HTList::head, lptr, pos, and prev.

Referenced by reset_first(), reset_last(), and TEST_F().

◆ reset_first()

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

Definition at line 1114 of file htlist.H.

References reset().

Referenced by TEST().

◆ reset_last()

void Aleph::HTList::Iterator::reset_last ( )
inline

It has O(n) of performance.

Definition at line 1117 of file htlist.H.

References curr, Aleph::HTList::is_empty(), lptr, NEXT, pos, prev, and reset().

Referenced by TEST().

Member Data Documentation

◆ curr

Slinknc* Aleph::HTList::Iterator::curr = nullptr
private

◆ lptr

HTList* Aleph::HTList::Iterator::lptr = nullptr
private

Definition at line 1084 of file htlist.H.

Referenced by del_ne(), is_in_first(), is_last(), next_ne(), operator=(), reset(), and reset_last().

◆ pos

long Aleph::HTList::Iterator::pos = 0
private

Definition at line 1088 of file htlist.H.

Referenced by get_pos(), next_ne(), operator=(), reset(), and reset_last().

◆ prev

Slinknc* Aleph::HTList::Iterator::prev = nullptr
private

Definition at line 1086 of file htlist.H.

Referenced by del_ne(), next_ne(), operator=(), reset(), and reset_last().


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