Forms sorted runs of elements passed in push() method. More...
#include <sort_stream.h>
Inherits noncopyable.
Public Types | |
typedef Cmp_ | cmp_type |
typedef ValueType_ | value_type |
typedef typed_block < BlockSize_, value_type > | block_type |
typedef sort_helper::trigger_entry < block_type > | trigger_entry_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. | |
void | push (const value_type &val) |
Adds new element to the sorter. | |
const sorted_runs_type & | result () |
Returns the sorted runs object. |
Forms sorted runs of elements passed in push() method.
A specialization of runs_creator
that allows to create sorted runs data structure usable for runs_merger
from elements passed in sorted push() method.
ValueType_ | type of values (parameter for use_push 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 |
stream::runs_creator< use_push< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::runs_creator | ( | Cmp_ | c, | |
unsigned_type | memory_to_use | |||
) | [inline] |
Creates the object.
c | comparator object | |
memory_to_use | memory amount that is allowed to used by the sorter in bytes |
void stream::runs_creator< use_push< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::push | ( | const value_type & | val | ) | [inline] |
Adds new element to the sorter.
val | value to be added |
References element_block< T, Size_ >::begin(), element_block< T, Size_ >::end(), and block_manager::new_blocks().
const sorted_runs_type& stream::runs_creator< use_push< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::result | ( | ) | [inline] |
Returns the sorted runs object.
runs_merger
object as input