Fairport
v1.0.38
|
Contains actual data. More...
#include <node.h>
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. |
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.
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.
[in] | db | The database context |
[in] | info | Information about this block |
[in] | max_size | The maximum possible size of this block |
[in] | buffer | The actual external data (decoded) |
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.
out_of_range | If page_num >= get_page_count() |
[in] | page_num | The ordinal of the external_block to get, zero based |
Implements fairport::data_block.
uint fairport::external_block::get_page_count | ( | ) | const [inline, virtual] |
Get the number of physical pages in this data_block.
Implements fairport::data_block.
bool fairport::external_block::is_internal | ( | ) | const [inline, virtual] |
Returns the blocks internal/external state.
Implements fairport::block.
size_t fairport::external_block::read_raw | ( | byte * | pdest_buffer, |
size_t | size, | ||
ulong | offset | ||
) | const [inline, virtual] |
Read data from this block.
[out] | pdest_buffer | The location to read the data into |
[in] | size | The amount of data to read |
[in] | offset | The location to read from |
Implements fairport::data_block.