Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::In_Arcs_Index< GT, SA >::Iterator Class Reference

Iterator on the arcs into a node, in the order of the arc iterator of the graph when the index was built. More...

#include <tpl_graph.H>

Public Types

using Item_Type = Arc *
 The type of the items: arcs.
 

Public Member Functions

 Iterator () noexcept=default
 An iterator without arcs.
 
 Iterator (Arc *const *a, const long n) noexcept
 An iterator on the n arcs from a.
 
 Iterator (const In_Arcs_Index &index, const Node *p)
 An iterator on the arcs into p of index.
 
bool has_curr () const noexcept
 Return true if the iterator is on an arc.
 
Arc * get_curr_ne () const noexcept
 Return the current arc, which must exist.
 
Arc * get_curr () const
 Return the current arc.
 
Arc * get_current_arc_ne () const noexcept
 See get_curr_ne().
 
Arc * get_current_arc () const
 See get_curr().
 
Node * get_node_ne () const noexcept
 Return the source of the current arc, which must exist.
 
Node * get_node () const
 Return the source of the current arc. Throws as get_curr().
 
void next_ne () noexcept
 Move to the next arc; the iterator must be on an arc.
 
void next ()
 Move to the next arc.
 
void prev_ne () noexcept
 Move to the previous arc; the iterator must be on an arc.
 
void prev ()
 Move to the previous arc.
 
void reset_first () noexcept
 Put the iterator on the first arc.
 
void reset_last () noexcept
 Put the iterator on the last arc.
 
void end () noexcept
 Put the iterator past the last arc.
 
size_t size () const noexcept
 Return the number of arcs of the iterator.
 

Private Attributes

Arc *const * arcs = nullptr
 
long num = 0
 
long pos = 0
 

Detailed Description

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
class Aleph::In_Arcs_Index< GT, SA >::Iterator

Iterator on the arcs into a node, in the order of the arc iterator of the graph when the index was built.

It is valid while its index lives.

Definition at line 2278 of file tpl_graph.H.

Member Typedef Documentation

◆ Item_Type

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
using Aleph::In_Arcs_Index< GT, SA >::Iterator::Item_Type = Arc *

The type of the items: arcs.

Definition at line 2286 of file tpl_graph.H.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
Aleph::In_Arcs_Index< GT, SA >::Iterator::Iterator ( )
defaultnoexcept

An iterator without arcs.

◆ Iterator() [2/3]

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
Aleph::In_Arcs_Index< GT, SA >::Iterator::Iterator ( Arc *const *  a,
const long  n 
)
inlinenoexcept

An iterator on the n arcs from a.

Definition at line 2292 of file tpl_graph.H.

◆ Iterator() [3/3]

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
Aleph::In_Arcs_Index< GT, SA >::Iterator::Iterator ( const In_Arcs_Index &  index,
const Node *  p 
)
inline

An iterator on the arcs into p of index.

Parameters
[in]indexthe index.
[in]pa node of the graph of the index.
Exceptions
domain_errorif p was not a node of the graph.

Definition at line 2300 of file tpl_graph.H.

Member Function Documentation

◆ end()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
void Aleph::In_Arcs_Index< GT, SA >::Iterator::end ( )
inlinenoexcept

Put the iterator past the last arc.

Definition at line 2371 of file tpl_graph.H.

References Aleph::In_Arcs_Index< GT, SA >::Iterator::num, and Aleph::In_Arcs_Index< GT, SA >::Iterator::pos.

◆ get_curr()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
Arc * Aleph::In_Arcs_Index< GT, SA >::Iterator::get_curr ( ) const
inline

Return the current arc.

Exceptions
underflow_errorif the iterator is before the first arc.
overflow_errorif the iterator is past the last arc.

Definition at line 2313 of file tpl_graph.H.

References ah_overflow_error_if, ah_underflow_error_if, Aleph::In_Arcs_Index< GT, SA >::Iterator::get_curr_ne(), Aleph::In_Arcs_Index< GT, SA >::Iterator::num, and Aleph::In_Arcs_Index< GT, SA >::Iterator::pos.

Referenced by Aleph::In_Arcs_Index< GT, SA >::Iterator::get_current_arc(), and Aleph::In_Arcs_Index< GT, SA >::Iterator::get_node().

