pstore2
Public Types | Public Member Functions | Friends | List of all members
pstore::index::hamt_map< KeyType, ValueType, Hash, KeyEqual >::iterator_base< IsConstIterator > Class Template Reference

Inner class that describes a const_iterator and 'regular' iterator. More...

#include <hamt_map.hpp>

Public Types

using iterator_category = std::forward_iterator_tag
 
using value_type = hamt_map< KeyType, ValueType, Hash, KeyEqual >::value_type
 
using difference_type = std::ptrdiff_t
 
using pointer = value_type *
 
using reference = value_type &
 
using value_reference_type = typename std::conditional< IsConstIterator, value_type const &, value_type & >::type
 For const_iterator: define value_reference_type to be a 'value_type const &' For iterator: define value_reference_type to be a 'value_type &'.
 
using value_pointer_type = typename std::conditional< IsConstIterator, value_type const *, value_type * >::type
 For const_iterator: define value_pointer_type to be a 'value_type const *' For regular iterator: define value_pointer_type to be a 'value_type *'.
 
using database_reference = typename std::conditional< IsConstIterator, database const &, database & >::type
 

Public Member Functions

 iterator_base (database_reference db, parent_stack &&parents, hamt_map const *idx)
 
 iterator_base (iterator_base const &other) noexcept
 
 iterator_base (iterator_base &&other) noexcept
 
template<bool Enable = IsConstIterator, typename = typename std::enable_if<Enable>::type>
 iterator_base (iterator_base< false > const &other) noexcept
 Copy constructor. More...
 
iterator_baseoperator= (iterator_base const &rhs) noexcept
 
iterator_baseoperator= (iterator_base &&rhs) noexcept
 
bool operator== (iterator_base const &other) const
 
bool operator!= (iterator_base const &other) const
 
value_reference_type operator* () const
 Dereference operator. More...
 
value_pointer_type operator-> () const
 
iterator_baseoperator++ ()
 Prefix increment.
 
iterator_base operator++ (int)
 Postfix increment operator (e.g., it++)
 
address get_address () const
 Returns the pstore address of the serialized value_type instance to which the iterator is currently pointing. More...
 

Friends

class iterator_base< true >
 
class hamt_map
 

Detailed Description

template<typename KeyType, typename ValueType, typename Hash, typename KeyEqual>
template<bool IsConstIterator = true>
class pstore::index::hamt_map< KeyType, ValueType, Hash, KeyEqual >::iterator_base< IsConstIterator >

Inner class that describes a const_iterator and 'regular' iterator.

Constructor & Destructor Documentation

◆ iterator_base()

template<typename KeyType, typename ValueType, typename Hash, typename KeyEqual>
template<bool IsConstIterator = true>
template<bool Enable = IsConstIterator, typename = typename std::enable_if<Enable>::type>
pstore::index::hamt_map< KeyType, ValueType, Hash, KeyEqual >::iterator_base< IsConstIterator >::iterator_base ( iterator_base< false > const &  other)
inlinenoexcept

Copy constructor.

Allows for implicit conversion from a regular iterator to a const_iterator

Member Function Documentation

◆ get_address()

template<typename KeyType, typename ValueType, typename Hash, typename KeyEqual>
template<bool IsConstIterator = true>
address pstore::index::hamt_map< KeyType, ValueType, Hash, KeyEqual >::iterator_base< IsConstIterator >::get_address ( ) const
inline

Returns the pstore address of the serialized value_type instance to which the iterator is currently pointing.

◆ operator*()

template<typename KeyType, typename ValueType, typename Hash, typename KeyEqual>
template<bool IsConstIterator = true>
value_reference_type pstore::index::hamt_map< KeyType, ValueType, Hash, KeyEqual >::iterator_base< IsConstIterator >::operator* ( ) const
inline

Dereference operator.

Returns
The value of the element to which this iterator is currently pointing.

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