#include <Avl.hpp>
Public Types | |
| typedef Iterator< T, KeyType, DeleterT > | IterT |
| Used when searching. | |
Public Member Functions | |
| bool | checkTree (NodeT *node) |
| bool | checkTree () |
| Check this tree correctness. | |
| void | Clear () |
| Empty the tree and delete all objects. | |
| bool | Delete (const IterT &iter) |
| Delete an object from the tree. | |
| bool | Delete (KeyType key) |
| Delete an object from the tree. | |
| const IterT | getFirstIterator () const |
| Get iterator on first object. | |
| IterT | getFirstIterator () |
| Get iterator on first object. | |
| const IterT | getLastIterator () const |
| Get iterator on last object. | |
| IterT | getLastIterator () |
| Get iterator on last object. | |
| uint32 | getSize () const |
| Get tree height (or size). | |
| bool | insertObject (const T &obj, KeyType key) |
| Insert an object in the tree with its key. | |
| bool | isEmpty () const |
| Check if the tree is empty. | |
| IterT | searchExtreme (const bool lowest) const |
| Search the extreme node. | |
| IterT | searchFor (KeyType key) const |
| Search the node with the given key. | |
| Tree () | |
| Default constructor. | |
| virtual | ~Tree () |
| Destructor. | |
Protected Types | |
| enum | { NoRelativeParent = NULL } |
| Used for insertion. More... | |
| typedef Iterator<T, KeyType, DeleterT> Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::IterT |
Used when searching.
anonymous enum [protected] |
| Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::Tree | ( | ) | [inline] |
Default constructor.
| virtual Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::~Tree | ( | ) | [inline, virtual] |
Destructor.
| bool Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::checkTree | ( | NodeT * | node | ) | [inline] |
| bool Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::checkTree | ( | ) | [inline] |
Check this tree correctness.
| void Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::Clear | ( | ) | [inline] |
Empty the tree and delete all objects.
| bool Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::Delete | ( | const IterT & | iter | ) | [inline] |
Delete an object from the tree.
Data itself is deleted.
| bool Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::Delete | ( | KeyType | key | ) | [inline] |
Delete an object from the tree.
Data itself is deleted. Iterators held on this tree are invalidated
| const IterT Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::getFirstIterator | ( | ) | const [inline] |
Get iterator on first object.
| IterT Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::getFirstIterator | ( | ) | [inline] |
Get iterator on first object.
| const IterT Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::getLastIterator | ( | ) | const [inline] |
Get iterator on last object.
| IterT Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::getLastIterator | ( | ) | [inline] |
Get iterator on last object.
| uint32 Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::getSize | ( | ) | const [inline] |
Get tree height (or size).
| bool Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::insertObject | ( | const T & | obj, | |
| KeyType | key | |||
| ) | [inline] |
Insert an object in the tree with its key.
The tree takes ownership of data This method use an iterative algorithm, so it support very large trees
| bool Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::isEmpty | ( | ) | const [inline] |
Check if the tree is empty.
| IterT Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::searchExtreme | ( | const bool | lowest | ) | const [inline] |
Search the extreme node.
| lowest | If set to true, the lowest node is returned, else it's the highest node that is returned |
| IterT Tree::AVL::Tree< T, KeyType, Policy, DeleterT >::searchFor | ( | KeyType | key | ) | const [inline] |
Search the node with the given key.
The search worst time is O(log getSize()) operation which is very good.
