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

Read-only iterator on the arcs of a graph. More...

#include <tpl_const_graph_view.H>

Inheritance diagram for Aleph::Const_Arc_Iterator< GT >:
[legend]
Collaboration diagram for Aleph::Const_Arc_Iterator< GT >:
[legend]

Public Types

using Item_Type = const typename GT::Arc *
 The type of the items: a pointer to a constant arc.
 
using Set_Type = GT
 The type of the graph whose arcs are visited.
 
- Public Types inherited from Aleph::Const_Iterator< GT::Arc_Iterator >
using Itor = GT::Arc_Iterator
 The underlying iterator.
 
using aleph_random_access_iterator = std::conditional_t< AlephRandomAccessItor< GT::Arc_Iterator >, Const_Iterator, void >
 Random access when the underlying iterator opts in; see AlephRandomAccessItor.
 

Public Member Functions

 Const_Arc_Iterator ()=default
 An iterator with no current arc.
 
 Const_Arc_Iterator (const GT &g)
 Iterator positioned on the first arc of g.
 
 Const_Arc_Iterator (const Const_Graph_View< GT > &view)
 Iterator positioned on the first arc seen through view.
 
Item_Type get_current_arc () const
 The current arc.
 
Item_Type get_current_arc_ne () const noexcept
 get_current_arc() without checking that there is a current arc.
 
const GT::Node * get_src_node () const
 The source node of the current arc.
 
const GT::Node * get_src_node_ne () const noexcept
 get_src_node() without checking that there is a current arc.
 
const GT::Node * get_tgt_node () const
 The target node of the current arc.
 
const GT::Node * get_tgt_node_ne () const noexcept
 get_tgt_node() without checking that there is a current arc.
 
- Public Member Functions inherited from Aleph::Const_Iterator< GT::Arc_Iterator >
 Const_Iterator ()=default
 A view with no current item.
 
 Const_Iterator (const C &c)
 View positioned on the first item of the container c.
 
 Const_Iterator (GT::Arc_Iterator underlying) noexcept(std::is_nothrow_move_constructible_v< GT::Arc_Iterator >)
 Read-only view over an existing iterator.
 
auto has_curr () const noexcept(noexcept(std::declval< I & >().has_curr())) -> decltype(std::declval< I & >().has_curr())
 true if there is a current item.
 
auto get_curr () const noexcept(noexcept(std::declval< I & >().get_curr())) -> const_iterator_detail::const_item_t< decltype(std::declval< I & >().get_curr())>
 The current item, read-only.
 
auto get_curr_ne () const noexcept(noexcept(std::declval< I & >().get_curr_ne())) -> const_iterator_detail::const_item_t< decltype(std::declval< I & >().get_curr_ne())>
 get_curr() without the checks of the underlying iterator.
 
auto next () noexcept(noexcept(std::declval< I & >().next())) -> decltype(std::declval< I & >().next())
 Move to the next item; what the underlying iterator throws.
 
auto next_ne () noexcept(noexcept(std::declval< I & >().next_ne())) -> decltype(std::declval< I & >().next_ne())
 next() without checks.
 
auto prev () noexcept(noexcept(std::declval< I & >().prev())) -> decltype(std::declval< I & >().prev())
 Move to the previous item; what the underlying iterator throws.
 
auto prev_ne () noexcept(noexcept(std::declval< I & >().prev_ne())) -> decltype(std::declval< I & >().prev_ne())
 prev() without checks.
 
auto reset_first () noexcept(noexcept(std::declval< I & >().reset_first())) -> decltype(std::declval< I & >().reset_first())
 Position the view on the first item.
 
auto reset_last () noexcept(noexcept(std::declval< I & >().reset_last())) -> decltype(std::declval< I & >().reset_last())
 Position the view on the last item.
 
auto reset () noexcept(noexcept(std::declval< I & >().reset())) -> decltype(std::declval< I & >().reset())
 Position the view on the first item.
 
auto end () noexcept(noexcept(std::declval< I & >().end())) -> decltype(std::declval< I & >().end())
 Position the view past the last item.
 
auto get_pos () const noexcept(noexcept(std::declval< I & >().get_pos())) -> decltype(std::declval< I & >().get_pos())
 Ordinal position of the current item.
 
auto set_pos (const long pos) noexcept(noexcept(std::declval< I & >().set_pos(pos))) -> decltype(std::declval< I & >().set_pos(pos))
 Position the view on the item at ordinal position pos.
 
auto is_last () const noexcept(noexcept(std::declval< I & >().is_last())) -> decltype(std::declval< I & >().is_last())
 true if the current item is the last one.
 
auto is_in_first () const noexcept(noexcept(std::declval< I & >().is_in_first())) -> decltype(std::declval< I & >().is_in_first())
 true if the current item is the first one.
 
auto is_in_last () const noexcept(noexcept(std::declval< I & >().is_in_last())) -> decltype(std::declval< I & >().is_in_last())
 true if the current item is the last one.
 
void swap (Const_Iterator &other) noexcept(std::is_nothrow_swappable_v< GT::Arc_Iterator >)
 Exchange the views.
 
