STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::matrix_swappable_block< ValueType, BlockSideLength > Class Template Reference

Detailed Description

template<typename ValueType, unsigned BlockSideLength>
class stxxl::matrix_swappable_block< ValueType, BlockSideLength >

Specialized swappable_block that interprets uninitialized as containing zeros.

Template Parameters
ValueTypetype of contained objects (POD with no references to internal memory)
BlockSideLengthside length of a matrix block

When initializing, all values are set to zero.

Definition at line 206 of file matrix.h.

+ Inheritance diagram for stxxl::matrix_swappable_block< ValueType, BlockSideLength >:
+ Collaboration diagram for stxxl::matrix_swappable_block< ValueType, BlockSideLength >:

Public Types

typedef swappable_block
< ValueType, BlockSideLength
*BlockSideLength >
::internal_block_type 
internal_block_type
 
- Public Types inherited from stxxl::swappable_block< ValueType, BlockSideLength *BlockSideLength >
typedef
internal_block_type::bid_type 
external_block_type
 
typedef typed_block
< raw_block_size, ValueType > 
internal_block_type
 

Public Member Functions

void fill_default ()
 
- Public Member Functions inherited from stxxl::swappable_block< ValueType, BlockSideLength *BlockSideLength >
 swappable_block ()
 Create in uninitialized state. More...
 
 ~swappable_block ()
 
internal_block_typeacquire ()
 Acquire the block, i.e. add a reference. Has to be internal. More...
 
void attach_internal_block (internal_block_type *iblock)
 Attach an internal_block, making the block internal. Has to be not internal. More...
 
request_ptr clean_async (completion_handler on_cmpl=completion_handler())
 Write asyncronusly from internal_block to external_block if necessary. More...
 
void clean_sync ()
 Write synchronously from internal_block to external_block if necessary. More...
 
internal_block_typedeinitialize ()
 Bring the block in uninitialized state, freeing external and internal memory. Returns a pointer to the internal_block, NULL if it had none. More...
 
internal_block_typedetach_internal_block ()
 Detach the internal_block. Writes to external_block if necessary. Has to be evictable. More...
 
external_block_type extract_external_block ()
 Extract the swappable_blocks data in an external_block. The block gets uninitialized. More...
 
void fill_default ()
 Fill block with default data, is supposed to be overwritten by subclass. Has to be internal. More...
 
const internal_block_typeget_internal_block () const
 Get a reference to the data-block. Has to be acquired. More...
 
internal_block_typeget_internal_block ()
 Get a reference to the data-block. Has to be acquired. More...
 
bool has_external_block () const
 If it has an external_block. More...
 
void initialize (external_block_type eblock)
 Set the external_block that holds the swappable_block's data. The block gets initialized with it. More...
 
bool is_acquired () const
 If it is acquired. More...
 
bool is_dirty () const
 If the external_block does not hold valid data. More...
 
bool is_evictable () const
 If it holds an internal_block but does not need it. More...
 
bool is_external () const
 If it has an external_block that holds valid data. More...
 
bool is_initialized () const
 If it has some valid data (in- or external). More...
 
bool is_internal () const
 If it has an internal_block. The internal_block implicitly holds valid data. More...
 
bool make_dirty_if (const bool make_dirty)
 Invalidate external data if true. More...
 
request_ptr read_async (completion_handler on_cmpl=completion_handler())
 Read asyncronusly from external_block to internal_block. Has to be internal and have an external_block. More...
 
void read_sync ()
 Read synchronously from external_block to internal_block. Has to be internal and have an external_block. More...
 
void release ()
 Release the block, i.e. subduct a reference. Has to be acquired. More...
 

Additional Inherited Members

- Protected Member Functions inherited from stxxl::swappable_block< ValueType, BlockSideLength *BlockSideLength >
void free_external_block ()
 
void get_external_block ()
 
- Protected Attributes inherited from stxxl::swappable_block< ValueType, BlockSideLength *BlockSideLength >
bool dirty
 
external_block_type external_data
 
internal_block_typeinternal_data
 external_data.valid if no associated space on disk More...
 
int_type reference_count
 
- Static Protected Attributes inherited from stxxl::swappable_block< ValueType, BlockSideLength *BlockSideLength >
static unsigned_type disk_allocation_offset
 
static const unsigned_type raw_block_size
 

Member Typedef Documentation

template<typename ValueType , unsigned BlockSideLength>
typedef swappable_block<ValueType, BlockSideLength* BlockSideLength>::internal_block_type stxxl::matrix_swappable_block< ValueType, BlockSideLength >::internal_block_type

Definition at line 209 of file matrix.h.

Member Function Documentation

template<typename ValueType , unsigned BlockSideLength>
void stxxl::matrix_swappable_block< ValueType, BlockSideLength >::fill_default ( )
inline

Definition at line 213 of file matrix.h.


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