orbtree
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
orbtree::orbtree< NodeAllocator, Compare, NVFunc, multi, simple >::iterator_base< is_const > Struct Template Reference

Iterators. More...

#include <orbtree.h>

Public Types

typedef std::bidirectional_iterator_tag iterator_category
 
typedef const value_base value_type
 Type of value pointed to by iterator. More...
 
typedef const value_base * pointer
 
typedef const value_base & reference
 

Public Member Functions

 iterator_base (const iterator_base< false > &it)
 
template<bool is_const_ = is_const>
 iterator_base (const iterator_base< true > &it, typename std::enable_if< is_const_ >::type *=0)
 
reference operator* ()
 read-only access to values More...
 
pointer operator-> ()
 read-only access to values More...
 
template<bool is_const_ = is_const, class KeyValue_ = typename NodeAllocator::KeyValue>
std::enable_if<!is_const_ >::type set_value (typename KeyValue_::MappedType &&v)
 change value stored in map or multimap
 
template<bool is_const_ = is_const, class KeyValue_ = typename NodeAllocator::KeyValue>
std::enable_if<!is_const_ >::type set_value (typename KeyValue_::MappedType const &v)
 change value stored in map or multimap
 
const key_typekey () const
 convenience function to return the key (for both set and map)
 
template<bool is_const2>
bool operator== (const iterator_base< is_const2 > &i) const
 compare iterators More...
 
template<bool is_const2>
bool operator!= (const iterator_base< is_const2 > &i) const
 compare iterators More...
 
iterator_baseoperator++ ()
 increment: move to the next stored node
 
iterator_base operator++ (int)
 increment: move to the next stored node
 
iterator_baseoperator-- ()
 decrement: move to the previous stored node
 
iterator_base operator-- (int)
 decrement: move to the previous stored node
 

Protected Types

typedef NodeAllocator::KeyValue::ValueType value_base
 
typedef std::conditional< is_const, const orbtree, orbtree >::type orbtree_t
 

Protected Member Functions

 iterator_base (orbtree_t &t_, NodeHandle n_)
 
template<bool is_const_ = is_const>
 iterator_base (const iterator_base< true > &it, typename std::enable_if<!is_const_ >::type *=0)
 

Protected Attributes

orbtree_t & t
 
NodeHandle n
 

Friends

class iterator_base<!is_const >
 
class orbtree< NodeAllocator, Compare, NVFunc, multi, simple >
 

Detailed Description

template<class NodeAllocator, class Compare, class NVFunc, bool multi, bool simple = false>
template<bool is_const>
struct orbtree::orbtree< NodeAllocator, Compare, NVFunc, multi, simple >::iterator_base< is_const >

Iterators.

Member Typedef Documentation

◆ value_type

template<class NodeAllocator, class Compare, class NVFunc, bool multi, bool simple = false>
template<bool is_const>
typedef const value_base orbtree::orbtree< NodeAllocator, Compare, NVFunc, multi, simple >::iterator_base< is_const >::value_type

Type of value pointed to by iterator.

Either the key (for sets) or an std::pair or orbtree::trivial_pair of key and value for maps.

Note: value cannot be changed directly even for non-const map iterators. Use the set_value() member function for that

Member Function Documentation

◆ operator!=()

template<class NodeAllocator, class Compare, class NVFunc, bool multi, bool simple = false>
template<bool is_const>
template<bool is_const2>
bool orbtree::orbtree< NodeAllocator, Compare, NVFunc, multi, simple >::iterator_base< is_const >::operator!= ( const iterator_base< is_const2 > &  i) const
inline

compare iterators

Note: comparing iterators from different map / tree is undefined behavior, it is not explicitely tested

◆ operator*()

template<class NodeAllocator, class Compare, class NVFunc, bool multi, bool simple = false>
template<bool is_const>
reference orbtree::orbtree< NodeAllocator, Compare, NVFunc, multi, simple >::iterator_base< is_const >::operator* ( )
inline

read-only access to values

Note: dereferencing the past-the-end iterator throws an exception.

Note: to allow the stored values in a map depend on the mapped value as well, they cannot be changed here, use the set_value() function instead for that purpose.

◆ operator->()

template<class NodeAllocator, class Compare, class NVFunc, bool multi, bool simple = false>
template<bool is_const>
pointer orbtree::orbtree< NodeAllocator, Compare, NVFunc, multi, simple >::iterator_base< is_const >::operator-> ( )
inline

read-only access to values

Note: dereferencing the past-the-end iterator throws an exception.

Note: to allow the stored values in a map depend on the mapped value as well, they cannot be changed here, use the set_value() function instead for that purpose.

◆ operator==()

template<class NodeAllocator, class Compare, class NVFunc, bool multi, bool simple = false>
template<bool is_const>
template<bool is_const2>
bool orbtree::orbtree< NodeAllocator, Compare, NVFunc, multi, simple >::iterator_base< is_const >::operator== ( const iterator_base< is_const2 > &  i) const
inline

compare iterators

Note: comparing iterators from different map / tree is undefined behavior, it is not explicitely tested


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