◆ get_curr_ne()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
Arc * Aleph::In_Arcs_Index< GT, SA >::Iterator::get_curr_ne ( ) const
inlinenoexcept

◆ get_current_arc()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
Arc * Aleph::In_Arcs_Index< GT, SA >::Iterator::get_current_arc ( ) const
inline

◆ get_current_arc_ne()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
Arc * Aleph::In_Arcs_Index< GT, SA >::Iterator::get_current_arc_ne ( ) const
inlinenoexcept

◆ get_node()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
Node * Aleph::In_Arcs_Index< GT, SA >::Iterator::get_node ( ) const
inline

Return the source of the current arc. Throws as get_curr().

Definition at line 2333 of file tpl_graph.H.

References Aleph::In_Arcs_Index< GT, SA >::Iterator::get_curr().

◆ get_node_ne()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
Node * Aleph::In_Arcs_Index< GT, SA >::Iterator::get_node_ne ( ) const
inlinenoexcept

Return the source of the current arc, which must exist.

Definition at line 2327 of file tpl_graph.H.

References Aleph::In_Arcs_Index< GT, SA >::Iterator::get_curr_ne().

◆ has_curr()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
bool Aleph::In_Arcs_Index< GT, SA >::Iterator::has_curr ( ) const
inlinenoexcept

◆ next()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
void Aleph::In_Arcs_Index< GT, SA >::Iterator::next ( )
inline

Move to the next arc.

Exceptions
overflow_errorif the iterator is not on an arc.

Definition at line 2345 of file tpl_graph.H.

References ah_overflow_error_if, Aleph::In_Arcs_Index< GT, SA >::Iterator::has_curr(), and Aleph::In_Arcs_Index< GT, SA >::Iterator::next_ne().

◆ next_ne()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
void Aleph::In_Arcs_Index< GT, SA >::Iterator::next_ne ( )
inlinenoexcept

Move to the next arc; the iterator must be on an arc.

Definition at line 2339 of file tpl_graph.H.

References Aleph::In_Arcs_Index< GT, SA >::Iterator::pos.

Referenced by Aleph::In_Arcs_Index< GT, SA >::Iterator::next().

◆ prev()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
void Aleph::In_Arcs_Index< GT, SA >::Iterator::prev ( )
inline

Move to the previous arc.

Exceptions
underflow_errorif the iterator is not on an arc.

Definition at line 2358 of file tpl_graph.H.

References ah_underflow_error_if, Aleph::In_Arcs_Index< GT, SA >::Iterator::has_curr(), and Aleph::In_Arcs_Index< GT, SA >::Iterator::prev_ne().

◆ prev_ne()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
void Aleph::In_Arcs_Index< GT, SA >::Iterator::prev_ne ( )
inlinenoexcept

Move to the previous arc; the iterator must be on an arc.

Definition at line 2352 of file tpl_graph.H.

References Aleph::In_Arcs_Index< GT, SA >::Iterator::pos.

Referenced by Aleph::In_Arcs_Index< GT, SA >::Iterator::prev().

◆ reset_first()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
void Aleph::In_Arcs_Index< GT, SA >::Iterator::reset_first ( )
inlinenoexcept

Put the iterator on the first arc.

Definition at line 2365 of file tpl_graph.H.

References Aleph::In_Arcs_Index< GT, SA >::Iterator::pos.

◆ reset_last()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
void Aleph::In_Arcs_Index< GT, SA >::Iterator::reset_last ( )
inlinenoexcept

Put the iterator on the last arc.

Definition at line 2368 of file tpl_graph.H.

References Aleph::In_Arcs_Index< GT, SA >::Iterator::num, and Aleph::In_Arcs_Index< GT, SA >::Iterator::pos.

◆ size()

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
size_t Aleph::In_Arcs_Index< GT, SA >::Iterator::size ( ) const
inlinenoexcept

Return the number of arcs of the iterator.

Definition at line 2374 of file tpl_graph.H.

References Aleph::In_Arcs_Index< GT, SA >::Iterator::num.

Member Data Documentation

◆ arcs

template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>>
Arc* const* Aleph::In_Arcs_Index< GT, SA >::Iterator::arcs = nullptr
private

Definition at line 2280 of file tpl_graph.H.

Referenced by Aleph::In_Arcs_Index< GT, SA >::Iterator::get_curr_ne().

◆ num

◆ pos


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