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

The iterator on the arcs into a node of a digraph type, which In_Iterator is on a type built with the Digraph template. More...

#include <graph-dry.H>

Inheritance diagram for Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >:
[legend]
Collaboration diagram for Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >:
[legend]

Public Types

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

Public Member Functions

 In_Arcs_Walk (const GT &g, Node *p, SA sa=SA())
 The arcs of g into p that sa shows, from the first one.
 
 In_Arcs_Walk (Node *, SA sa=SA())
 The form that takes only the node, which does not compile: the list of a node of a digraph holds only the arcs that leave it.
 
bool has_curr () const noexcept
 Return true if there is a current arc.
 
Arc * get_curr () const
 Return the current arc. Throws overflow_error if there is none.
 
Arc * get_curr_ne () const noexcept
 Return the current arc, which must exist.
 
Arc * get_current_arc () const
 See get_curr().
 
Arc * get_current_arc_ne () const noexcept
 See get_curr_ne().
 
Node * get_node (Arc *a) const noexcept
 Return the source of a.
 
Node * get_node () const
 Return the source of the current arc.
 
Node * get_node_ne () const noexcept
 Return the source of the current arc, which must exist.
 
Node * get_tgt_node () const
 Alias of get_node().
 
Node * get_tgt_node_ne () const noexcept
 Alias of get_node_ne().
 
void next ()
 Move to the next arc.
 
void next_ne () noexcept(shows_ne)
 Move to the next arc, which must exist; noexcept when the filter is, else what the filter throws goes out.
 
void prev ()
 Move to the previous arc.
 
void prev_ne () noexcept(shows_ne)
 prev() without its exception: nothing if there is no current arc; noexcept when the filter is, else what the filter throws goes out.
 
void reset_first ()
 Put the walk on the first arc.
 
void reset_last ()
 Put the walk on the last arc.
 
void end () noexcept
 Put the walk past the last arc.
 

Static Public Attributes

static constexpr bool goes_back = requires (Arc_Itor & a) { a.prev(); }
 Whether the walk moves back: the arc iterators of List_SGraph and List_SDigraph go only forward.
 
static constexpr bool goes_to_last = requires (Arc_Itor & a) { a.reset_last(); a.prev(); }
 Whether the walk goes to its last arc, which reset_last() needs.
 

Private Types

using Node = typename GT::Node
 
using Arc = typename GT::Arc
 
using Arc_Itor = typename GT::Arc_Iterator
 

Private Member Functions

void forward ()
 
void backward ()
 

Private Attributes

std::optional< Arc_Itor > arcs
 
Node * tgt = nullptr
 
SA show_arc
 

Static Private Attributes

static constexpr bool shows_ne = NothrowPredicateWith<SA &, Arc *&>
 

Detailed Description

template<class GT, class SA>
class Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >

The iterator on the arcs into a node of a digraph type, which In_Iterator is on a type built with the Digraph template.

A digraph keeps each arc only in the list of its source, so that the arcs into a node are found among the arcs of the graph: the walk goes through them, in the order of the arc iterator of the graph, and keeps those whose target is the node and that the filter shows. To build it and go through all of them takes \(O(E)\).

Its interface is that of the iterators on the arcs of a node: the node of an arc is its source. prev(), prev_ne() and reset_last() exist only where the arc iterator of the graph moves back.

Template Parameters
GTthe graph type, complete where the walk is used.
SAthe arc filter.

Definition at line 132 of file graph-dry.H.

Member Typedef Documentation

◆ Arc

template<class GT , class SA >
using Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::Arc = typename GT::Arc
private

Definition at line 135 of file graph-dry.H.

◆ Arc_Itor

template<class GT , class SA >
using Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::Arc_Itor = typename GT::Arc_Iterator
private

Definition at line 136 of file graph-dry.H.

◆ Item_Type

template<class GT , class SA >
using Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::Item_Type = Arc *

The type of the items: arcs.

Definition at line 167 of file graph-dry.H.

◆ Node

template<class GT , class SA >
using Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::Node = typename GT::Node
private

Definition at line 134 of file graph-dry.H.

Constructor & Destructor Documentation

◆ In_Arcs_Walk() [1/2]

template<class GT , class SA >
Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::In_Arcs_Walk ( const GT &  g,
Node *  p,
SA  sa = SA() 
)
inline

The arcs of g into p that sa shows, from the first one.

Exceptions
anythingthat sa throws.

