Aleph-w  1.9
General library for algorithms and data structures
Aleph::List_Graph< __Graph_Node, __Graph_Arc >::Arc_Iterator Struct Reference

#include <tpl_graph.H>

+ Inheritance diagram for Aleph::List_Graph< __Graph_Node, __Graph_Arc >::Arc_Iterator:
+ Collaboration diagram for Aleph::List_Graph< __Graph_Node, __Graph_Arc >::Arc_Iterator:

Public Types

using Item_Type = Arc *
 
using Set_Type = List_Graph
 The type of element over whom iterate.
 

Public Member Functions

 Arc_Iterator () noexcept
 The type of set.
 
 Arc_Iterator (const List_Graph &g) noexcept
 Initialize an iterator for all the arc of g
 
Arcget_current_arc_ne () const noexcept
 Return the current arc. Throw overflow_error if there is no one.
 
Arcget_current_arc () const
 
Arcget_curr () const
 
Arcget_curr_ne () const noexcept
 
Nodeget_src_node () const
 
Nodeget_src_node_ne () const
 
Nodeget_tgt_node () const
 
Nodeget_tgt_node_ne () const
 
void set (Dlink *new_curr) noexcept
 
void reset_first () noexcept
 Reset the iterator to the first item of list.
 
void reset_last () noexcept
 Reset the iterator to the last item of list.
 
void end () noexcept
 Put the iterator out of range.
 
bool has_curr () const noexcept
 Return true if the iterator has current item.
 
bool is_last () const noexcept
 
bool is_in_first () const noexcept
 Return true if the iterator is positiones on the first item.
 
bool is_in_last () const noexcept
 Return true if the iterator is positiones on the last item.
 
void prev_ne () noexcept
 
void prev ()
 
void next_ne () noexcept
 
void next ()
 
bool operator== (const Iterator &it) const noexcept
 Return true if this and it are positioned on the same item.
 
bool operator!= (const Iterator &it) const noexcept
 Return true if this and it hace different states.
 
Dlinkdel ()
 
Dlinkdel_ne () noexcept
 
bool verify (Dlink *l) const
 Return true if the iterator is on the list pointed by l
 
bool verify (const Iterator &it) const
 Return true if this and it are on the same list.
 

Detailed Description

template<typename __Graph_Node = Graph_Node<unsigned long>, typename __Graph_Arc = Graph_Arc<unsigned long>>
struct Aleph::List_Graph< __Graph_Node, __Graph_Arc >::Arc_Iterator

Iterator on all arcs of a graph.

This iterator scans all the arcs of the graph. The apparition order is random, but this can be modified through of sort_arcs() method.

See also
sort_arcs()

Member Function Documentation

◆ del()

Dlink* Aleph::Dlink::Iterator::del ( )
inlineinherited

Remove from the list the current node and move the iterator one position forward.

Returns
a pointer to removed item
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_src_node()

template<typename __Graph_Node = Graph_Node<unsigned long>, typename __Graph_Arc = Graph_Arc<unsigned long>>
Node* Aleph::List_Graph< __Graph_Node, __Graph_Arc >::Arc_Iterator::get_src_node ( ) const
inline

Return the source node of current arc. Throw overflow_error if there is no one. Of course, only has sense if one iterates on a directed graph

◆ 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 >::Arc_Iterator::get_tgt_node ( ) const
inline

Return the target node of current arc. Throw overflow_error if there is no one. Of course, only has sense if one iterates on a directed graph

◆ next()

void Aleph::Dlink::Iterator::next ( )
inlineinherited

Move the iterator one position forward

Exceptions
overflow_errorif there is no current item
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ next_ne()

void Aleph::Dlink::Iterator::next_ne ( )
inlinenoexceptinherited

Move the iterator one position backward guaranteeing no exception. Be careful.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prev()

void Aleph::Dlink::Iterator::prev ( )
inlineinherited

Move the iterator one position backward

Exceptions
underflow_errorif there is no current item
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prev_ne()

void Aleph::Dlink::Iterator::prev_ne ( )
inlinenoexceptinherited

Move the iterator one position backward guaranteeing no exception. Be careful.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set()

void Aleph::Dlink::Iterator::set ( Dlink new_curr)
inlinenoexceptinherited

Set the current node .

This method set the current node to new_curr, which of course must be a valid pointer to a item in the list.

Parameters
[in]new_currpointer to the new current item
+ Here is the caller graph for this function:

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

Leandro Rabindranath León