Stxxl  1.3.2
Public Types | Public Member Functions | List of all members
stream::runs_creator< from_sorted_sequences< ValueType_ >, Cmp_, BlockSize_, AllocStr_ > Class Template Reference

Forms sorted runs of data taking elements in sorted order (element by element) More...

#include <sort_stream.h>

Inherits noncopyable.

Public Types

typedef Cmp_ cmp_type
 
typedef sorted_runs
< trigger_entry_type > 
sorted_runs_type
 
typedef sorted_runs_type result_type
 

Public Member Functions

 runs_creator (Cmp_ c, unsigned_type memory_to_use)
 Creates the object. More...
 
void push (const value_type &val)
 Adds new element to the current run. More...
 
void finish ()
 Finishes current run and begins new one. More...
 
const sorted_runs_typeresult ()
 Returns the sorted runs object. More...
 

Detailed Description

template<class ValueType_, class Cmp_, unsigned BlockSize_, class AllocStr_>
class stream::runs_creator< from_sorted_sequences< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >

Forms sorted runs of data taking elements in sorted order (element by element)

A specialization of runs_creator that allows to create sorted runs data structure usable for runs_merger from sequences of elements in sorted order.

Template Parameters
ValueType_type of values (parameter for from_sorted_sequences strategy)
Cmp_type of comparison object used for sorting the runs
BlockSize_size of blocks used to store the runs
AllocStr_functor that defines allocation strategy for the runs

Constructor & Destructor Documentation

template<class ValueType_ , class Cmp_ , unsigned BlockSize_, class AllocStr_ >
stream::runs_creator< from_sorted_sequences< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::runs_creator ( Cmp_  c,
unsigned_type  memory_to_use 
)
inline

Creates the object.

Parameters
ccomparator object
memory_to_usememory amount that is allowed to used by the sorter in bytes. Recommended value: 2 * block_size * D

Member Function Documentation

template<class ValueType_ , class Cmp_ , unsigned BlockSize_, class AllocStr_ >
void stream::runs_creator< from_sorted_sequences< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::finish ( )
inline

Finishes current run and begins new one.

References block_manager::new_blocks().

template<class ValueType_ , class Cmp_ , unsigned BlockSize_, class AllocStr_ >
void stream::runs_creator< from_sorted_sequences< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::push ( const value_type &  val)
inline

Adds new element to the current run.

Parameters
valvalue to be added to the current run

References block_manager::new_blocks().

template<class ValueType_ , class Cmp_ , unsigned BlockSize_, class AllocStr_ >
const sorted_runs_type& stream::runs_creator< from_sorted_sequences< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::result ( )
inline

Returns the sorted runs object.

Returns
Sorted runs object
Remarks
Returned object is intended to be used by runs_merger object as input

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