Block containing elements of fixed length. More...
#include <typed_block.h>
Public Types | |
enum | constants { raw_size = RawSize_, size = Base::size, has_only_data = (raw_size == (size * sizeof(value_type))) } |
typedef T_ | value_type |
typedef value_type & | reference |
typedef const value_type & | const_reference |
typedef value_type * | pointer |
typedef pointer | iterator |
typedef const value_type * | const_pointer |
typedef const_pointer | const_iterator |
typedef BID< raw_size > | bid_type |
Public Member Functions | |
request_ptr | write (const bid_type &bid, completion_handler on_cmpl=default_completion_handler()) |
Writes block to the disk(s) ! | |
request_ptr | read (const bid_type &bid, completion_handler on_cmpl=default_completion_handler()) |
Reads block from the disk(s) ! | |
Static Public Member Functions | |
static void * | operator new (size_t bytes) |
static void * | operator new[] (size_t bytes) |
static void * | operator new (size_t, void *ptr) |
static void | operator delete (void *ptr) |
static void | operator delete[] (void *ptr) |
static void | operator delete (void *, void *) |
Block containing elements of fixed length.
RawSize_ | size of block in bytes | |
T_ | type of block's records | |
NRef_ | number of block references (BIDs) that can be stored in the block (default is 0) | |
InfoType_ | type of per block information (default is no information - void) |
The data array of type T_ is contained in the parent class stxxl::element_block
, see related information there. The BID array of references is contained in the parent class stxxl::block_w_bids
, see related information there. The "per block information" is contained in the parent class stxxl::block_w_info
, see related information there.
RawSize_
> 2MB object(s) of this type can not be allocated on the stack (as a function variable for example), because Linux POSIX library limits the stack size for the main thread to (2MB - system page size) enum typed_block::constants |
request_ptr typed_block< RawSize_, T_, NRef_, InfoType_ >::read | ( | const bid_type & | bid, | |
completion_handler | on_cmpl = default_completion_handler() | |||
) | [inline] |
Reads block from the disk(s) !
bid | block identifier, points the file(disk) and position ! | |
on_cmpl | completion handler ! |
pointer_ptr
object to track status I/O operation after the call References file::aread(), BID< SIZE >::offset, typed_block< RawSize_, T_, NRef_, InfoType_ >::raw_size, and BID< SIZE >::storage.
request_ptr typed_block< RawSize_, T_, NRef_, InfoType_ >::write | ( | const bid_type & | bid, | |
completion_handler | on_cmpl = default_completion_handler() | |||
) | [inline] |
Writes block to the disk(s) !
bid | block identifier, points the file(disk) and position ! | |
on_cmpl | completion handler ! |
pointer_ptr
object to track status I/O operation after the call References file::awrite(), BID< SIZE >::offset, typed_block< RawSize_, T_, NRef_, InfoType_ >::raw_size, and BID< SIZE >::storage.