|
Fairport
v1.0.38
|
The object which forms the root of the BTH hierarchy. More...
#include <heap.h>
Inheritance diagram for fairport::bth_node< K, V >:
Collaboration diagram for fairport::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. | |
Static Public Member Functions | |
| static std::tr1::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::tr1::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::tr1::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 |
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 |
| fairport::bth_node< K, V >::bth_node | ( | const heap_ptr & | h, |
| heap_id | id, | ||
| ushort | level | ||
| ) | [inline] |
| virtual fairport::bth_node< K, V >::~bth_node | ( | ) | [inline, virtual] |
| const heap_ptr fairport::bth_node< K, V >::get_heap_ptr | ( | ) | const [inline] |
| heap_ptr fairport::bth_node< K, V >::get_heap_ptr | ( | ) | [inline] |
| heap_id fairport::bth_node< K, V >::get_id | ( | ) | const [inline] |
| size_t fairport::bth_node< K, V >::get_key_size | ( | ) | const [inline] |
| ushort fairport::bth_node< K, V >::get_level | ( | ) | const [inline] |
| const node& fairport::bth_node< K, V >::get_node | ( | ) | const [inline] |
| node& fairport::bth_node< K, V >::get_node | ( | ) | [inline] |
| size_t fairport::bth_node< K, V >::get_value_size | ( | ) | const [inline] |
| std::tr1::shared_ptr< fairport::bth_leaf_node< K, V > > fairport::bth_node< K, V >::open_leaf | ( | const heap_ptr & | h, |
| heap_id | id | ||
| ) | [inline, static] |
| std::tr1::shared_ptr< fairport::bth_nonleaf_node< K, V > > fairport::bth_node< K, V >::open_nonleaf | ( | const heap_ptr & | h, |
| heap_id | id, | ||
| ushort | level | ||
| ) | [inline, static] |
| std::tr1::shared_ptr< fairport::bth_node< K, V > > fairport::bth_node< K, V >::open_root | ( | const heap_ptr & | h, |
| heap_id | bth_root | ||
| ) | [inline, static] |
Opens a BTH node from the specified heap at the given root.
| sig_mismatch | (FAIRPORT_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 |
heap_ptr fairport::bth_node< K, V >::m_heap [protected] |