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

Iterator on the items of list. More...

#include <htlist.H>

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

Public Types

using Item_Type = T
 
using Iterator_Type = Iterator
 The type of elements of list.
 
using Set_Type = DynList
 

Public Member Functions

 Iterator () noexcept=default
 The type of container.
 
 Iterator (const DynList &list) noexcept
 Initiliaze an iterator on the first item of list
 
Tget_curr_ne () const noexcept
 Return the current link guaranteeing no exception. Be careful.
 
Tget_curr () const
 Return the current item.
 
T del ()
 Remove the current item of the iterator.
 
- Public Member Functions inherited from Aleph::HTList::Iterator
 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.
 

Detailed Description

template<typename T = int>
class Aleph::DynList< T >::Iterator

Iterator on the items of list.

Definition at line 1713 of file htlist.H.

Member Typedef Documentation

◆ Item_Type

template<typename T = int>
using Aleph::DynList< T >::Iterator::Item_Type = T

Definition at line 1717 of file htlist.H.

◆ Iterator_Type

template<typename T = int>
using Aleph::DynList< T >::Iterator::Iterator_Type = Iterator

The type of elements of list.

Definition at line 1719 of file htlist.H.

◆ Set_Type

template<typename T = int>
using Aleph::DynList< T >::Iterator::Set_Type = DynList

Definition at line 1721 of file htlist.H.

Constructor & Destructor Documentation

◆ Iterator() [1/2]

template<typename T = int>
Aleph::DynList< T >::Iterator::Iterator ( )
defaultnoexcept

The type of container.

◆ Iterator() [2/2]

template<typename T = int>
Aleph::DynList< T >::Iterator::Iterator ( const DynList list)
inlinenoexcept

Initiliaze an iterator on the first item of list

Definition at line 1726 of file htlist.H.

Member Function Documentation

◆ del()

template<typename T = int>
T Aleph::DynList< T >::Iterator::del ( )
inline

Remove the current item of the iterator.

del() removes the current item and advance forward the iterator to the next item.

Returns
a moved copy of removed item (moved because the original will be destroyed)
Exceptions
overflow_errorif the iterator has not current item

Definition at line 1754 of file htlist.H.

References Aleph::HTList::Iterator::del(), and FunctionalMethods< Container, T >::maps().

Referenced by TEST_F(), and TEST_F().

◆ get_curr()

template<typename T = int>
T & Aleph::DynList< T >::Iterator::get_curr ( ) const
inline

Return the current item.

Returns
a modifiable reference to the current item
Exceptions
overflow_errorif the iterator has not current item

Definition at line 1740 of file htlist.H.

References Aleph::HTList::Iterator::get_curr().

Referenced by Aleph::DynList< T >::get(), Aleph::GiftWrappingConvexHull::get_lowest_point(), Aleph::QuickHull::search_extremes(), TEST_F(), TEST_F(), and TEST_F().

◆ get_curr_ne()

template<typename T = int>
T & Aleph::DynList< T >::Iterator::get_curr_ne ( ) const
inlinenoexcept

Return the current link guaranteeing no exception. Be careful.

Definition at line 1730 of file htlist.H.

References Aleph::HTList::Iterator::get_curr_ne().

Referenced by Aleph::search_extreme(), and Aleph::Random_Graph_Base< GT, Init_Node, Init_Arc >::select_random_node().


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