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

Filtered iterator on the nodes of a graph. More...

#include <tpl_graph.H>

Inheritance diagram for Aleph::Node_Iterator< GT, Show_Node >:
[legend]
Collaboration diagram for Aleph::Node_Iterator< GT, Show_Node >:
[legend]

Public Types

using Itor = Filter_Iterator< GT, typename GT::Node_Iterator, Show_Node >
 
using Item_Type = typename Itor::Item_Type
 
using Set_Type = typename Itor::Set_Type
 The element type: Node*.
 
- 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_Iterator ()=default
 The set: the arcs of a graph.
 
 Node_Iterator (const GT &g, Show_Node sn=Show_Node())
 Construct a iterator with filter sn
 
- 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_Node = Dft_Show_Node<GT>>
class Aleph::Node_Iterator< GT, Show_Node >

Filtered iterator on the nodes of a graph.

Definition at line 1204 of file tpl_graph.H.

Member Typedef Documentation

◆ Item_Type

Definition at line 1210 of file tpl_graph.H.

◆ Itor

template<class GT , class Show_Node = Dft_Show_Node<GT>>
using Aleph::Node_Iterator< GT, Show_Node >::Itor = Filter_Iterator<GT, typename GT::Node_Iterator, Show_Node>

Definition at line 1208 of file tpl_graph.H.

◆ Set_Type

template<class GT , class Show_Node = Dft_Show_Node<GT>>
using Aleph::Node_Iterator< GT, Show_Node >::Set_Type = typename Itor::Set_Type

The element type: Node*.

Definition at line 1212 of file tpl_graph.H.

Constructor & Destructor Documentation

◆ Node_Iterator() [1/2]

template<class GT , class Show_Node = Dft_Show_Node<GT>>
Aleph::Node_Iterator< GT, Show_Node >::Node_Iterator ( )
default

The set: the arcs of a graph.

◆ Node_Iterator() [2/2]

template<class GT , class Show_Node = Dft_Show_Node<GT>>
Aleph::Node_Iterator< GT, Show_Node >::Node_Iterator ( const GT g,
Show_Node  sn = Show_Node() 
)
inline

Construct a iterator with filter sn

Parameters
[in]gthe graph
[in]snthe node filter

Definition at line 1221 of file tpl_graph.H.


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