auto operator== (const Const_Iterator &other) const -> decltype(std::declval< I & >()==std::declval< I & >())
 Equality of the underlying iterators, when they have it.
 
auto operator!= (const Const_Iterator &other) const -> decltype(not(std::declval< I & >()==std::declval< I & >()))
 Negation of ==.
 

Private Types

using Base = Const_Iterator< typename GT::Arc_Iterator >
 

Additional Inherited Members

- Protected Member Functions inherited from Aleph::Const_Iterator< GT::Arc_Iterator >
GT::Arc_Iterator & underlying () const noexcept
 The underlying iterator, for the views that extend the reading protocol with members of their own (the read-only iterators of the graphs do it with get_src_node() and get_tgt_node()).
 

Detailed Description

template<class GT>
class Aleph::Const_Arc_Iterator< GT >

Read-only iterator on the arcs of a graph.

Wraps GT::Arc_Iterator and hands out const Arc * and, for the end points of the current arc, const Node *.

Template Parameters
GTthe graph type.
See also
Const_Graph_View Const_Node_Iterator Const_Node_Arc_Iterator

Definition at line 227 of file tpl_const_graph_view.H.

Member Typedef Documentation

◆ Base

template<class GT >
using Aleph::Const_Arc_Iterator< GT >::Base = Const_Iterator<typename GT::Arc_Iterator>
private

Definition at line 229 of file tpl_const_graph_view.H.

◆ Item_Type

template<class GT >
using Aleph::Const_Arc_Iterator< GT >::Item_Type = const typename GT::Arc *

The type of the items: a pointer to a constant arc.

Definition at line 237 of file tpl_const_graph_view.H.

◆ Set_Type

template<class GT >
using Aleph::Const_Arc_Iterator< GT >::Set_Type = GT

The type of the graph whose arcs are visited.

Definition at line 240 of file tpl_const_graph_view.H.

Constructor & Destructor Documentation

◆ Const_Arc_Iterator() [1/3]

template<class GT >
Aleph::Const_Arc_Iterator< GT >::Const_Arc_Iterator ( )
default

An iterator with no current arc.

◆ Const_Arc_Iterator() [2/3]

template<class GT >
Aleph::Const_Arc_Iterator< GT >::Const_Arc_Iterator ( const GT &  g)
inlineexplicit

Iterator positioned on the first arc of g.

Parameters
[in]gthe graph; it is not modified through the iterator.

Definition at line 248 of file tpl_const_graph_view.H.

◆ Const_Arc_Iterator() [3/3]

template<class GT >
Aleph::Const_Arc_Iterator< GT >::Const_Arc_Iterator ( const Const_Graph_View< GT > &  view)
inlineexplicit

Iterator positioned on the first arc seen through view.

Parameters
[in]viewa view of the graph.

Definition at line 253 of file tpl_const_graph_view.H.

Member Function Documentation

◆ get_current_arc()

template<class GT >
Item_Type Aleph::Const_Arc_Iterator< GT >::get_current_arc ( ) const
inline

The current arc.

Returns
a pointer to the current arc.
Exceptions
std::overflow_errorif there is no current arc.

Definition at line 260 of file tpl_const_graph_view.H.

References Aleph::Const_Iterator< GT::Arc_Iterator >::get_curr().

◆ get_current_arc_ne()

template<class GT >
Item_Type Aleph::Const_Arc_Iterator< GT >::get_current_arc_ne ( ) const
inlinenoexcept

get_current_arc() without checking that there is a current arc.

Definition at line 263 of file tpl_const_graph_view.H.

References Aleph::Const_Iterator< GT::Arc_Iterator >::get_curr_ne().

◆ get_src_node()

template<class GT >
const GT::Node * Aleph::Const_Arc_Iterator< GT >::get_src_node ( ) const
inline

The source node of the current arc.

Returns
a pointer to the node given first when the arc was inserted.
Exceptions
std::overflow_errorif there is no current arc.

Definition at line 272 of file tpl_const_graph_view.H.

References Aleph::Const_Iterator< GT::Arc_Iterator >::underlying().

◆ get_src_node_ne()

template<class GT >
const GT::Node * Aleph::Const_Arc_Iterator< GT >::get_src_node_ne ( ) const
inlinenoexcept

get_src_node() without checking that there is a current arc.

Definition at line 278 of file tpl_const_graph_view.H.

References Aleph::Const_Iterator< GT::Arc_Iterator >::underlying().

◆ get_tgt_node()

template<class GT >
const GT::Node * Aleph::Const_Arc_Iterator< GT >::get_tgt_node ( ) const
inline

The target node of the current arc.

Returns
a pointer to the node given second when the arc was inserted.
Exceptions
std::overflow_errorif there is no current arc.

Definition at line 287 of file tpl_const_graph_view.H.

References Aleph::Const_Iterator< GT::Arc_Iterator >::underlying().

◆ get_tgt_node_ne()

template<class GT >
const GT::Node * Aleph::Const_Arc_Iterator< GT >::get_tgt_node_ne ( ) const
inlinenoexcept

get_tgt_node() without checking that there is a current arc.

Definition at line 293 of file tpl_const_graph_view.H.

References Aleph::Const_Iterator< GT::Arc_Iterator >::underlying().


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