Fairport  v1.0.38
fairport::extended_block Class Reference

A data block which refers to other data blocks, in order to extend the physical size limit (8k) to a larger logical size. More...

#include <node.h>

+ Inheritance diagram for fairport::extended_block:
+ Collaboration diagram for fairport::extended_block:

List of all members.

Public Member Functions

 extended_block (const shared_db_ptr &db, const block_info &info, ushort level, size_t total_size, size_t child_max_total_size, ulong page_max_count, ulong child_page_max_count, std::vector< block_id > bi)
 Construct an extended_block from disk.
size_t read_raw (byte *pdest_buffer, size_t size, ulong offset) const
 Read data from this block.
uint get_page_count () const
 Get the number of physical pages in this data_block.
std::tr1::shared_ptr
< external_block
get_page (uint page_num) const
 Get a specific page of this data_block.
ushort get_level () const
 Get the "level" of this extended_block.
bool is_internal () const
 Returns the blocks internal/external state.

Detailed Description

A data block which refers to other data blocks, in order to extend the physical size limit (8k) to a larger logical size.

An extended_block is essentially a list of block_ids of other data_block, which themselves may be an extended_block or an external_block. Ultimately they form a "data tree", the leafs of which form the "logical" contents of the block.

This class is an in memory representation of the disk::extended_block structure.

See also:
[MS-PST] 2.2.2.8.3.2

Definition at line 553 of file node.h.


Constructor & Destructor Documentation

fairport::extended_block::extended_block ( const shared_db_ptr db,
const block_info info,
ushort  level,
size_t  total_size,
size_t  child_max_total_size,
ulong  page_max_count,
ulong  child_page_max_count,
std::vector< block_id bi 
) [inline]

Construct an extended_block from disk.

Parameters:
[in]dbThe database context
[in]infoInformation about this block
[in]levelThe level of this extended block (1 or 2)
[in]total_sizeThe total logical size of this block
[in]child_max_total_sizeThe maximum logical size of a child block
[in]page_max_countThe maximum number of external blocks that can be contained in this block
[in]child_page_max_countThe maximum number of external blocks that can be contained in a child block
[in]biThe block_info for all child blocks

Definition at line 568 of file node.h.


Member Function Documentation

ushort fairport::extended_block::get_level ( ) const [inline]

Get the "level" of this extended_block.

A level 1 extended_block (or "xblock") points to external blocks. A level 2 extended_block (or "xxblock") points to other extended_blocks

Returns:
1 for an xblock, 2 for an xxblock

Definition at line 585 of file node.h.

std::tr1::shared_ptr< fairport::external_block > fairport::extended_block::get_page ( uint  page_num) const [inline, virtual]

Get a specific page of this data_block.

Note:
In this context, "page" refers to an external_block
Exceptions:
out_of_rangeIf page_num >= get_page_count()
Parameters:
[in]page_numThe ordinal of the external_block to get, zero based
Returns:
The requested external_block

Implements fairport::data_block.

Definition at line 947 of file node.h.

fairport::uint fairport::extended_block::get_page_count ( ) const [inline, virtual]

Get the number of physical pages in this data_block.

Note:
In this context, "page" refers to an external_block
Returns:
The total number of external_blocks under this data_block

Implements fairport::data_block.

Definition at line 924 of file node.h.

bool fairport::extended_block::is_internal ( ) const [inline, virtual]

Returns the blocks internal/external state.

Returns:
true if this is an internal block, false otherwise

Implements fairport::block.

Definition at line 586 of file node.h.

size_t fairport::extended_block::read_raw ( byte pdest_buffer,
size_t  size,
ulong  offset 
) const [inline, virtual]

Read data from this block.

Parameters:
[out]pdest_bufferThe location to read the data into
[in]sizeThe amount of data to read
[in]offsetThe location to read from
Returns:
The amount of data read

Implements fairport::data_block.

Definition at line 975 of file node.h.


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