Fairport  v1.0.38
fairport::bth_node< K, V > Class Template Reference

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 >:

List of all members.

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 nodeget_node () const
 Get the node underlying this BTH.
nodeget_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

Detailed Description

template<typename K, typename V>
class fairport::bth_node< K, V >

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.

Template Parameters:
KThe key type for this BTH
VThe value type for this BTH
See also:
[MS-PST] 2.3.2

Definition at line 278 of file heap.h.


Constructor & Destructor Documentation

template<typename K, typename V>
fairport::bth_node< K, V >::bth_node ( const heap_ptr h,
heap_id  id,
ushort  level 
) [inline]

Construct a bth_node object.

Parameters:
[in]hThe heap to open out of
[in]idThe id to interpret as a non-leaf BTH node
[in]levelThe level of this non-leaf node (must be non-zero)

Definition at line 303 of file heap.h.

template<typename K, typename V>
virtual fairport::bth_node< K, V >::~bth_node ( ) [inline, virtual]

Definition at line 305 of file heap.h.


Member Function Documentation

template<typename K, typename V>
const heap_ptr fairport::bth_node< K, V >::get_heap_ptr ( ) const [inline]

Returns the heap this bth_node is in.

The heap this bth_node is in

Definition at line 322 of file heap.h.

template<typename K, typename V>
heap_ptr fairport::bth_node< K, V >::get_heap_ptr ( ) [inline]

Returns the heap this bth_node is in.

The heap this bth_node is in

Definition at line 325 of file heap.h.

template<typename K, typename V>
heap_id fairport::bth_node< K, V >::get_id ( ) const [inline]

Return the heap_id of this bth_node.

Returns:
the heap_id of this bth_node

Definition at line 309 of file heap.h.

template<typename K, typename V>
size_t fairport::bth_node< K, V >::get_key_size ( ) const [inline]

Return the key size of this bth.

Returns:
the key size of this bth

Definition at line 315 of file heap.h.

template<typename K, typename V>
ushort fairport::bth_node< K, V >::get_level ( ) const [inline]

Return the leve of this bth_node.

Returns:
the leve of this bth_node

Definition at line 312 of file heap.h.

template<typename K, typename V>
const node& fairport::bth_node< K, V >::get_node ( ) const [inline]

Get the node underlying this BTH.

Returns:
the node

Definition at line 329 of file heap.h.

template<typename K, typename V>
node& fairport::bth_node< K, V >::get_node ( ) [inline]

Get the node underlying this BTH.

Returns:
the node

Definition at line 332 of file heap.h.

template<typename K, typename V>
size_t fairport::bth_node< K, V >::get_value_size ( ) const [inline]

Return the value size of this bth.

Returns:
the value size of this bth

Definition at line 318 of file heap.h.

template<typename K , typename V >
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]

Open a leaf BTH node.

Parameters:
[in]hThe heap to open out of
[in]idThe id to interpret as a leaf BTH node

Definition at line 473 of file heap.h.

template<typename K , typename V >
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]

Open a non-leaf BTH node.

Parameters:
[in]hThe heap to open out of
[in]idThe id to interpret as a non-leaf BTH node
[in]levelThe level of this non-leaf node (must be non-zero)

Definition at line 442 of file heap.h.

template<typename K , typename V >
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.

Exceptions:
sig_mismatch(FAIRPORT_VALIDATION_LEVEL_WEAK) If this allocation doesn't have the BTH stamp
logic_errorIf the specified key/value type sizes do not match what is in the BTH header
Parameters:
[in]hThe heap to open out of
[in]bth_rootThe allocation containing the bth header

Definition at line 416 of file heap.h.


Member Data Documentation

template<typename K, typename V>
heap_ptr fairport::bth_node< K, V >::m_heap [protected]

Definition at line 335 of file heap.h.


The documentation for this class was generated from the following file: