Fairport  v1.0.38
fairport::external_block Class Reference

Contains actual data. More...

#include <node.h>

+ Inheritance diagram for fairport::external_block:
+ Collaboration diagram for fairport::external_block:

List of all members.

Public Member Functions

 external_block (const shared_db_ptr &db, const block_info &info, size_t max_size, std::vector< byte > buffer)
 Construct an external_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.
bool is_internal () const
 Returns the blocks internal/external state.

Detailed Description

Contains actual data.

An external_block contains the actual data contents used by the higher layers. This data is also "encrypted", although the encryption/decryption process occurs immediately before/after going to disk, not here.

See also:
[MS-PST] 2.2.2.8.3.1

Definition at line 611 of file node.h.


Constructor & Destructor Documentation

fairport::external_block::external_block ( const shared_db_ptr db,
const block_info info,
size_t  max_size,
std::vector< byte buffer 
) [inline]

Construct an external_block from disk.

Parameters:
[in]dbThe database context
[in]infoInformation about this block
[in]max_sizeThe maximum possible size of this block
[in]bufferThe actual external data (decoded)

Definition at line 622 of file node.h.


Member Function Documentation

std::tr1::shared_ptr< fairport::external_block > fairport::external_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 953 of file node.h.

uint fairport::external_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 631 of file node.h.

bool fairport::external_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 634 of file node.h.

size_t fairport::external_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 961 of file node.h.


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