stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage Class Reference

BTreePage is a reference-counted buffer holding one page of the B-tree index. More...

#include <stx-cbtreedb.h>

Collaboration diagram for stx::CBTreeDB< _Key, _Compare, _BTreePageSize, _AppVersionId >::BTreePage:
Collaboration graph
[legend]

List of all members.

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.
BTreePageoperator= (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.
InnerNodeGetAsInnerNode () const
 Return buffer casted as an inner node.
LeafNodeGetAsLeafNode () const
 Return buffer casted as a leaf node.

Protected Attributes

struct Implm_impl
 pointer to reference-counted data buffer object.

Detailed Description

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

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.


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 >::BTreePage::BTreePage (  )  [inline]

Default Constructor: create new invalid page buffer.

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

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
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.

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
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.


Member Function Documentation

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
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.

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
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.

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
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.

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 >::BTreePage::GetBuffer (  )  [inline]

Accessor: return enclosed buffer pointer.

Definition at line 866 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 >::BTreePage::GetLevel (  )  const [inline]

Return the enclosed node's level in the tree.

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

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 >::BTreePage::IsLeafNode (  )  const [inline]

Returns true if the buffer contains a leaf node.

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

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 >::BTreePage::IsValid (  )  const [inline]

Determine whether the wrapper object contains valid page.

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

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
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.


Member Data Documentation

template<typename _Key = uint32_t, typename _Compare = std::less<_Key>, unsigned int _BTreePageSize = 1024, uint32_t _AppVersionId = 0>
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.


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