18 #ifndef STXXL_MNG_TYPED_BLOCK_HEADER
19 #define STXXL_MNG_TYPED_BLOCK_HEADER
26 #ifndef STXXL_VERBOSE_TYPED_BLOCK
27 #define STXXL_VERBOSE_TYPED_BLOCK STXXL_VERBOSE2
43 template <
unsigned Bytes>
63 template <
typename Type,
unsigned Size>
129 template <
typename Type,
unsigned Size,
unsigned RawSize,
unsigned NB
ids = 0>
153 template <
typename Type,
unsigned Size,
unsigned RawSize>
170 template <
typename Type,
unsigned RawSize,
unsigned NB
ids,
typename MetaInfoType =
void>
172 :
public block_w_bids<Type, ((RawSize - sizeof(BID<RawSize>)* NBids - sizeof(MetaInfoType)) / sizeof(Type)), RawSize, NBids>
184 template <
typename Type,
unsigned RawSize,
unsigned NB
ids>
186 :
public block_w_bids<Type, ((RawSize - sizeof(BID<RawSize>)* NBids) / sizeof(Type)), RawSize, NBids>
195 template <
typename BaseType,
unsigned FillSize = 0>
206 template <
typename BaseType>
215 template <
typename Type,
unsigned RawSize>
236 template <
unsigned RawSize,
typename Type,
unsigned NRef = 0,
typename MetaInfoType =
void>
273 STXXL_MSG(
"[" << (
void*)
this <<
"] typed_block is copy constructed from [" << (
void*)&tb <<
"]");
302 static void*
operator new (
size_t bytes)
307 void* result = aligned_alloc<STXXL_BLOCK_ALIGN>(
308 bytes - meta_info_size, meta_info_size);
310 #if STXXL_WITH_VALGRIND || STXXL_TYPED_BLOCK_INITIALIZE_ZERO
311 memset(result, 0,
bytes);
316 static void*
operator new[] (
size_t bytes)
321 void* result = aligned_alloc<STXXL_BLOCK_ALIGN>(
322 bytes - meta_info_size, meta_info_size);
324 #if STXXL_WITH_VALGRIND || STXXL_TYPED_BLOCK_INITIALIZE_ZERO
325 memset(result, 0,
bytes);
330 static void*
operator new (
size_t ,
void* ptr)
335 static void operator delete (
void* ptr)
337 aligned_dealloc<STXXL_BLOCK_ALIGN>(ptr);
340 static void operator delete[] (
void* ptr)
342 aligned_dealloc<STXXL_BLOCK_ALIGN>(ptr);
345 static void operator delete (
void*,
void*)
369 #endif // !STXXL_MNG_TYPED_BLOCK_HEADER
Contains per block filler for stxxl::typed_block , not intended for direct use.
const_iterator begin() const
Returns const_iterator pointing to the first element.
MetaInfoType info_type
Type of per block information element.
Contains per block information for stxxl::typed_block , not intended for direct use.
Completion handler class (Loki-style).
const value_type & const_reference
info_type info
Per block information element.
const_iterator end() const
Returns const_iterator pointing to the end element.
#define STXXL_VERBOSE_BLOCK_LIFE_CYCLE
const_iterator cend() const
Returns const_iterator pointing to the end element.
#define STXXL_BLOCK_ALIGN
mng_local::expand_struct< mng_local::block_w_info< Type, RawSize, NRef, MetaInfoType >, RawSize > Base
Block containing elements of fixed length.
const_pointer const_iterator
#define STXXL_BEGIN_NAMESPACE
void STXXL_UNUSED(const U &)
iterator begin()
Returns iterator pointing to the first element.
const Type & const_reference
iterator end()
Returns iterator pointing to the end element.
#define STXXL_STATIC_ASSERT(x)
virtual request_ptr aread(void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl=completion_handler())=0
Schedules an asynchronous read request to the file.
filler_struct< FillSize > filler
Per block filler element.
Helper to compute the size of the filler , not intended for direct use.
choose_int_types< my_pointer_size >::unsigned_type unsigned_type
static const size_t bytes
number of bytes in uint_pair
#define STXXL_VERBOSE_TYPED_BLOCK
file * storage
pointer to the file of the block
const value_type * const_pointer
const_iterator cbegin() const
Returns const_iterator pointing to the first element.
const type * const_iterator
stxxl::int64 offset
offset within the file of the block
request_ptr write(const bid_type &bid, completion_handler on_cmpl=completion_handler())
Writes block to the disk(s).
virtual request_ptr awrite(void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl=completion_handler())=0
Schedules an asynchronous write request to the file.
request_ptr read(const bid_type &bid, completion_handler on_cmpl=completion_handler())
Reads block from the disk(s).
#define STXXL_END_NAMESPACE
Contains BID references for stxxl::typed_block , not intended for direct use.
Contains data elements for stxxl::typed_block , not intended for direct use.