Fairport
v1.0.38
|
Represents a non-leaf node in a BTree structure. More...
#include <btree.h>
Public Member Functions | |
virtual | ~btree_node_nonleaf () |
const V & | lookup (const K &key) const |
Protected Member Functions | |
virtual btree_node< K, V > * | get_child (uint i)=0 |
Returns the child btree_node at the requested location. | |
virtual const btree_node< K, V > * | get_child (uint i) const =0 |
Returns the child btree_node at the requested location. | |
void | first (btree_iter_impl< K, V > &iter) const |
Positions the iterator at the first element on this tree. | |
void | last (btree_iter_impl< K, V > &iter) const |
Positions the iterator at the "end" element. | |
void | next (btree_iter_impl< K, V > &iter) const |
Moves the iterator to the next element. | |
void | prev (btree_iter_impl< K, V > &iter) const |
Moves the iterator to the previous element. | |
Friends | |
class | const_btree_node_iter< K, V > |
class | btree_node_leaf< K, V > |
Represents a non-leaf node in a BTree structure.
Classes which model a non-leaf of a BTree structure inherit from this. They have a total of four simple virtual functions to implement:
K | The key type. Must be LessThan comparable. |
V | The value type |
virtual fairport::btree_node_nonleaf< K, V >::~btree_node_nonleaf | ( | ) | [inline, virtual] |
void fairport::btree_node_nonleaf< K, V >::first | ( | btree_iter_impl< K, V > & | iter | ) | const [protected, virtual] |
Positions the iterator at the first element on this tree.
[in,out] | iter | Iterator state class |
Implements fairport::btree_node< K, V >.
virtual btree_node<K,V>* fairport::btree_node_nonleaf< K, V >::get_child | ( | uint | i | ) | [protected, pure virtual] |
Returns the child btree_node at the requested location.
[in] | i | The position at which to get the child |
Implemented in fairport::subnode_nonleaf_block, fairport::bth_nonleaf_node< K, V >, and fairport::bt_nonleaf_page< K, V >.
virtual const btree_node<K,V>* fairport::btree_node_nonleaf< K, V >::get_child | ( | uint | i | ) | const [protected, pure virtual] |
Returns the child btree_node at the requested location.
[in] | i | The position at which to get the child |
Implemented in fairport::subnode_nonleaf_block, fairport::bth_nonleaf_node< K, V >, and fairport::bt_nonleaf_page< K, V >.
void fairport::btree_node_nonleaf< K, V >::last | ( | btree_iter_impl< K, V > & | iter | ) | const [protected, virtual] |
Positions the iterator at the "end" element.
[in,out] | iter | Iterator state class |
Implements fairport::btree_node< K, V >.
const V & fairport::btree_node_nonleaf< K, V >::lookup | ( | const K & | key | ) | const [virtual] |
Looks up the associated value for a given key.
This will defer to child btree_nodes as appropriate
key_not_found<K> | if the requested key is not in this btree |
[in] | key | The key to lookup |
Implements fairport::btree_node< K, V >.
void fairport::btree_node_nonleaf< K, V >::next | ( | btree_iter_impl< K, V > & | iter | ) | const [protected, virtual] |
Moves the iterator to the next element.
[in,out] | iter | Iterator state class |
Implements fairport::btree_node< K, V >.
void fairport::btree_node_nonleaf< K, V >::prev | ( | btree_iter_impl< K, V > & | iter | ) | const [protected, virtual] |
Moves the iterator to the previous element.
[in,out] | iter | Iterator state class |
Implements fairport::btree_node< K, V >.
friend class btree_node_leaf< K, V > [friend] |
friend class const_btree_node_iter< K, V > [friend] |
Reimplemented from fairport::btree_node< K, V >.