Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Node_Arc_Iterator< GT, Show_Arc > Struct Template Reference

Filtered iterator of adjacent arcs of a node. More...

#include <tpl_graph.H>

Inheritance diagram for Aleph::Node_Arc_Iterator< GT, Show_Arc >:
[legend]
Collaboration diagram for Aleph::Node_Arc_Iterator< GT, Show_Arc >:
[legend]

Public Types

using Filter_Itor = Filter_Iterator< typename GT::Node *, typename GT::Node_Arc_Iterator, Show_Arc >
 
using Itor = Filter_Iterator< typename GT::Node *, typename GT::Node_Arc_Iterator, Show_Arc >
 
using Item_Type = typename Itor::Item_Type
 
using Set_Type = typename Itor::Set_Type
 type of element: Arc*
 
- Public Types inherited from Aleph::Filter_Iterator< Container, It, Show_Item >
using Item_Type = typename It::Item_Type
 The type of element returned by get_curr()
 
using Iterator_Type = It
 The type of the base iterator.
 
using Container_Type = Container
 The type of container being iterated.
 
using Filter_Type = Show_Item
 The type of the filter functor.
 

Public Member Functions

 Node_Arc_Iterator ()=default
 Type of set: p's arcs.
 
 Node_Arc_Iterator (typename GT::Node *p, Show_Arc sa=Show_Arc())
 Construct and filtered iterator according to condition sa.
 
- Public Member Functions inherited from Aleph::Filter_Iterator< Container, It, Show_Item >
const Containerget_container () const
 Returns a const reference to the container being iterated over.
 
bool has_container () const noexcept
 Check if a container has been set.
 
It & get_iterator () noexcept
 Returns a reference to the underlying base iterator.
 
const It & get_iterator () const noexcept
 Returns a const reference to the underlying base iterator.
 
Show_Itemget_filter () noexcept
 Returns a reference to the filter functor.
 
const Show_Itemget_filter () const noexcept
 Returns a const reference to the filter functor.
 
void set_filter (Show_Item si)
 Sets a new filter functor.
 
void set_cookie (void *__cookie) noexcept
 Sets the cookie pointer.
 
voidget_cookie () const noexcept
 Gets the cookie pointer.
 
 Filter_Iterator (Show_Item si=Show_Item()) noexcept
 Default constructor.
 
 Filter_Iterator (const Container &c, Show_Item si=Show_Item())
 Constructs a filter iterator over a container.
 
 Filter_Iterator (const Container &c, void *__cookie, Show_Item si=Show_Item())
 Constructs a filter iterator with a cookie.
 
void next ()
 Advances the iterator to the next filtered element.
 
void next_ne () noexcept
 Advances the iterator to the next filtered element (noexcept version).
 
void prev ()
 Moves the iterator backward to the previous filtered element.
 
void prev_ne () noexcept
 Moves the iterator backward (noexcept version).
 
void reset_first ()
 Resets the iterator to the first filtered element.
 
void reset_last ()
 Resets the iterator to the last filtered element.
 
size_t count ()
 Count the number of elements that pass the filter.
 
bool empty ()
 Check if there are no elements that pass the filter.
 
template<typename Op >
void for_each (Op op)
 Apply a function to all filtered elements.
 
template<typename Pred >
bool find_if (Pred pred)
 Find the first element that satisfies an additional predicate.
 

Detailed Description

template<class GT, class Show_Arc = Dft_Show_Arc<GT>>
struct Aleph::Node_Arc_Iterator< GT, Show_Arc >

Filtered iterator of adjacent arcs of a node.

Node_Arc_Iterator is a reflex class of GT::Node_Arc_Iterator except that the arcs are filtered according to filter criteria Show_Arc.

Show_Arc must have the following signature:

struct Show_Arc { bool operator () (GT::Arc * arc) { /// the filter condition } };

So, this iterator will only show those arcs satisfying the filter.

Definition at line 1115 of file tpl_graph.H.

Member Typedef Documentation

◆ Filter_Itor

template<class GT , class Show_Arc = Dft_Show_Arc<GT>>
using Aleph::Node_Arc_Iterator< GT, Show_Arc >::Filter_Itor = Filter_Iterator<typename GT::Node *, typename GT::Node_Arc_Iterator, Show_Arc>

Definition at line 1120 of file tpl_graph.H.

◆ Item_Type

Definition at line 1128 of file tpl_graph.H.

◆ Itor

template<class GT , class Show_Arc = Dft_Show_Arc<GT>>
using Aleph::Node_Arc_Iterator< GT, Show_Arc >::Itor = Filter_Iterator<typename GT::Node *, typename GT::Node_Arc_Iterator, Show_Arc>

Definition at line 1124 of file tpl_graph.H.

◆ Set_Type

template<class GT , class Show_Arc = Dft_Show_Arc<GT>>
using Aleph::Node_Arc_Iterator< GT, Show_Arc >::Set_Type = typename Itor::Set_Type

type of element: Arc*

Definition at line 1129 of file tpl_graph.H.

Constructor & Destructor Documentation

◆ Node_Arc_Iterator() [1/2]

template<class GT , class Show_Arc = Dft_Show_Arc<GT>>
Aleph::Node_Arc_Iterator< GT, Show_Arc >::Node_Arc_Iterator ( )
default

Type of set: p's arcs.

◆ Node_Arc_Iterator() [2/2]

template<class GT , class Show_Arc = Dft_Show_Arc<GT>>
Aleph::Node_Arc_Iterator< GT, Show_Arc >::Node_Arc_Iterator ( typename GT::Node p,
Show_Arc  sa = Show_Arc() 
)
inline

Construct and filtered iterator according to condition sa.

Parameters
[in]pnode over whom you wish to iterate
[in]sathe filter

Definition at line 1138 of file tpl_graph.H.


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