STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::typed_block< RawSize, Type, NRef, MetaInfoType > Class Template Reference

Detailed Description

template<unsigned RawSize, typename Type, unsigned NRef = 0, typename MetaInfoType = void>
class stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >

Block containing elements of fixed length.

Template Parameters
RawSizesize of block in bytes
Typetype of block's records
NRefnumber of block references (BIDs) that can be stored in the block (default is 0)
MetaInfoTypetype of per block information (default is no information - void)

The data array of type Type 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)

Definition at line 237 of file typed_block.h.

+ Inheritance diagram for stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >:
+ Collaboration diagram for stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >:

Public Types

typedef BID< raw_sizebid_type
 
typedef const_pointer const_iterator
 
typedef const value_typeconst_pointer
 
typedef const value_typeconst_reference
 
enum  constants { raw_size = RawSize, size = Base::size, has_only_data = (raw_size == (size * sizeof(value_type))) }
 
typedef pointer iterator
 
typedef value_typepointer
 
typedef value_typereference
 
typedef Type value_type
 
- Public Types inherited from stxxl::mng_local::block_w_info< Type, RawSize, NRef, MetaInfoType >
typedef MetaInfoType info_type
 Type of per block information element. More...
 
- Public Types inherited from stxxl::mng_local::block_w_bids< Type,((RawSize-sizeof(BID< RawSize >)*NBids-sizeof(MetaInfoType))/sizeof(Type)), RawSize, NBids >
enum  
 
typedef BID< raw_sizebid_type
 
- Public Types inherited from stxxl::mng_local::element_block< Type, Size >
enum  { size = Size }
 
typedef const typeconst_iterator
 
typedef const Type & const_reference
 
typedef pointer iterator
 
typedef typepointer
 
typedef Type & reference
 
typedef Type type
 
typedef Type value_type
 

Public Member Functions

 typed_block ()
 
 ~typed_block ()
 
request_ptr read (const bid_type &bid, completion_handler on_cmpl=completion_handler())
 Reads block from the disk(s). More...
 
request_ptr write (const bid_type &bid, completion_handler on_cmpl=completion_handler())
 Writes block to the disk(s). More...
 
- Public Member Functions inherited from stxxl::mng_local::add_filler< mng_local::block_w_info< Type, RawSize, NRef, MetaInfoType >, RawSize-sizeof(mng_local::block_w_info< Type, RawSize, NRef, MetaInfoType >)>
 add_filler ()
 
- Public Member Functions inherited from stxxl::mng_local::block_w_info< Type, RawSize, NRef, MetaInfoType >
 block_w_info ()
 
- Public Member Functions inherited from stxxl::mng_local::block_w_bids< Type,((RawSize-sizeof(BID< RawSize >)*NBids-sizeof(MetaInfoType))/sizeof(Type)), RawSize, NBids >
 block_w_bids ()
 
bid_typeoperator() (size_t i)
 An operator to access bid references. More...
 
- Public Member Functions inherited from stxxl::mng_local::element_block< Type, Size >
 element_block ()
 
iterator begin ()
 Returns iterator pointing to the first element. More...
 
const_iterator begin () const
 Returns const_iterator pointing to the first element. More...
 
const_iterator cbegin () const
 Returns const_iterator pointing to the first element. More...
 
const_iterator cend () const
 Returns const_iterator pointing to the end element. More...
 
iterator end ()
 Returns iterator pointing to the end element. More...
 
const_iterator end () const
 Returns const_iterator pointing to the end element. More...
 
reference operator[] (size_t i)
 An operator to access elements in the block. More...
 

Static Public Member Functions

static void operator delete (void *ptr)
 
static void operator delete (void *, void *)
 
static void operator delete[] (void *ptr)
 
static void * operator new (size_t bytes)
 
static void * operator new (size_t, void *ptr)
 
static void * operator new[] (size_t bytes)
 

Private Types

typedef
mng_local::expand_struct
< mng_local::block_w_info
< Type, RawSize, NRef,
MetaInfoType >, RawSize > 
Base
 

Additional Inherited Members

- Public Attributes inherited from stxxl::mng_local::block_w_info< Type, RawSize, NRef, MetaInfoType >
info_type info
 Per block information element. More...
 
- Public Attributes inherited from stxxl::mng_local::block_w_bids< Type,((RawSize-sizeof(BID< RawSize >)*NBids-sizeof(MetaInfoType))/sizeof(Type)), RawSize, NBids >
bid_type ref [nbids]
 Array of BID references. More...
 
- Public Attributes inherited from stxxl::mng_local::element_block< Type, Size >
value_type elem [size]
 Array of elements of type Type. More...
 

Member Typedef Documentation

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
typedef mng_local::expand_struct<mng_local::block_w_info<Type, RawSize, NRef, MetaInfoType>, RawSize> stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::Base
private

Definition at line 240 of file typed_block.h.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
typedef BID<raw_size> stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::bid_type

Definition at line 258 of file typed_block.h.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
typedef const_pointer stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::const_iterator

Definition at line 249 of file typed_block.h.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
typedef const value_type* stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::const_pointer

Definition at line 248 of file typed_block.h.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
typedef const value_type& stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::const_reference

Definition at line 245 of file typed_block.h.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
typedef pointer stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::iterator

Definition at line 247 of file typed_block.h.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
typedef value_type* stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::pointer

Definition at line 246 of file typed_block.h.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
typedef value_type& stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::reference

Definition at line 244 of file typed_block.h.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
typedef Type stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::value_type

Definition at line 243 of file typed_block.h.

Member Enumeration Documentation

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = 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 251 of file typed_block.h.

Constructor & Destructor Documentation

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::typed_block ( )
inline

Definition at line 260 of file typed_block.h.

References STXXL_BLOCK_ALIGN, STXXL_STATIC_ASSERT, and STXXL_VERBOSE_TYPED_BLOCK.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::~typed_block ( )
inline

Definition at line 358 of file typed_block.h.

References STXXL_VERBOSE_TYPED_BLOCK.

Member Function Documentation

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
static void stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::operator delete ( void *  ptr)
inlinestatic

Definition at line 335 of file typed_block.h.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
static void stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::operator delete ( void *  ,
void *   
)
inlinestatic

Definition at line 345 of file typed_block.h.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
static void stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::operator delete[] ( void *  ptr)
inlinestatic

Definition at line 340 of file typed_block.h.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
static void* stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::operator new ( size_t  bytes)
inlinestatic

Definition at line 302 of file typed_block.h.

References bytes, and STXXL_VERBOSE_TYPED_BLOCK.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
static void* stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::operator new ( size_t  ,
void *  ptr 
)
inlinestatic

Definition at line 330 of file typed_block.h.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
static void* stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::operator new[] ( size_t  bytes)
inlinestatic

Definition at line 316 of file typed_block.h.

References bytes, and STXXL_VERBOSE_TYPED_BLOCK.

template<unsigned RawSize, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
request_ptr stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::read ( const bid_type bid,
completion_handler  on_cmpl = 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 295 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, typename Type , unsigned NRef = 0, typename MetaInfoType = void>
request_ptr stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::write ( const bid_type bid,
completion_handler  on_cmpl = 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 283 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: