Stxxl  1.3.2
Public Member Functions | Protected Member Functions | List of all members
block_manager Class Reference

Block manager class. More...

#include <mng.h>

Inherits singleton< block_manager >.

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. More...
 
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. More...
 
template<unsigned BLK_SIZE>
void delete_block (const BID< BLK_SIZE > &bid)
 Deallocates a block. More...
 
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
functorobject of model of allocation_strategy concept
bidBID to store the block identifier
offsetadvance 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
functorobject of model of allocation_strategy concept
bidbeginbidirectional BID iterator object
bidendbidirectional BID iterator object
offsetadvance for functor to line up partial allocations

Referenced by stream::runs_creator< from_sorted_sequences< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::finish(), stream::runs_creator< use_push< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::push(), and stream::runs_creator< from_sorted_sequences< 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
nblocksthe number of blocks to allocate
functorobject of model of allocation_strategy concept
outiterator object of OutputIterator concept
offsetadvance 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: