Public Member Functions | Protected Member Functions

block_manager Class Reference
[Block management layer]

Block manager class. More...

#include <mng.h>

Collaboration diagram for block_manager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

template<class DiskAssignFunctor , class BIDIteratorClass >
void new_blocks (const DiskAssignFunctor &functor, BIDIteratorClass bidbegin, BIDIteratorClass bidend, unsigned_type offset=0)
 Allocates new blocks.
template<class BlockType , class DiskAssignFunctor , class BIDIteratorClass >
void new_blocks (const unsigned_type nblocks, const DiskAssignFunctor &functor, BIDIteratorClass out, unsigned_type offset=0)
template<typename DiskAssignFunctor , unsigned BLK_SIZE>
void new_block (const DiskAssignFunctor &functor, BID< BLK_SIZE > &bid, unsigned_type offset=0)
template<class BIDIteratorClass >
void delete_blocks (const BIDIteratorClass &bidbegin, const BIDIteratorClass &bidend)
 Deallocates blocks.
template<unsigned BLK_SIZE>
void delete_block (const BID< BLK_SIZE > &bid)
 Deallocates a block.
template<class BIDType , class DiskAssignFunctor , class OutputIterator >
void new_blocks_int (const unsigned_type nblocks, const DiskAssignFunctor &functor, unsigned_type offset, OutputIterator out)

Protected Member Functions

template<class BIDType , class DiskAssignFunctor , class BIDIteratorClass >
void new_blocks_int (const unsigned_type nblocks, const DiskAssignFunctor &functor, unsigned_type offset, BIDIteratorClass out)

Detailed Description

Block manager class.

Manages allocation and deallocation of blocks in multiple/single disk setting

Remarks:
is a singleton

Member Function Documentation

template<typename DiskAssignFunctor , unsigned BLK_SIZE>
void block_manager::new_block ( const DiskAssignFunctor &  functor,
BID< BLK_SIZE > &  bid,
unsigned_type  offset = 0 
) [inline]

Allocates a new block according to the strategy given by functor and stores the block identifier to bid. Allocation will be lined up with previous partial allocations of offset blocks.

Parameters:
functor object of model of allocation_strategy concept
bid BID to store the block identifier
offset advance for functor to line up partial allocations

Referenced by ksort(), queue< ValTp, BlkSz, AllocStr, SzTp >::push(), and sort().

template<class DiskAssignFunctor , class BIDIteratorClass >
void block_manager::new_blocks ( const DiskAssignFunctor &  functor,
BIDIteratorClass  bidbegin,
BIDIteratorClass  bidend,
unsigned_type  offset = 0 
) [inline]

Allocates new blocks.

Allocates new blocks according to the strategy given by functor and stores block identifiers to the range [ bidbegin, bidend) Allocation will be lined up with previous partial allocations of offset blocks.

Parameters:
functor object of model of allocation_strategy concept
bidbegin bidirectional BID iterator object
bidend bidirectional BID iterator object
offset advance for functor to line up partial allocations

Referenced by stream::runs_creator< from_sorted_sequences< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::finish(), stream::runs_creator< from_sorted_sequences< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::push(), and stream::runs_creator< use_push< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::push().

template<class BlockType , class DiskAssignFunctor , class BIDIteratorClass >
void block_manager::new_blocks ( const unsigned_type  nblocks,
const DiskAssignFunctor &  functor,
BIDIteratorClass  out,
unsigned_type  offset = 0 
) [inline]

Allocates new blocks according to the strategy given by functor and stores block identifiers to the output iterator out Allocation will be lined up with previous partial allocations of offset blocks.

Parameters:
nblocks the number of blocks to allocate
functor object of model of allocation_strategy concept
out iterator object of OutputIterator concept
offset advance for functor to line up partial allocations

The BlockType template parameter defines the type of block to allocate


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