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
44 template <
unsigned Bytes>
64 template <
typename Type,
unsigned Size>
130 template <
typename Type,
unsigned Size,
unsigned RawSize,
unsigned NB
ids = 0>
154 template <
typename Type,
unsigned Size,
unsigned RawSize>
171 template <
typename Type,
unsigned RawSize,
unsigned NB
ids,
typename MetaInfoType =
void>
173 public block_w_bids<Type, ((RawSize - sizeof(BID<RawSize>)* NBids - sizeof(MetaInfoType)) / sizeof(Type)), RawSize, NBids>
185 template <
typename Type,
unsigned RawSize,
unsigned NB
ids>
187 public block_w_bids<Type, ((RawSize - sizeof(BID<RawSize>)* NBids) / sizeof(Type)), RawSize, NBids>
196 template <
typename BaseType,
unsigned FillSize = 0>
207 template <
typename BaseType>
216 template <
typename Type,
unsigned RawSize>
237 template <
unsigned RawSize,
typename Type,
unsigned NRef = 0,
typename MetaInfoType =
void>
274 STXXL_MSG(
"[" << (
void*)
this <<
"] typed_block is copy constructed from [" << (
void*)&tb <<
"]");
303 static void*
operator new (
size_t bytes)
306 STXXL_VERBOSE1(
"typed::block operator new[]: bytes=" <<
bytes <<
", meta_info_size=" << meta_info_size);
308 void* result = aligned_alloc<BLOCK_ALIGN>(
bytes - meta_info_size, meta_info_size);
309 #if STXXL_WITH_VALGRIND || STXXL_TYPED_BLOCK_INITIALIZE_ZERO
310 memset(result, 0,
bytes);
315 static void*
operator new[] (
size_t bytes)
318 STXXL_VERBOSE1(
"typed::block operator new[]: bytes=" <<
bytes <<
", meta_info_size=" << meta_info_size);
320 void* result = aligned_alloc<BLOCK_ALIGN>(
bytes - meta_info_size, meta_info_size);
321 #if STXXL_WITH_VALGRIND || STXXL_TYPED_BLOCK_INITIALIZE_ZERO
322 memset(result, 0,
bytes);
327 static void*
operator new (
size_t ,
void* ptr)
332 static void operator delete (
void* ptr)
334 aligned_dealloc<BLOCK_ALIGN>(ptr);
337 static void operator delete[] (
void* ptr)
339 aligned_dealloc<BLOCK_ALIGN>(ptr);
342 static void operator delete (
void*,
void*)
366 #endif // !STXXL_MNG_TYPED_BLOCK_HEADER
Contains per block filler for stxxl::typed_block , not intended for direct use.
Default completion handler class.
const_iterator begin() const
Returns const_iterator pointing to the first element.
MetaInfoType info_type
Type of per block information element.
static const int bytes
number of bytes in uint_pair
Contains per block information for stxxl::typed_block , not intended for direct use.
Completion handler class (Loki-style).
const value_type & const_reference
virtual request_ptr awrite(void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl)=0
Schedules an asynchronous write request to the file.
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.
virtual request_ptr aread(void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl)=0
Schedules an asynchronous read request to the file.
request_ptr read(const bid_type &bid, completion_handler on_cmpl=default_completion_handler())
Reads block from the disk(s).
mng_local::expand_struct< mng_local::block_w_info< Type, RawSize, NRef, MetaInfoType >, RawSize > Base
Block containing elements of fixed length.
file * storage
pointer to the file of the block
const_pointer const_iterator
#define STXXL_BEGIN_NAMESPACE
void STXXL_UNUSED(const U &)
#define STXXL_VERBOSE1(x)
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)
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
#define STXXL_VERBOSE_TYPED_BLOCK
const value_type * const_pointer
request_ptr write(const bid_type &bid, completion_handler on_cmpl=default_completion_handler())
Writes block to the disk(s).
stxxl::int64 offset
offset within the file of the block
const_iterator cbegin() const
Returns const_iterator pointing to the first element.
const type * const_iterator
#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.