![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
AVL binary search tree iterator. More...
#include <agrum/base/core/AVLTree.h>
Public Types | |
| using | iterator_category = std::bidirectional_iterator_tag |
| Types for STL compliance. | |
| using | value_type = Val |
| Types for STL compliance. | |
| using | reference = value_type& |
| Types for STL compliance. | |
| using | const_reference = const value_type& |
| Types for STL compliance. | |
| using | pointer = value_type* |
| Types for STL compliance. | |
| using | const_pointer = const value_type* |
| Types for STL compliance. | |
Public Member Functions | |
Constructors / Destructors | |
| AVLTreeIterator (const AVLTree< Val, Cmp > &tree, const bool begin=true) noexcept | |
| constructor for begin iterators | |
| AVLTreeIterator (const AVLTreeIterator< Val, Cmp > &from) noexcept | |
| copy constructor | |
| AVLTreeIterator (AVLTreeIterator< Val, Cmp > &&from) noexcept | |
| move constructor | |
| ~AVLTreeIterator () noexcept | |
| destructor | |
Operators | |
| AVLTreeIterator< Val, Cmp > & | operator= (const AVLTreeIterator< Val, Cmp > &from) noexcept |
| copy operator | |
| AVLTreeIterator< Val, Cmp > & | operator= (AVLTreeIterator< Val, Cmp > &&from) noexcept |
| move operator | |
| bool | operator== (const AVLTreeIterator< Val, Cmp > &from) const |
| indicates whether two iterator point to the same element | |
| bool | operator!= (const AVLTreeIterator< Val, Cmp > &from) const |
| indicates whether two iterator point to different element | |
| AVLTreeIterator< Val, Cmp > & | operator++ () noexcept |
| move to the next element in the tree | |
| AVLTreeIterator< Val, Cmp > & | operator+= (const Size k) noexcept |
| move to the next k element | |
| AVLTreeIterator< Val, Cmp > & | operator-- () noexcept |
| move to the preceding element in the tree | |
| AVLTreeIterator< Val, Cmp > & | operator-= (const Size k) noexcept |
| move to the preceding k element | |
| const_reference | operator* () const |
| returns the element pointed to by the iterator | |
Protected Types | |
| using | AVLNode = AVLTreeNode< Val > |
| the type of the nodes of the tree | |
Protected Member Functions | |
| AVLNode * | nextNode_ (AVLNode *node) const noexcept |
| computes the node to go to when applying operator++ | |
| AVLNode * | precedingNode_ (AVLNode *node) const noexcept |
| computes the node to go to when applying operator-- | |
| void | unregisterTree_ () noexcept |
| make the iterator point to nothing | |
| void | pointToEndRend_ () noexcept |
| force the iterator to point to end/rend | |
Protected Attributes | |
| AVLTree< Val, Cmp > * | tree_ {nullptr} |
| the tree the iterator points to | |
| AVLNode * | node_ {nullptr} |
| the AVLNode the iterator points to | |
| AVLNode * | next_node_ {nullptr} |
| the next node to go to when applying operator++ | |
| AVLNode * | preceding_node_ {nullptr} |
| the preceding node to go to when applying operator-- | |
| friend | AVLTree< Val, Cmp > |
| allow AVL trees to access the content of the iterators | |
AVL binary search tree iterator.
| Val | The type of the elements stored into the tree. |
| Cmp | The function used for sorting the elements. queues. |
|
protected |
| using gum::AVLTreeIterator< Val, Cmp >::const_pointer = const value_type* |
| using gum::AVLTreeIterator< Val, Cmp >::const_reference = const value_type& |
| using gum::AVLTreeIterator< Val, Cmp >::iterator_category = std::bidirectional_iterator_tag |
| using gum::AVLTreeIterator< Val, Cmp >::pointer = value_type* |
| using gum::AVLTreeIterator< Val, Cmp >::reference = value_type& |
| using gum::AVLTreeIterator< Val, Cmp >::value_type = Val |
|
explicitnoexcept |
constructor for begin iterators
| tree | the AVL tree which parses the iterator |
| begin | if true, the iterator points to the lowest value in the tree, else it points to the highest value |
|
noexcept |
copy constructor
|
noexcept |
move constructor
|
noexcept |
destructor
|
protectednoexcept |
computes the node to go to when applying operator++
| bool gum::AVLTreeIterator< Val, Cmp >::operator!= | ( | const AVLTreeIterator< Val, Cmp > & | from | ) | const |
indicates whether two iterator point to different element
| const_reference gum::AVLTreeIterator< Val, Cmp >::operator* | ( | ) | const |
returns the element pointed to by the iterator
| NotFound | is raised if the iterator does not point to any element |
|
noexcept |
move to the next element in the tree
|
noexcept |
move to the next k element
|
noexcept |
move to the preceding element in the tree
|
noexcept |
move to the preceding k element
|
noexcept |
move operator
|
noexcept |
copy operator
| bool gum::AVLTreeIterator< Val, Cmp >::operator== | ( | const AVLTreeIterator< Val, Cmp > & | from | ) | const |
indicates whether two iterator point to the same element
|
protectednoexcept |
force the iterator to point to end/rend
|
protectednoexcept |
computes the node to go to when applying operator--
|
protectednoexcept |
make the iterator point to nothing
|
protected |
|
protected |
|
protected |
|
protected |