Stxxl  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Private Types
stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ > Class Template Reference

Block containing elements of fixed length. More...

#include <typed_block.h>

Inheritance diagram for stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >:
Inheritance graph
[legend]
Collaboration diagram for stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >:
Collaboration graph
[legend]

List of all members.

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_typereference
typedef const value_typeconst_reference
typedef value_typepointer
typedef pointer iterator
typedef const value_typeconst_pointer
typedef const_pointer const_iterator
typedef BID< raw_sizebid_type

Public Member Functions

 typed_block ()
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) !
 ~typed_block ()

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 *)

Private Types

typedef expand_struct
< block_w_info< T_, RawSize_,
NRef_, InfoType_ >, RawSize_ > 
Base

Detailed Description

template<unsigned RawSize_, class T_, unsigned NRef_ = 0, class InfoType_ = void>
class stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >

Block containing elements of fixed length.

Template Parameters:
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.

Warning:
If 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)
Examples:
mng/test_buf_streams.cpp, mng/test_mng.cpp, mng/test_pool_pair.cpp, mng/test_prefetch_pool.cpp, mng/test_read_write_pool.cpp, and mng/test_write_pool.cpp.

Definition at line 223 of file typed_block.h.


Member Typedef Documentation

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
typedef expand_struct<block_w_info<T_, RawSize_, NRef_, InfoType_>, RawSize_> stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::Base [private]

Definition at line 226 of file typed_block.h.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
typedef BID<raw_size> stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::bid_type
template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
typedef const_pointer stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::const_iterator

Reimplemented from stxxl::element_block< T_, Size_ >.

Definition at line 235 of file typed_block.h.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
typedef const value_type* stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::const_pointer

Definition at line 234 of file typed_block.h.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
typedef const value_type& stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::const_reference

Reimplemented from stxxl::element_block< T_, Size_ >.

Definition at line 231 of file typed_block.h.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
typedef pointer stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::iterator

Reimplemented from stxxl::element_block< T_, Size_ >.

Definition at line 233 of file typed_block.h.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
typedef value_type* stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::pointer

Reimplemented from stxxl::element_block< T_, Size_ >.

Definition at line 232 of file typed_block.h.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
typedef value_type& stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::reference

Reimplemented from stxxl::element_block< T_, Size_ >.

Definition at line 230 of file typed_block.h.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
typedef T_ stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::value_type

Reimplemented from stxxl::element_block< T_, Size_ >.

Definition at line 229 of file typed_block.h.


Member Enumeration Documentation

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
enum stxxl::typed_block::constants
Enumerator:
raw_size 

size of block in bytes

size 

number of elements in block

has_only_data 

no meta info, bids or (non-empty) fillers included in the block, allows value_type array addressing across block boundaries

Definition at line 237 of file typed_block.h.


Constructor & Destructor Documentation

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::typed_block ( ) [inline]

Definition at line 246 of file typed_block.h.

References BLOCK_ALIGN, STXXL_STATIC_ASSERT, and STXXL_VERBOSE_TYPED_BLOCK.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::~typed_block ( ) [inline]

Definition at line 352 of file typed_block.h.

References STXXL_VERBOSE_TYPED_BLOCK.


Member Function Documentation

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
static void stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::operator delete ( void *  ptr) [inline, static]

Definition at line 329 of file typed_block.h.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
static void stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::operator delete ( void *  ,
void *   
) [inline, static]

Definition at line 339 of file typed_block.h.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
static void stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::operator delete[] ( void *  ptr) [inline, static]

Definition at line 334 of file typed_block.h.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
static void* stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::operator new ( size_t  bytes) [inline, static]

Definition at line 288 of file typed_block.h.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
static void* stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::operator new ( size_t  ,
void *  ptr 
) [inline, static]

Definition at line 324 of file typed_block.h.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
static void* stxxl::typed_block< RawSize_, T_, NRef_, InfoType_ >::operator new[] ( size_t  bytes) [inline, static]

Definition at line 306 of file typed_block.h.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
request_ptr stxxl::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) !

Parameters:
bidblock identifier, points the file(disk) and position !
on_cmplcompletion handler !
Returns:
pointer_ptr object to track status I/O operation after the call

Definition at line 281 of file typed_block.h.

References stxxl::file::aread(), FMT_BID, stxxl::BID< SIZE >::offset, stxxl::BID< SIZE >::storage, and STXXL_VERBOSE_BLOCK_LIFE_CYCLE.

template<unsigned RawSize_, class T_ , unsigned NRef_ = 0, class InfoType_ = void>
request_ptr stxxl::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) !

Parameters:
bidblock identifier, points the file(disk) and position !
on_cmplcompletion handler !
Returns:
pointer_ptr object to track status I/O operation after the call

Definition at line 269 of file typed_block.h.

References stxxl::file::awrite(), FMT_BID, stxxl::BID< SIZE >::offset, stxxl::BID< SIZE >::storage, and STXXL_VERBOSE_BLOCK_LIFE_CYCLE.

Referenced by stxxl::stream::basic_runs_creator< Input_, CompareType_, BlockSize_, AllocStr_ >::compute_result().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines