|
PST File Format SDK v0.4
|
The object which forms the root of the BTH hierarchy. More...
#include <heap.h>
Inheritance diagram for pstsdk::bth_node< K, V >:
Collaboration diagram for pstsdk::bth_node< K, V >:Public Member Functions | |
| bth_node (const heap_ptr &h, heap_id id, ushort level) | |
| Construct a bth_node object. | |
| virtual | ~bth_node () |
| heap_id | get_id () const |
| Return the heap_id of this bth_node. | |
| ushort | get_level () const |
| Return the leve of this bth_node. | |
| size_t | get_key_size () const |
| Return the key size of this bth. | |
| size_t | get_value_size () const |
| Return the value size of this bth. | |
| const heap_ptr | get_heap_ptr () const |
| Returns the heap this bth_node is in. | |
| heap_ptr | get_heap_ptr () |
| Returns the heap this bth_node is in. | |
| const node & | get_node () const |
| Get the node underlying this BTH. | |
| node & | get_node () |
| Get the node underlying this BTH. | |
Public Member Functions inherited from pstsdk::btree_node< K, V > | |
| 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. | |
Static Public Member Functions | |
| static std::shared_ptr< bth_node< K, V > > | open_root (const heap_ptr &h, heap_id bth_root) |
| Opens a BTH node from the specified heap at the given root. | |
| static std::shared_ptr< bth_nonleaf_node< K, V > > | open_nonleaf (const heap_ptr &h, heap_id id, ushort level) |
| Open a non-leaf BTH node. | |
| static std::shared_ptr< bth_leaf_node< K, V > > | open_leaf (const heap_ptr &h, heap_id id) |
| Open a leaf BTH node. | |
Protected Attributes | |
| heap_ptr | m_heap |
Additional Inherited Members | |
Public Types inherited from pstsdk::btree_node< K, V > | |
| typedef const_btree_node_iter< K, V > | const_iterator |
Protected Member Functions inherited from pstsdk::btree_node< K, V > | |
| 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. | |
The object which forms the root of the BTH hierarchy.
A BTH is a simple tree structure built using allocations out of a heap. bth_node forms the root of the object hierarchy representing this tree. The child classes bth_nonleaf_node and bth_leaf_node contain the implementation and represent nonleaf and leaf bth_nodes, respectively.
Because a single bth_node is backed by a HN allocation (max 3.8k), most BTH "trees" consist of a BTH header which points directly to a single BTH leaf node.
This hierarchy also models the btree_node structure, inheriting the actual iteration and lookup logic.
| K | The key type for this BTH |
| V | The value type for this BTH |
|
inline |
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Opens a BTH node from the specified heap at the given root.
| sig_mismatch | (PSTSDK_VALIDATION_LEVEL_WEAK) If this allocation doesn't have the BTH stamp |
| logic_error | If the specified key/value type sizes do not match what is in the BTH header |
| [in] | h | The heap to open out of |
| [in] | bth_root | The allocation containing the bth header |
|
protected |