MADARA  3.2.3
DeepIterator.h File Reference

Go to the source code of this file.

Classes

class  DeepIterator< Iterator >
 The iterator type returned by deep_iterate. More...
 
struct  IteratorTraits< T, U, V >
 Specialize this template to support various kinds of iterators. More...
 
struct  IteratorTraits< T, typename TypeHelper< typename T::value_type >::type, typename TypeHelper< typename T::value_type::second_type >::type >
 Specialization for map-style pair iterators, where we want to deep-copy the value, but not the key. More...
 
struct  IteratorTraits< T, typename TypeHelper< typename T::value_type >::type, V >
 Specialization for plain iterators, where we can call deep_copy directly on the iterator. More...
 
struct  TypeHelper< T >
 Helper class for type inference. More...
 

Functions

template<class Iterator >
DeepIterator< Iterator > deep_iterate (const Iterator &i)
 Returns an input iterator from an iterator. More...
 

Function Documentation

template<class Iterator >
DeepIterator<Iterator> deep_iterate ( const Iterator &  i)

Returns an input iterator from an iterator.

Supports two kinds of iterators:

Direct iterators, where given iterator i, i->deep_copy() returns a deep copy of the value; OR

Pair iterators (e.g., map::iterator), where given iterator i, i->second.deep_copy() returns a deep copy of the value.

In either case, the returned iterator behaves like the original, except restricted to input semantics, and the values are deep copies of the original values. Elements not deep copied (such as the key in a map's key-value pair) may be const references to the original instead of a copy.

Parameters
ithe iterator to mimic. The iterator will be copied internally.
Returns
the input iterator

Definition at line 179 of file DeepIterator.h.