Definition at line 179 of file graph-dry.H.

References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::forward().

◆ In_Arcs_Walk() [2/2]

template<class GT , class SA >
Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::In_Arcs_Walk ( Node *  ,
SA  sa = SA() 
)
inline

The form that takes only the node, which does not compile: the list of a node of a digraph holds only the arcs that leave it.

Definition at line 188 of file graph-dry.H.

Member Function Documentation

◆ backward()

◆ end()

template<class GT , class SA >
void Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::end ( )
inlinenoexcept

Put the walk past the last arc.

Definition at line 277 of file graph-dry.H.

References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs.

◆ forward()

◆ get_curr()

template<class GT , class SA >
Arc * Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_curr ( ) const
inline

Return the current arc. Throws overflow_error if there is none.

Definition at line 200 of file graph-dry.H.

References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs.

Referenced by Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_current_arc(), and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node().

◆ get_curr_ne()

template<class GT , class SA >
Arc * Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_curr_ne ( ) const
inlinenoexcept

◆ get_current_arc()

template<class GT , class SA >
Arc * Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_current_arc ( ) const
inline

◆ get_current_arc_ne()

template<class GT , class SA >
Arc * Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_current_arc_ne ( ) const
inlinenoexcept

◆ get_node() [1/2]

template<class GT , class SA >
Node * Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node ( ) const
inline

Return the source of the current arc.

Throws overflow_error if there is no current arc.

Definition at line 216 of file graph-dry.H.

References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_curr(), and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node().

Referenced by Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node().

◆ get_node() [2/2]

template<class GT , class SA >
Node * Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node ( Arc *  a) const
inlinenoexcept

◆ get_node_ne()

template<class GT , class SA >
Node * Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node_ne ( ) const
inlinenoexcept

◆ get_tgt_node()

template<class GT , class SA >
Node * Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_tgt_node ( ) const
inline

◆ get_tgt_node_ne()

template<class GT , class SA >
Node * Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_tgt_node_ne ( ) const
inlinenoexcept

◆ has_curr()

template<class GT , class SA >
bool Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::has_curr ( ) const
inlinenoexcept

Return true if there is a current arc.

Definition at line 197 of file graph-dry.H.

References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs.

◆ next()

template<class GT , class SA >
void Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::next ( )
inline

Move to the next arc.

Throws overflow_error if there is no current arc.

Definition at line 229 of file graph-dry.H.

References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs, and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::forward().

◆ next_ne()

template<class GT , class SA >
void Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::next_ne ( )
inlinenoexcept

Move to the next arc, which must exist; noexcept when the filter is, else what the filter throws goes out.

Definition at line 237 of file graph-dry.H.

References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs, and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::forward().

◆ prev()

template<class GT , class SA >
void Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::prev ( )
inline

Move to the previous arc.

Throws underflow_error if there is no current arc. Only where the walk moves back.

Definition at line 245 of file graph-dry.H.

References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs, and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::backward().

◆ prev_ne()

template<class GT , class SA >
void Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::prev_ne ( )
inlinenoexcept

prev() without its exception: nothing if there is no current arc; noexcept when the filter is, else what the filter throws goes out.

Definition at line 253 of file graph-dry.H.

References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs, and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::backward().

◆ reset_first()

template<class GT , class SA >
void Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::reset_first ( )
inline

◆ reset_last()

template<class GT , class SA >
void Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::reset_last ( )
inline

Put the walk on the last arc.

Only where the walk goes to its last arc.

Definition at line 270 of file graph-dry.H.

References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs, and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::backward().

Member Data Documentation

◆ arcs

◆ goes_back

template<class GT , class SA >
constexpr bool Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::goes_back = requires (Arc_Itor & a) { a.prev(); }
staticconstexpr

Whether the walk moves back: the arc iterators of List_SGraph and List_SDigraph go only forward.

Definition at line 171 of file graph-dry.H.

◆ goes_to_last

template<class GT , class SA >
constexpr bool Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::goes_to_last = requires (Arc_Itor & a) { a.reset_last(); a.prev(); }
staticconstexpr

Whether the walk goes to its last arc, which reset_last() needs.

Definition at line 174 of file graph-dry.H.

◆ show_arc

◆ shows_ne

template<class GT , class SA >
constexpr bool Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::shows_ne = NothrowPredicateWith<SA &, Arc *&>
staticconstexprprivate

Definition at line 145 of file graph-dry.H.

◆ tgt


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