STXXL
1.4-dev
|
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.
ValueType | type of values (parameter for from_sorted_sequences strategy) |
CompareType | 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 |
Definition at line 722 of file sort_stream.h.
Public Types | |
typedef AllocStr | alloc_strategy_type |
typedef typed_block< BlockSize, value_type > | block_type |
typedef CompareType | cmp_type |
typedef sorted_runs_type | result_type |
typedef sorted_runs < trigger_entry_type, cmp_type > | sorted_runs_data_type |
typedef counting_ptr < sorted_runs_data_type > | sorted_runs_type |
typedef sort_helper::trigger_entry < block_type > | trigger_entry_type |
typedef ValueType | value_type |
Public Member Functions | |
runs_creator (CompareType c, unsigned_type memory_to_use) | |
Creates the object. More... | |
void | finish () |
Finishes current run and begins new one. More... | |
void | push (const value_type &val) |
Adds new element to the current run. More... | |
sorted_runs_type & | result () |
Returns the sorted runs object. More... | |
Private Types | |
typedef sorted_runs_data_type::run_type | run_type |
Private Attributes | |
alloc_strategy_type | alloc_strategy |
needs to be reset after each run More... | |
CompareType | cmp |
block_type * | cur_block |
unsigned_type | iblock |
unsigned_type | irun |
unsigned_type | m_ |
memory for internal use in blocks More... | |
unsigned_type | offset |
sorted_runs_type | result_ |
stores the result (sorted runs) More... | |
buffered_writer< block_type > | writer |
Additional Inherited Members | |
![]() | |
noncopyable () | |
typedef AllocStr stxxl::stream::runs_creator< from_sorted_sequences< ValueType >, CompareType, BlockSize, AllocStr >::alloc_strategy_type |
Definition at line 733 of file sort_stream.h.
typedef typed_block<BlockSize, value_type> stxxl::stream::runs_creator< from_sorted_sequences< ValueType >, CompareType, BlockSize, AllocStr >::block_type |
Definition at line 731 of file sort_stream.h.
typedef CompareType stxxl::stream::runs_creator< from_sorted_sequences< ValueType >, CompareType, BlockSize, AllocStr >::cmp_type |
Definition at line 736 of file sort_stream.h.
typedef sorted_runs_type stxxl::stream::runs_creator< from_sorted_sequences< ValueType >, CompareType, BlockSize, AllocStr >::result_type |
Definition at line 739 of file sort_stream.h.
|
private |
Definition at line 742 of file sort_stream.h.
typedef sorted_runs<trigger_entry_type, cmp_type> stxxl::stream::runs_creator< from_sorted_sequences< ValueType >, CompareType, BlockSize, AllocStr >::sorted_runs_data_type |
Definition at line 737 of file sort_stream.h.
typedef counting_ptr<sorted_runs_data_type> stxxl::stream::runs_creator< from_sorted_sequences< ValueType >, CompareType, BlockSize, AllocStr >::sorted_runs_type |
Definition at line 738 of file sort_stream.h.
typedef sort_helper::trigger_entry<block_type> stxxl::stream::runs_creator< from_sorted_sequences< ValueType >, CompareType, BlockSize, AllocStr >::trigger_entry_type |
Definition at line 732 of file sort_stream.h.
typedef ValueType stxxl::stream::runs_creator< from_sorted_sequences< ValueType >, CompareType, BlockSize, AllocStr >::value_type |
Definition at line 730 of file sort_stream.h.
|
inline |
Creates the object.
c | comparator object |
memory_to_use | memory amount that is allowed to used by the sorter in bytes. Recommended value: 2 * block_size * D |
Definition at line 763 of file sort_stream.h.
References stxxl::sort_memory_usage_factor(), and stxxl::sort_helper::verify_sentinel_strict_weak_ordering().
|
inline |
Finishes current run and begins new one.
Definition at line 817 of file sort_stream.h.
References stxxl::make_bid_iterator(), and stxxl::block_manager::new_blocks().
|
inline |
Adds new element to the current run.
val | value to be added to the current run |
Definition at line 784 of file sort_stream.h.
References stxxl::make_bid_iterator(), and stxxl::block_manager::new_blocks().
|
inline |
Returns the sorted runs object.
runs_merger
object as input Definition at line 859 of file sort_stream.h.
|
private |
needs to be reset after each run
Definition at line 756 of file sort_stream.h.
|
private |
Definition at line 744 of file sort_stream.h.
|
private |
Definition at line 751 of file sort_stream.h.
|
private |
Definition at line 753 of file sort_stream.h.
|
private |
Definition at line 754 of file sort_stream.h.
|
private |
memory for internal use in blocks
Definition at line 749 of file sort_stream.h.
|
private |
Definition at line 752 of file sort_stream.h.
|
private |
stores the result (sorted runs)
Definition at line 747 of file sort_stream.h.
|
private |
Definition at line 750 of file sort_stream.h.