orbtree
|
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_type & | key () 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_base & | operator++ () |
increment: move to the next stored node | |
iterator_base | operator++ (int) |
increment: move to the next stored node | |
iterator_base & | operator-- () |
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 > |
Iterators.
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
|
inline |
compare iterators
Note: comparing iterators from different map / tree is undefined behavior, it is not explicitely tested
|
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.
|
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.
|
inline |
compare iterators
Note: comparing iterators from different map / tree is undefined behavior, it is not explicitely tested