|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Filtered iterator on all the arcs of a graph. More...
#include <tpl_graph.H>
Public Types | |
| using | Itor = Filter_Iterator< GT, typename GT::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 | |
| Arc_Iterator ()=default | |
| Type of set all the arcs. | |
| Arc_Iterator (const GT &g, Show_Arc sa=Show_Arc()) | |
| Constructor,. | |
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 on all the arcs of a graph.
Arc_Iterator is an iterator similar to GT::Arc_Iterator, except that only are shown the arcs satisfying a filter condition.
The condition must be specified through a functor whose signature must be as follows:
struct Show_Arc { bool operator () (GT::Arc * arc) { /// the filter condition } };
Definition at line 1162 of file tpl_graph.H.
Definition at line 1167 of file tpl_graph.H.
| using Aleph::Arc_Iterator< GT, Show_Arc >::Itor = Filter_Iterator<GT, typename GT::Arc_Iterator, Show_Arc> |
Definition at line 1165 of file tpl_graph.H.
| using Aleph::Arc_Iterator< GT, Show_Arc >::Set_Type = typename Itor::Set_Type |
Type of element: Arc*.
Definition at line 1168 of file tpl_graph.H.
|
default |
Type of set all the arcs.
|
inline |
Constructor,.
| [in] | g | the graph |
| [in] | sa | filter functor |
Definition at line 1177 of file tpl_graph.H.