Stxxl  1.3.1
Public Types | Public Member Functions | Protected Attributes | List of all members
stream::basic_runs_creator< Input_, Cmp_, BlockSize_, AllocStr_ > Class Template Reference

Forms sorted runs of data from a stream. More...

#include <sort_stream.h>

Inheritance diagram for stream::basic_runs_creator< Input_, Cmp_, BlockSize_, AllocStr_ >:
Inheritance graph
[legend]

Public Types

typedef Cmp_ cmp_type
 
typedef Input_::value_type value_type
 
typedef typed_block< BlockSize_, value_type > block_type
 
typedef sort_helper::trigger_entry< block_typetrigger_entry_type
 
typedef sorted_runs< trigger_entry_type > sorted_runs_type
 

Public Member Functions

 basic_runs_creator (Input_ &i, Cmp_ c, unsigned_type memory_to_use)
 Create the object. More...
 
const sorted_runs_typeresult ()
 Returns the sorted runs object. More...
 

Protected Attributes

Input_ & input
 
Cmp_ cmp
 

Detailed Description

template<class Input_, class Cmp_, unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY>
class stream::basic_runs_creator< Input_, Cmp_, BlockSize_, AllocStr_ >

Forms sorted runs of data from a stream.

Template Parameters
Input_type of the input stream
Cmp_type of comparison object used for sorting the runs
BlockSize_size of blocks used to store the runs (in bytes)
AllocStr_functor that defines allocation strategy for the runs

Constructor & Destructor Documentation

template<class Input_ , class Cmp_ , unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY>
stream::basic_runs_creator< Input_, Cmp_, BlockSize_, AllocStr_ >::basic_runs_creator ( Input_ &  i,
Cmp_  c,
unsigned_type  memory_to_use 
)
inline

Create the object.

Parameters
iinput stream
ccomparator object
memory_to_usememory amount that is allowed to used by the sorter in bytes

Member Function Documentation

template<class Input_ , class Cmp_ , unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY>
const sorted_runs_type& stream::basic_runs_creator< Input_, Cmp_, BlockSize_, AllocStr_ >::result ( )
inline

Returns the sorted runs object.

Returns
Sorted runs object. The result is computed lazily, i.e. on the first call
Remarks
Returned object is intended to be used by runs_merger object as input

References element_block< T, Size_ >::begin(), block_manager::delete_blocks(), block_manager::new_blocks(), typed_block< RawSize_, T_, NRef_, InfoType_ >::size, sort(), request_interface::wait(), wait_all(), and typed_block< RawSize_, T_, NRef_, InfoType_ >::write().


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