|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Filtered iterator of adjacent arcs of a node. More...
#include <tpl_graph.H>
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 Container & | get_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_Item & | get_filter () noexcept |
| Returns a reference to the filter functor. | |
| const Show_Item & | get_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. | |
| void * | get_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. | |
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.
| 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.
Definition at line 1128 of file tpl_graph.H.
| 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.
| 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.
|
default |
Type of set: p's arcs.
|
inline |
Construct and filtered iterator according to condition sa.
| [in] | p | node over whom you wish to iterate |
| [in] | sa | the filter |
Definition at line 1138 of file tpl_graph.H.