BTreePage is a reference-counted buffer holding one page of the B-tree index. More...
#include <stx-cbtreedb.h>
Classes | |
struct | Impl |
Implementation of BTreePage: holds the data buffer and a reference counter. More... | |
Public Member Functions | |
BTreePage () | |
Default Constructor: create new invalid page buffer. | |
BTreePage (const BTreePage &btp) | |
Copy Constructor: increment reference counter on buffer. | |
~BTreePage () | |
Destructor: decrement reference counter on buffer and possibly deallocate it. | |
BTreePage & | operator= (const BTreePage &btp) |
Assignment Operator: increment reference counter on buffer. | |
bool | IsValid () const |
Determine whether the wrapper object contains valid page. | |
void | Create () |
Release enclosed page and initialize a new page buffer. | |
char * | GetBuffer () |
Accessor: return enclosed buffer pointer. | |
uint16_t | GetLevel () const |
Return the enclosed node's level in the tree. | |
bool | IsLeafNode () const |
Returns true if the buffer contains a leaf node. | |
InnerNode * | GetAsInnerNode () const |
Return buffer casted as an inner node. | |
LeafNode * | GetAsLeafNode () const |
Return buffer casted as a leaf node. | |
Protected Attributes | |
struct Impl * | m_impl |
pointer to reference-counted data buffer object. |
BTreePage is a reference-counted buffer holding one page of the B-tree index.
Note that this wrapper object may also contain an invalid/uninitialized page pointer. The enclosed data can be casted to either a LeafNode object or an InnerNode object. The corresponding cast direction is checked against the page's level number..
Definition at line 790 of file stx-cbtreedb.h.
stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage::BTreePage | ( | ) | [inline] |
Default Constructor: create new invalid page buffer.
Definition at line 811 of file stx-cbtreedb.h.
stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage::BTreePage | ( | const BTreePage & | btp | ) | [inline] |
Copy Constructor: increment reference counter on buffer.
Definition at line 817 of file stx-cbtreedb.h.
stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage::~BTreePage | ( | ) | [inline] |
Destructor: decrement reference counter on buffer and possibly deallocate it.
Definition at line 826 of file stx-cbtreedb.h.
void stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage::Create | ( | ) | [inline] |
Release enclosed page and initialize a new page buffer.
Definition at line 856 of file stx-cbtreedb.h.
InnerNode* stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage::GetAsInnerNode | ( | ) | const [inline] |
Return buffer casted as an inner node.
Definition at line 886 of file stx-cbtreedb.h.
LeafNode* stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage::GetAsLeafNode | ( | ) | const [inline] |
Return buffer casted as a leaf node.
Definition at line 893 of file stx-cbtreedb.h.
char* stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage::GetBuffer | ( | ) | [inline] |
Accessor: return enclosed buffer pointer.
Definition at line 866 of file stx-cbtreedb.h.
uint16_t stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage::GetLevel | ( | ) | const [inline] |
Return the enclosed node's level in the tree.
Definition at line 873 of file stx-cbtreedb.h.
bool stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage::IsLeafNode | ( | ) | const [inline] |
Returns true if the buffer contains a leaf node.
Definition at line 880 of file stx-cbtreedb.h.
bool stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage::IsValid | ( | ) | const [inline] |
Determine whether the wrapper object contains valid page.
Definition at line 850 of file stx-cbtreedb.h.
BTreePage& stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage::operator= | ( | const BTreePage & | btp | ) | [inline] |
Assignment Operator: increment reference counter on buffer.
Definition at line 833 of file stx-cbtreedb.h.
struct Impl* stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage::m_impl [protected] |
pointer to reference-counted data buffer object.
Definition at line 807 of file stx-cbtreedb.h.