STXXL  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ > Class Template Reference

Detailed Description

template<class ValueType_, class CompareType_, unsigned BlockSize_, class AllocStr_>
class stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, 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)
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 703 of file sort_stream.h.

+ Inheritance diagram for stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >:
+ Collaboration diagram for stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >:

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_typeresult ()
 Returns the sorted runs object. More...
 

Private Types

typedef
sorted_runs_data_type::run_type 
run_type
 

Private Attributes

alloc_strategy_type alloc_strategy
 
CompareType_ cmp
 
block_typecur_block
 
unsigned_type iblock
 
unsigned_type irun
 
unsigned_type m_
 
unsigned_type offset
 
sorted_runs_type result_
 
buffered_writer< block_typewriter
 

Additional Inherited Members

- Private Member Functions inherited from stxxl::noncopyable
 noncopyable ()
 

Member Typedef Documentation

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
typedef AllocStr_ stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::alloc_strategy_type

Definition at line 714 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
typedef typed_block<BlockSize_, value_type> stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::block_type

Definition at line 712 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
typedef CompareType_ stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::cmp_type

Definition at line 717 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
typedef sorted_runs_type stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::result_type

Definition at line 720 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
typedef sorted_runs_data_type::run_type stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::run_type
private

Definition at line 723 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
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 718 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
typedef counting_ptr<sorted_runs_data_type> stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::sorted_runs_type

Definition at line 719 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
typedef sort_helper::trigger_entry<block_type> stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::trigger_entry_type

Definition at line 713 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
typedef ValueType_ stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::value_type

Definition at line 711 of file sort_stream.h.

Constructor & Destructor Documentation

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::runs_creator ( CompareType_  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

Definition at line 741 of file sort_stream.h.

References stxxl::sort_memory_usage_factor(), and stxxl::sort_helper::verify_sentinel_strict_weak_ordering().

Member Function Documentation

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

Finishes current run and begins new one.

Definition at line 793 of file sort_stream.h.

References stxxl::make_bid_iterator(), and stxxl::block_manager::new_blocks().

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

Adds new element to the current run.

Parameters
valvalue to be added to the current run

Definition at line 760 of file sort_stream.h.

References stxxl::make_bid_iterator(), and stxxl::block_manager::new_blocks().

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
sorted_runs_type& stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, 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

Definition at line 836 of file sort_stream.h.

Member Data Documentation

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
alloc_strategy_type stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::alloc_strategy
private

Definition at line 734 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
CompareType_ stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::cmp
private

Definition at line 725 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
block_type* stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::cur_block
private

Definition at line 730 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
unsigned_type stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::iblock
private

Definition at line 732 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
unsigned_type stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::irun
private

Definition at line 733 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
unsigned_type stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::m_
private

Definition at line 728 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
unsigned_type stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::offset
private

Definition at line 731 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
sorted_runs_type stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::result_
private

Definition at line 727 of file sort_stream.h.

template<class ValueType_ , class CompareType_ , unsigned BlockSize_, class AllocStr_ >
buffered_writer<block_type> stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::writer
private

Definition at line 729 of file sort_stream.h.


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