Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
GenericTraverse< Container > Struct Template Reference

Generic traversal of the container through its iterator. More...

#include <ah-dry.H>

Inheritance diagram for GenericTraverse< Container >:
[legend]

Public Member Functions

template<class Operation >
bool traverse (Operation &operation) noexcept(traverse_is_noexcept< Operation >())
 Traverse the container via its iterator and performs a conditioned operation on each item.
 
template<class Operation >
bool traverse (Operation &operation) const noexcept(traverse_is_noexcept< Operation >())
 Const overload of traverse(Operation&).
 
template<class Operation >
bool traverse (Operation &&operation) const noexcept(traverse_is_noexcept< Operation >())
 Overload of traverse(Operation&) const that accepts rvalues.
 
template<class Operation >
bool traverse (Operation &&operation) noexcept(traverse_is_noexcept< Operation >())
 Overload of traverse(Operation&) that accepts rvalues.
 

Static Private Member Functions

template<class Operation >
static constexpr bool traverse_is_noexcept () noexcept
 

Detailed Description

template<class Container>
struct GenericTraverse< Container >

Generic traversal of the container through its iterator.

This class implements a conditioned traversal on the container through its iterator.

It is assumed that Container exports its iterator with

typename Container::Iterator

Definition at line 64 of file ah-dry.H.

Member Function Documentation

◆ traverse() [1/4]

template<class Container >
template<class Operation >
bool GenericTraverse< Container >::traverse ( Operation &&  operation) const
inlinenoexcept

Overload of traverse(Operation&) const that accepts rvalues.

Definition at line 113 of file ah-dry.H.

◆ traverse() [2/4]

template<class Container >
template<class Operation >
bool GenericTraverse< Container >::traverse ( Operation &&  operation)
inlinenoexcept

Overload of traverse(Operation&) that accepts rvalues.

Definition at line 120 of file ah-dry.H.

◆ traverse() [3/4]

template<class Container >
template<class Operation >
bool GenericTraverse< Container >::traverse ( Operation &  operation) const
inlinenoexcept

Const overload of traverse(Operation&).

Definition at line 106 of file ah-dry.H.

◆ traverse() [4/4]

template<class Container >
template<class Operation >
bool GenericTraverse< Container >::traverse ( Operation &  operation)
inlinenoexcept

Traverse the container via its iterator and performs a conditioned operation on each item.

traverse(operation) instantiates the internal iterator of the class and traverses each item performing operation(item).

operation must have the following signature:

bool operation(const typename Container::Item_Type & item)

If operation(item) returns true then the iterator is advanced and the next item processed. Otherwise. the traversal stops.

Parameters
[in]operationto be performed on each item
Returns
true if all the items were visited (operation on each one always returned true) or false if the traversal was stopped because there was a false result on an item.
Exceptions
anythingthat could throw operation

Definition at line 95 of file ah-dry.H.

Referenced by demo_iteration(), Aleph::LocateMixin< Derived, Type >::find_ptr(), Aleph::LocateMixin< Derived, Type >::find_ptr(), Aleph::for_each_in_order(), Aleph::for_each_postorder(), Aleph::for_each_preorder(), Aleph::LocateMixin< Derived, Type >::nth(), Aleph::LocateMixin< Derived, Type >::nth_ne(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), Aleph::DynListQueue< T >::traverse(), Aleph::DynListStack< T >::traverse(), Aleph::DynListQueue< T >::traverse(), Aleph::DynListStack< T >::traverse(), Aleph::DynListQueue< T >::traverse(), Aleph::DynListStack< T >::traverse(), Aleph::DynListQueue< T >::traverse(), Aleph::DynListStack< T >::traverse(), and TYPED_TEST().

◆ traverse_is_noexcept()

template<class Container >
template<class Operation >
static constexpr bool GenericTraverse< Container >::traverse_is_noexcept ( )
inlinestaticconstexprprivatenoexcept

Definition at line 68 of file ah-dry.H.


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