|
PST File Format SDK v0.4
|
Represents a non-leaf node in a BTree structure. More...
#include <btree.h>
Inheritance diagram for pstsdk::btree_node_nonleaf< K, V >:
Collaboration diagram for pstsdk::btree_node_nonleaf< K, V >:Public Member Functions | |
| virtual | ~btree_node_nonleaf () |
| const V & | lookup (const K &key) const |
| Looks up the associated value for a given key. | |
Public Member Functions inherited from pstsdk::btree_node< K, V > | |
| virtual | ~btree_node () |
| virtual const K & | get_key (uint pos) const =0 |
| Returns the key at the specified position. | |
| virtual uint | num_values () const =0 |
| Returns the number of entries in this btree_node. | |
| const_iterator | begin () const |
| Returns a STL style iterator positioned at the first entry. | |
| const_iterator | end () const |
| Returns a STL style iterator positioned at the "end" entry. | |
| int | binary_search (const K &key) const |
| Performs a binary search over the keys of this btree_node. | |
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 > |
Additional Inherited Members | |
Public Types inherited from pstsdk::btree_node< K, V > | |
| typedef const_btree_node_iter< K, V > | const_iterator |
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 |
|
inlinevirtual |
|
protectedvirtual |
Positions the iterator at the first element on this tree.
| [in,out] | iter | Iterator state class |
Implements pstsdk::btree_node< K, V >.
|
protectedpure virtual |
Returns the child btree_node at the requested location.
| [in] | i | The position at which to get the child |
Implemented in pstsdk::bth_nonleaf_node< K, V >, pstsdk::subnode_nonleaf_block, and pstsdk::bt_nonleaf_page< K, V >.
|
protectedpure virtual |
Returns the child btree_node at the requested location.
| [in] | i | The position at which to get the child |
Implemented in pstsdk::bth_nonleaf_node< K, V >, pstsdk::subnode_nonleaf_block, and pstsdk::bt_nonleaf_page< K, V >.
|
protectedvirtual |
Positions the iterator at the "end" element.
| [in,out] | iter | Iterator state class |
Implements pstsdk::btree_node< K, V >.
|
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 pstsdk::btree_node< K, V >.
|
protectedvirtual |
Moves the iterator to the next element.
| [in,out] | iter | Iterator state class |
Implements pstsdk::btree_node< K, V >.
|
protectedvirtual |
Moves the iterator to the previous element.
| [in,out] | iter | Iterator state class |
Implements pstsdk::btree_node< K, V >.
|
friend |
|
friend |