Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator Class Reference

Iterator over the arcs of a node. More...

#include <tpl_agraph.H>

Public Types

using Item_Type = Arc *
 The data type returned by get_curr().
 
using Set_Type = Node *
 The set type over which iteration is performed.
 

Public Member Functions

 Node_Arc_Iterator () noexcept
 Instantiate an empty (invalid) iterator.
 
 Node_Arc_Iterator (Node *src) noexcept
 Instantiate an iterator over node src.
 
void ** get_base () noexcept
 Return the array of the arcs of the node.
 
void *const * get_base () const noexcept
 Return the array of the arcs of the node.
 
bool has_curr () const noexcept
 Return true if the iterator is on an arc.
 
bool is_last () const noexcept
 Return true if the iterator is on the last arc.
 
long get_pos () const noexcept
 Return the position of the current arc, counted from 0.
 
Arc * get_curr () const
 Return the current arc.
 
Arc * get_curr_ne () const noexcept
 Return the current arc, which must exist.
 
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 () noexcept
 Put the iterator on the first arc.
 
void reset_first () noexcept
 Put the iterator on the first arc.
 
void reset_last () noexcept
 Put the iterator on the last arc.
 
void set_pos (const long new_pos) noexcept
 Put the iterator on position new_pos; the number of arcs is the position past the last one.
 
void end () noexcept
 Put the iterator past the last arc.
 
Arc * get_current_arc_ne () const noexcept
 Return the current arc.
 
Arc * get_current_arc () const
 Return the current arc.
 
Node * get_tgt_node_ne () const
 Return the target node of the current arc.
 
Node * get_tgt_node () const
 Return the target node of the current arc; it throws as get_curr().
 

Private Attributes

void ** arcs = nullptr
 
long num_arcs = 0
 
long pos = 0
 
Node * src_node = nullptr
 

Detailed Description

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
class Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator

Iterator over the arcs of a node.

It goes through the arcs that the node has when the iterator is built, in the order of its array of arcs, with the operations of an Array_Iterator. It keeps only the array, the number of arcs, the position and the node, so that a search that keeps an iterator for each node of a path, as the depth-first ones do, copies little.

Definition at line 353 of file tpl_agraph.H.

Member Typedef Documentation

◆ Item_Type

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
using Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::Item_Type = Arc *

The data type returned by get_curr().

Definition at line 362 of file tpl_agraph.H.

◆ Set_Type

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
using Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::Set_Type = Node *

The set type over which iteration is performed.

Definition at line 365 of file tpl_agraph.H.

Constructor & Destructor Documentation

◆ Node_Arc_Iterator() [1/2]

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::Node_Arc_Iterator ( )
inlinenoexcept

Instantiate an empty (invalid) iterator.

Definition at line 368 of file tpl_agraph.H.

◆ Node_Arc_Iterator() [2/2]

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::Node_Arc_Iterator ( Node *  src)
inlinenoexcept

Instantiate an iterator over node src.

Definition at line 373 of file tpl_agraph.H.

Member Function Documentation

◆ end()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
void Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::end ( )
inlinenoexcept

◆ get_base() [1/2]

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
void *const * Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_base ( ) const
inlinenoexcept

Return the array of the arcs of the node.

Definition at line 384 of file tpl_agraph.H.

References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::arcs.

◆ get_base() [2/2]

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
void ** Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_base ( )
inlinenoexcept

Return the array of the arcs of the node.

Definition at line 381 of file tpl_agraph.H.

References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::arcs.

◆ get_curr()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
Arc * Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr ( ) const
inline

◆ get_curr_ne()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
Arc * Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr_ne ( ) const
inlinenoexcept

◆ get_current_arc()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
Arc * Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_current_arc ( ) const
inline

Return the current arc.

Definition at line 468 of file tpl_agraph.H.

References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr().

◆ get_current_arc_ne()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
Arc * Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_current_arc_ne ( ) const
inlinenoexcept

Return the current arc.

Definition at line 465 of file tpl_agraph.H.

References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr_ne().

◆ get_pos()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
long Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_pos ( ) const
inlinenoexcept

Return the position of the current arc, counted from 0.

Definition at line 396 of file tpl_agraph.H.

References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.

◆ get_tgt_node()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
Node * Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_tgt_node ( ) const
inline

◆ get_tgt_node_ne()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
Node * Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_tgt_node_ne ( ) const
inline

◆ has_curr()

◆ is_last()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
bool Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::is_last ( ) const
inlinenoexcept

◆ next()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
void Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::next ( )
inline

◆ next_ne()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
void Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::next_ne ( )
inlinenoexcept

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

Definition at line 419 of file tpl_agraph.H.

References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.

Referenced by Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::next().

◆ prev()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
void Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::prev ( )
inline

◆ prev_ne()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
void Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::prev_ne ( )
inlinenoexcept

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

Definition at line 434 of file tpl_agraph.H.

References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.

Referenced by Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::prev().

◆ reset()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
void Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::reset ( )
inlinenoexcept

◆ reset_first()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
void Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::reset_first ( )
inlinenoexcept

Put the iterator on the first arc.

Definition at line 452 of file tpl_agraph.H.

References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::reset().

◆ reset_last()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
void Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::reset_last ( )
inlinenoexcept

◆ set_pos()

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
void Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::set_pos ( const long  new_pos)
inlinenoexcept

Put the iterator on position new_pos; the number of arcs is the position past the last one.

Definition at line 459 of file tpl_agraph.H.

References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.

Member Data Documentation

◆ arcs

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
void** Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::arcs = nullptr
private

◆ num_arcs

◆ pos

◆ src_node

template<class __Graph_Node = Graph_Anode<unsigned long>, class __Graph_Arc = Graph_Aarc<unsigned long>>
Node* Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::src_node = nullptr
private

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