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

Filtered iterator for outcoming arcs of a node. More...

#include <tpl_graph.H>

Inheritance diagram for Aleph::Out_Iterator< GT, Show_Arc >:
[legend]
Collaboration diagram for Aleph::Out_Iterator< GT, Show_Arc >:
[legend]

Public Types

using Item_Type = typename GT::Arc *
 
- Public Types inherited from Aleph::Digraph_Iterator< GT, __Out_Filt< GT > >
using Item_Type = typename Itor::Item_Type
 
using Iterator_Type = Itor
 The type of element.
 

Public Member Functions

 Out_Iterator ()=default
 
 Out_Iterator (typename GT::Node *p, Show_Arc sa=Show_Arc())
 
void next ()
 
void next_ne () noexcept(NothrowPredicateWith< Show_Arc &, typename GT::Arc * >)
 next() without the check of the current arc; noexcept when the filter is, else what the filter throws goes out
 
void prev ()
 Move to the previous arc that the filter shows.
 
- Public Member Functions inherited from Aleph::Digraph_Iterator< GT, __Out_Filt< GT > >
 Digraph_Iterator (typename GT::Node *p)
 Initialize an iterator on adjacent arcs (incoming or outcoming) of p
 
void next ()
 Move the iterator one position forward.
 
void next_ne () noexcept(shows_ne)
 next() without its check: the current arc must exist.
 
void prev ()
 Move the iterator one position backward.
 
bool has_curr () const noexcept
 Return true the iterator has an current arc.
 
GT::Arc * get_curr () const
 Return the current arc.
 
GT::Arc * get_curr_ne () const noexcept
 Return the current arc.
 
auto get_current_arc () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Alias for get_curr().
 
GT::Node * get_node (typename GT::Arc *a) const noexcept
 Return the connected node to arc.
 
GT::Node * get_node () const
 Return the connected node to current arc.
 
auto get_tgt_node () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Alias for get_node().
 
GT::Node * get_node_ne () const noexcept
 Return the connected node to current arc.
 
auto get_tgt_node_ne () const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Alias for get_node_ne().
 
void reset_first () noexcept(shows_ne)
 Reset the iterator to the first arc.
 
void reset_last () noexcept(shows_ne)
 Reset the iterator to the last arc.
 
void end () noexcept(shows_ne)
 Put the iterator in end state.
 

Private Types

using Base = Digraph_Iterator< GT, __Out_Filt< GT > >
 

Private Member Functions

void goto_first_valid ()
 
void goto_last_valid ()
 

Private Attributes

Show_Arc show_arc
 

Additional Inherited Members

- Static Public Attributes inherited from Aleph::Digraph_Iterator< GT, __Out_Filt< GT > >
static constexpr bool goes_back
 Iterator type.
 
static constexpr bool goes_to_last
 Whether the iterator goes to its last arc, which reset_last() and end() need.
 
static constexpr bool shows_ne
 Whether what the filter says of an arc cannot throw, nor its conversion to bool: the moves without checks and the resets are noexcept then.
 

Detailed Description

template<class GT, class Show_Arc = Dft_Show_Arc<GT>>
class Aleph::Out_Iterator< GT, Show_Arc >

Filtered iterator for outcoming arcs of a node.

This iterator traverses the outgoing arcs of a node, optionally filtered by the Show_Arc predicate.

Template Parameters
GTThe graph type
Show_ArcArc filter predicate (default shows all arcs)

Definition at line 1941 of file tpl_graph.H.

Member Typedef Documentation

◆ Base

template<class GT , class Show_Arc = Dft_Show_Arc<GT>>
using Aleph::Out_Iterator< GT, Show_Arc >::Base = Digraph_Iterator<GT, __Out_Filt<GT> >
private

Definition at line 1943 of file tpl_graph.H.

◆ Item_Type

template<class GT , class Show_Arc = Dft_Show_Arc<GT>>
using Aleph::Out_Iterator< GT, Show_Arc >::Item_Type = typename GT::Arc *

Definition at line 1959 of file tpl_graph.H.

Constructor & Destructor Documentation

◆ Out_Iterator() [1/2]

template<class GT , class Show_Arc = Dft_Show_Arc<GT>>
Aleph::Out_Iterator< GT, Show_Arc >::Out_Iterator ( )
default

◆ Out_Iterator() [2/2]

template<class GT , class Show_Arc = Dft_Show_Arc<GT>>
Aleph::Out_Iterator< GT, Show_Arc >::Out_Iterator ( typename GT::Node *  p,
Show_Arc  sa = Show_Arc() 
)
inline

Member Function Documentation

◆ goto_first_valid()

◆ goto_last_valid()

◆ next()

template<class GT , class Show_Arc = Dft_Show_Arc<GT>>
void Aleph::Out_Iterator< GT, Show_Arc >::next ( )
inline

◆ next_ne()

template<class GT , class Show_Arc = Dft_Show_Arc<GT>>
void Aleph::Out_Iterator< GT, Show_Arc >::next_ne ( )
inlinenoexcept

next() without the check of the current arc; noexcept when the filter is, else what the filter throws goes out

Definition at line 1977 of file tpl_graph.H.

References Aleph::Out_Iterator< GT, Show_Arc >::goto_first_valid(), and Aleph::Digraph_Iterator< GT, __Out_Filt< GT > >::next_ne().

◆ prev()

template<class GT , class Show_Arc = Dft_Show_Arc<GT>>
void Aleph::Out_Iterator< GT, Show_Arc >::prev ( )
inline

Move to the previous arc that the filter shows.

Only where the iterator moves back: not on List_SGraph and List_SDigraph

Definition at line 1985 of file tpl_graph.H.

References Aleph::Out_Iterator< GT, Show_Arc >::goto_last_valid(), and Aleph::Digraph_Iterator< GT, __Out_Filt< GT > >::prev().

Member Data Documentation

◆ show_arc

template<class GT , class Show_Arc = Dft_Show_Arc<GT>>
Show_Arc Aleph::Out_Iterator< GT, Show_Arc >::show_arc
private

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