Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator Class Reference

Iterator on the arcs of a graph. More...

#include <tpl_graph.H>

Inheritance diagram for Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator:
[legend]
Collaboration diagram for Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator:
[legend]

Public Types

using Item_Type = Arc *
 
using Set_Type = Node *
 The type of data of set.
 

Public Member Functions

 Node_Arc_Iterator ()=default
 The container type (a node)
 
 Node_Arc_Iterator (Node *src) noexcept
 Constructs an iterator on the node src.
 
Arc_Node * get_current_arc_node () const
 
Arc_Node * get_current_arc_node_ne () const noexcept
 
Arc * get_curr () const
 
Arc * get_curr_ne () const noexcept
 
Arc * get_current_arc () const
 Return the current arc.
 
Arc * get_current_arc_ne () const noexcept
 
Node * get_tgt_node () const
 Return the connected node to source node (src passed in construction time) through the current arc.
 
Node * get_tgt_node_ne () const noexcept
 
Node * get_node () const
 
Node * get_node_ne () const noexcept
 

Private Attributes

Node * src_node
 

Detailed Description

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
class Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator

Iterator on the arcs of a graph.

This iterator scans all the arcs related to a node.

If the graph is not directed. then all the related nodes will be seen, independently of specified order when the arc was inserted. Use get_connected_node() for obtaining the target node given a source node and arc.

If you are using List_Graph as a directed graph, then this iterator has not much sense. Use Out_Iterator or In_Iterator in order to iterate on the outcoming or incoming arcs of a node.

If the graph is directed, then only the arcs specified as target (second parameter in the insert_arc() method) will be seen.

See also
In_Iterator Out_Iterator

Definition at line 830 of file tpl_graph.H.

Member Typedef Documentation

◆ Item_Type

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
using Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::Item_Type = Arc *

Definition at line 835 of file tpl_graph.H.

◆ Set_Type

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
using Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::Set_Type = Node *

The type of data of set.

Definition at line 837 of file tpl_graph.H.

Constructor & Destructor Documentation

◆ Node_Arc_Iterator() [1/2]

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::Node_Arc_Iterator ( )
default

The container type (a node)

◆ Node_Arc_Iterator() [2/2]

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::Node_Arc_Iterator ( Node *  src)
inlinenoexcept

Constructs an iterator on the node src.

Parameters
[in]srcthe node over whom you wish to iterate.

Definition at line 845 of file tpl_graph.H.

Member Function Documentation

◆ get_curr()

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
Arc * Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_curr ( ) const
inline

◆ get_curr_ne()

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
Arc * Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_curr_ne ( ) const
inlinenoexcept

◆ get_current_arc()

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_current_arc ( ) const
inline

Return the current arc.

Throw overflow_error is there is no current arc

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 875 of file tpl_graph.H.

References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_curr().

Referenced by Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_tgt_node().

◆ get_current_arc_ne()

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
Arc * Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_current_arc_ne ( ) const
inlinenoexcept

◆ get_current_arc_node()

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
Arc_Node * Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_current_arc_node ( ) const
inline

◆ get_current_arc_node_ne()

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
Arc_Node * Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_current_arc_node_ne ( ) const
inlinenoexcept

◆ get_node()

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
Node * Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_node ( ) const
inline

◆ get_node_ne()

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
Node * Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_node_ne ( ) const
inlinenoexcept

◆ get_tgt_node()

template<typename _Graph_Node = Graph_Node<unsigned long>, typename _Graph_Arc = Graph_Arc<unsigned long>>
Node * Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_tgt_node ( ) const
inline

Return the connected node to source node (src passed in construction time) through the current arc.

Throw overflow_error is there is no current

Definition at line 888 of file tpl_graph.H.

References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_current_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::src_node.

Referenced by Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_node().

◆ get_tgt_node_ne()

Member Data Documentation

◆ src_node


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