Leaf node structure of the B-tree leaf pages. More...
#include <stx-cbtreedb.h>
Public Member Functions | |
LeafNode () | |
Initializes structure with zero. | |
bool | IsFull () const |
Returns true if no more keys can be added. | |
const key_type & | LastKey () 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. | |
}; |
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.
stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::LeafNode::LeafNode | ( | ) | [inline, explicit] |
Initializes structure with zero.
Definition at line 234 of file stx-cbtreedb.h.
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.
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.
union { ... } |
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.
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.
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.
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.
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 |
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.