Fairport
v1.0.38
|
Represents a leaf node in a BTree structure. More...
#include <btree.h>
Public Member Functions | |
virtual | ~btree_node_leaf () |
const V & | lookup (const K &key) const |
Looks up the associated value for a given key. | |
virtual const V & | get_value (uint pos) const =0 |
Returns the value at the associated position on this leaf node. | |
Protected Member Functions | |
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 > |
Represents a leaf node in a BTree structure.
Classes which model a leaf of a BTree structure inherit from this. They have a total of three simple virtual functions to implement:
K | The key type. Must be LessThan comparable. |
V | The value type |
virtual fairport::btree_node_leaf< K, V >::~btree_node_leaf | ( | ) | [inline, virtual] |
void fairport::btree_node_leaf< K, V >::first | ( | btree_iter_impl< K, V > & | iter | ) | const [inline, 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 const V& fairport::btree_node_leaf< K, V >::get_value | ( | uint | pos | ) | const [pure virtual] |
Returns the value at the associated position on this leaf node.
[in] | pos | The position to retrieve the value for |
Implemented in fairport::subnode_leaf_block, fairport::bth_leaf_node< K, V >, and fairport::bt_leaf_page< K, V >.
void fairport::btree_node_leaf< K, V >::last | ( | btree_iter_impl< K, V > & | iter | ) | const [inline, 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_leaf< K, V >::lookup | ( | const K & | key | ) | const [virtual] |
Looks up the associated value for a given key.
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_leaf< 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_leaf< 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 const_btree_node_iter< K, V > [friend] |
Reimplemented from fairport::btree_node< K, V >.