Fairport  v1.0.38
fairport::page Class Reference

Generic base class for all page typesA page which forms a node in the NBT or BBT. More...

#include <page.h>

+ Inheritance diagram for fairport::page:
+ Collaboration diagram for fairport::page:

List of all members.

Public Member Functions

 page (const shared_db_ptr &db, const page_info &pi)
 Construct a page from disk.
page_id get_page_id () const
 Get the page id.
ulonglong get_address () const
 Get the physical address of this page.

Protected Member Functions

shared_db_ptr get_db_ptr () const

Protected Attributes

weak_db_ptr m_db
 The database context we're a member of.
page_id m_pid
 Page id.
ulonglong m_address
 Address of this page.

Detailed Description

Generic base class for all page typesA page which forms a node in the NBT or BBT.

This class provides an abstraction around the page trailer located at the end of every page. The actual page content is interpretted by the child classes of page.

All pages in the pages hierarchy are also in the category of what is known as dependant objects. This means is they only keep a weak reference to the database context to which they're a member. Contrast this to an independant object such as the heap, which keeps a strong ref or a full shared_ptr to the related context. This implies that someone must externally make sure the database context outlives it's pages - this is usually done by the database context itself.

See also:
[MS-PST] 2.2.2.7 The NBT and BBT form the core of the internals of the PST, and need to be well understood if working at the NDB Layer. The bt_page class forms the nodes of both the NBT and BBT, with child classes for leaf and nonleaf pages.

This hierarchy also models the btree_node structure, inheriting the actual iteration and lookup logic.

Template Parameters:
Kkey type
Vvalue type
See also:
[MS-PST] 1.3.1.1
[MS-PST] 2.2.2.7.7

Definition at line 51 of file page.h.


Constructor & Destructor Documentation

fairport::page::page ( const shared_db_ptr db,
const page_info pi 
) [inline]

Construct a page from disk.

Parameters:
[in]dbThe database context
[in]piInformation about this page

Definition at line 57 of file page.h.


Member Function Documentation

ulonglong fairport::page::get_address ( ) const [inline]

Get the physical address of this page.

Returns:
The address of this page, or 0 for a new page

Definition at line 66 of file page.h.

shared_db_ptr fairport::page::get_db_ptr ( ) const [inline, protected]

Definition at line 69 of file page.h.

page_id fairport::page::get_page_id ( ) const [inline]

Get the page id.

Returns:
The page id

Definition at line 62 of file page.h.


Member Data Documentation

Address of this page.

Definition at line 72 of file page.h.

The database context we're a member of.

Definition at line 70 of file page.h.

Page id.

Definition at line 71 of file page.h.


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