|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Generic traversal of the container through its iterator. More...
#include <ah-dry.H>
Inherited by Aleph::DynDlist< typename GT::Node * >, Aleph::DynDlist< Aleph::Path::Path_Desc >, Aleph::DynDlist< T * >, Aleph::DynDlist< ConstraintType >, Aleph::DynDlist< VertexPair >, Aleph::DynDlist< Aleph::blossom_weighted_detail::mwmatching::impl::NonTrivialBlossom >, Aleph::DynDlist< Aleph::blossom_weighted_detail::mwmatching::impl::NonTrivialBlossom::SubBlossom >, Aleph::DynDlist< const Aleph::blossom_weighted_detail::mwmatching::Edge< WeightType > * >, Aleph::DynDlist< int >, Aleph::DynDlist< Tag_Data >, Aleph::DynDlist< Arc_Desc >, Aleph::DynDlist< Thread_Desc >, Aleph::DynDlist< Eepic_Geom_Object * >, Aleph::DynDlist< Polinomio::Termino >, Aleph::DynDlist< Arc_Data >, Aleph::DynDlist< Connexion_Data >, Aleph::DynHashTable< std::pair< Key, Data >, LhashTable, Dft_Pair_Cmp< Key, Data, Aleph::equal_to< Key > > >, Aleph::DynHashTable< Key, LhashTable, Aleph::equal_to< Key > >, Aleph::DynHashTable< Key, LinearHashTable, Aleph::equal_to< Key > >, Aleph::DynHashTable< std::pair< GT_Node *, size_t >, LhashTable, Dft_Pair_Cmp< GT_Node *, size_t, Aleph::equal_to< GT_Node * > > >, Aleph::DynHashTable< std::pair< Key, T >, LhashTable, Dft_Pair_Cmp< Key, T, Cmp > >, Aleph::DynHashTable< std::pair< Aleph::Gen_Link_Cut_Tree_WithEdges::EdgeKey, size_t >, Aleph::Gen_Link_Cut_Tree_WithEdges::EdgeKeyEq, Dft_Pair_Cmp< Aleph::Gen_Link_Cut_Tree_WithEdges::EdgeKey, size_t, Aleph::equal_to< Aleph::Gen_Link_Cut_Tree_WithEdges::EdgeKey > > >, Aleph::DynHashTable< std::pair< Node *, int >, Aleph::Gen_Link_Cut_Tree_WithEdges::NodePtrEq, Dft_Pair_Cmp< Node *, int, Aleph::equal_to< Node * > > >, Aleph::DynList< int >, Aleph::DynList< Event >, Aleph::DynList< std::pair< size_t, size_t > >, Aleph::DynList< typename GT::Node * >, Aleph::DynList< typename GT::Arc * >, Aleph::DynList< Arc * >, Aleph::DynList< Node * >, Aleph::DynList< Aleph::FlowPath< Aleph::Net_Graph > >, Aleph::DynList< Aleph::FlowCycle< Aleph::Net_Graph > >, Aleph::DynList< void * >, Aleph::DynList< long >, Aleph::DynList< GT_Arc * >, Aleph::DynList< Aleph::Point >, Aleph::DynList< Solution >, Aleph::DynList< size_t >, Aleph::DynList< Aleph::DynList< typename GT::Node * > >, Aleph::DynList< Aleph::Tree_Node * >, Aleph::DynList< std::string >, Aleph::DynList< Pair >, Aleph::DynList< std::pair< Node *, Aleph::Zero_One_BFS::Node_Info * > >, Aleph::DynList< VertexId >, Aleph::DynList< Df_Low_Non_Tree_Arc >, Aleph::DynList< Aleph::DynList< int > >, Aleph::DynList< QueueTheadsPool::ConsumerQueueEvent * >, Aleph::DynList< char >, Aleph::DynList< string >, Aleph::DynList< std::thread >, Aleph::DynSkipList< int >, Aleph::ODhashTable< P, AhHashDispatcher::Equal >, Aleph::ODhashTable< int >, Aleph::OLhashTable< int >, Aleph::DynDlist< T >, Aleph::DynHashTable< Key, HashTable, Cmp >, Aleph::DynList< T >, Aleph::DynSkipList< Key, Compare >, Aleph::ODhashTable< Key, Cmp >, and Aleph::OLhashTable< Key, Cmp >.
Public Member Functions | |
| template<class Operation > requires Aleph::PredicateWith<Operation &, typename Aleph::concepts_detail::traverse_arg<Container, Operation>::type> | |
| bool | traverse (Operation &operation) noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_arg< Container, Operation >::type, Container & >()) |
| Traverse the container via its iterator and performs a conditioned operation on each item. | |
| template<class Operation > requires Aleph::PredicateWith<Operation &, typename Aleph::concepts_detail::traverse_carg<Container, Operation>::type> | |
| bool | traverse (Operation &operation) const noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_carg< Container, Operation >::type, const_source_t< Operation > >()) |
| Traverse a constant container; each item is handed out as a constant reference. | |
| template<class Operation > requires Aleph::PredicateWith<Operation &, typename Aleph::concepts_detail::traverse_carg<Container, Operation>::type> | |
| bool | traverse (Operation &&operation) const noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_carg< Container, Operation >::type, const_source_t< Operation > >()) |
Overload of traverse(Operation &) const that accepts rvalues. | |
| template<class Operation > requires Aleph::PredicateWith<Operation &, typename Aleph::concepts_detail::traverse_arg<Container, Operation>::type> | |
| bool | traverse (Operation &&operation) noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_arg< Container, Operation >::type, Container & >()) |
Overload of traverse(Operation &) that accepts rvalues. | |
Private Types | |
| template<class Deferred > | |
| using | const_source_t = std::conditional_t< std::is_constructible_v< typename Aleph::concepts_detail::defer< Container, Deferred >::type::Iterator, const typename Aleph::concepts_detail::defer< Container, Deferred >::type & >, const typename Aleph::concepts_detail::defer< Container, Deferred >::type &, typename Aleph::concepts_detail::defer< Container, Deferred >::type & > |
Static Private Member Functions | |
| template<class Operation , class Arg , class Source > | |
| static constexpr bool | traverse_is_noexcept () noexcept |
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
The modifiable traversal hands out what the iterator's get_curr() returns; the constant one hands out each item as const T &.
|
private |
|
inlinenoexcept |
Overload of traverse(Operation &) const that accepts rvalues.
The operation is passed (invoked) as a named lvalue to the lvalue overload rather than being perfectly forwarded.
| [in] | operation | to be performed on each item. |
true if all the items were visited; false otherwise. | anything | that operation throws. |
|
inlinenoexcept |
Overload of traverse(Operation &) that accepts rvalues.
The operation is passed (invoked) as a named lvalue to the lvalue overload rather than being perfectly forwarded.
| [in] | operation | to be performed on each item. |
true if all the items were visited; false otherwise. | anything | that operation throws. |
|
inlinenoexcept |
Traverse a constant container; each item is handed out as a constant reference.
operation must accept const Item_Type &: an operation that needs to modify the item does not compile on a constant container.
| [in] | operation | to be performed on each item. |
true if all the items were visited; false if operation stopped the traversal. | anything | that operation throws. |
Definition at line 436 of file ah-dry.H.
References Aleph::dry_detail::advance(), Aleph::dry_detail::current(), and Aleph::iterator_for().
|
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(typename Container::Item_Type & item)
If operation(item) returns true then the iterator is advanced and the next item processed. Otherwise, the traversal stops.
| [in] | operation | to be performed on each item |
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. | anything | that could throw operation |
Definition at line 411 of file ah-dry.H.
References Aleph::dry_detail::advance(), and Aleph::dry_detail::current().
Referenced by demo_iteration(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), 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(), and Aleph::DynListStack< T >::traverse().
|
inlinestaticconstexprprivatenoexcept |