stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::LeafNode Struct Reference

Leaf node structure of the B-tree leaf pages. More...

#include <stx-cbtreedb.h>

List of all members.

Public Member Functions

 LeafNode ()
 Initializes structure with zero.
bool IsFull () const
 Returns true if no more keys can be added.
const key_typeLastKey () const
 Returns the currently last key in the node.

Public Attributes

uint16_t level
 level of this leaf node -> always 0.
uint16_t slots
 number of used slots in the arrays.
uint64_t baseoffset
 base of value offsets enumerated in array.
union {
   struct {
      key_type   keys [LeafNodeNumKeys]
 key array of ascending key in this leaf.
      uint32_t   offsets [LeafNodeNumKeys+1]
 file offset of value data associated with key.
   }   packed
   char   filler [BTreePageSize-LeafNodeHead+sizeof(uint32_t)]
 union with filler char array to assure page size.
}; 

Detailed Description

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
struct stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::LeafNode

Leaf node structure of the B-tree leaf pages.

Each leaf node contains a key array and an array of relative value offsets. It does not contain the size of the value elements, because these can be computed from two successive relative offsets. This works for the last offset only because of the extra offset of the successor value item in the next leaf. The value offsets are relative to a starting 64-bit offset, because all leaf's data items are stored in order.

Definition at line 206 of file stx-cbtreedb.h.


Constructor & Destructor Documentation

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::LeafNode::LeafNode (  )  [inline, explicit]

Initializes structure with zero.

Definition at line 234 of file stx-cbtreedb.h.


Member Function Documentation

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
bool stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::LeafNode::IsFull (  )  const [inline]

Returns true if no more keys can be added.

Definition at line 241 of file stx-cbtreedb.h.

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
const key_type& stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::LeafNode::LastKey (  )  const [inline]

Returns the currently last key in the node.

Definition at line 247 of file stx-cbtreedb.h.


Member Data Documentation

union { ... }
template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
uint64_t stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::LeafNode::baseoffset

base of value offsets enumerated in array.

Definition at line 215 of file stx-cbtreedb.h.

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
char stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::LeafNode::filler[BTreePageSize-LeafNodeHead+sizeof(uint32_t)]

union with filler char array to assure page size.

Definition at line 230 of file stx-cbtreedb.h.

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
key_type stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::LeafNode::keys[LeafNodeNumKeys]

key array of ascending key in this leaf.

Definition at line 222 of file stx-cbtreedb.h.

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
uint16_t stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::LeafNode::level

level of this leaf node -> always 0.

Definition at line 209 of file stx-cbtreedb.h.

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
uint32_t stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::LeafNode::offsets[LeafNodeNumKeys+1]

file offset of value data associated with key.

Definition at line 225 of file stx-cbtreedb.h.

struct { ... } stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::LeafNode::packed
template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
uint16_t stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::LeafNode::slots

number of used slots in the arrays.

Definition at line 212 of file stx-cbtreedb.h.


The documentation for this struct was generated from the following file:
Generated on Wed Apr 14 13:43:41 2010 for stx-cbtreedb by  doxygen 1.6.3