|
PST File Format SDK v0.4
|
A BTree Node. More...
#include <btree.h>
Inheritance diagram for pstsdk::btree_node< K, V >:
Collaboration diagram for pstsdk::btree_node< K, V >:Public Types | |
| typedef const_btree_node_iter< K, V > | const_iterator |
Public Member Functions | |
| virtual | ~btree_node () |
| virtual const V & | lookup (const K &key) const =0 |
| Looks up the associated value for a given key. | |
| 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 void | first (btree_iter_impl< K, V > &iter) const =0 |
| Positions the iterator at the first element on this tree. | |
| virtual void | last (btree_iter_impl< K, V > &iter) const =0 |
| Positions the iterator at the "end" element. | |
| virtual void | next (btree_iter_impl< K, V > &iter) const =0 |
| Moves the iterator to the next element. | |
| virtual void | prev (btree_iter_impl< K, V > &iter) const =0 |
| Moves the iterator to the previous element. | |
Friends | |
| class | const_btree_node_iter< K, V > |
| class | btree_node_nonleaf< K, V > |
A BTree Node.
The fundamental type in the BTree system is the btree_node. It provides the generic interface which is refined by the other classes.
| K | The key type. Must be LessThan comparable. |
| V | The value type |
| typedef const_btree_node_iter<K,V> pstsdk::btree_node< K, V >::const_iterator |
|
inlinevirtual |
|
inline |
| int pstsdk::btree_node< K, V >::binary_search | ( | const K & | key | ) | const |
Performs a binary search over the keys of this btree_node.
| [in] | key | The key to lookup |
|
inline |
|
protectedpure virtual |
Positions the iterator at the first element on this tree.
| [in,out] | iter | Iterator state class |
Implemented in pstsdk::btree_node_leaf< K, V >, pstsdk::btree_node_nonleaf< K, V >, and pstsdk::btree_node_nonleaf< node_id, subnode_info >.
|
pure virtual |
Returns the key at the specified position.
This is specific to this btree_node, not the entire tree
| [in] | pos | The position to retrieve the key for |
Implemented in pstsdk::bth_nonleaf_node< K, V >, pstsdk::bth_leaf_node< K, V >, pstsdk::subnode_nonleaf_block, pstsdk::subnode_leaf_block, pstsdk::bt_nonleaf_page< K, V >, and pstsdk::bt_leaf_page< K, V >.
|
protectedpure virtual |
Positions the iterator at the "end" element.
| [in,out] | iter | Iterator state class |
Implemented in pstsdk::btree_node_leaf< K, V >, pstsdk::btree_node_nonleaf< K, V >, and pstsdk::btree_node_nonleaf< node_id, subnode_info >.
|
pure 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 |
Implemented in pstsdk::btree_node_leaf< K, V >, pstsdk::btree_node_nonleaf< K, V >, pstsdk::btree_node_leaf< node_id, subnode_info >, and pstsdk::btree_node_nonleaf< node_id, subnode_info >.
|
protectedpure virtual |
Moves the iterator to the next element.
| [in,out] | iter | Iterator state class |
Implemented in pstsdk::btree_node_leaf< K, V >, pstsdk::btree_node_nonleaf< K, V >, pstsdk::btree_node_leaf< node_id, subnode_info >, and pstsdk::btree_node_nonleaf< node_id, subnode_info >.
|
pure virtual |
Returns the number of entries in this btree_node.
This is specific to this btree_node, not the entire tree
Implemented in pstsdk::bth_nonleaf_node< K, V >, pstsdk::bth_leaf_node< K, V >, pstsdk::subnode_nonleaf_block, pstsdk::subnode_leaf_block, pstsdk::bt_nonleaf_page< K, V >, and pstsdk::bt_leaf_page< K, V >.
|
protectedpure virtual |
Moves the iterator to the previous element.
| [in,out] | iter | Iterator state class |
Implemented in pstsdk::btree_node_leaf< K, V >, pstsdk::btree_node_nonleaf< K, V >, pstsdk::btree_node_leaf< node_id, subnode_info >, and pstsdk::btree_node_nonleaf< node_id, subnode_info >.
|
friend |
|
friend |