Stxxl  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Private Types | Private Attributes
stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ > Class Template Reference

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

#include <sort_stream.h>

Inheritance diagram for stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >:
Inheritance graph
[legend]
Collaboration diagram for stxxl::stream::runs_creator< from_sorted_sequences< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef ValueType_ value_type
typedef typed_block
< BlockSize_, value_type
block_type
typedef
sort_helper::trigger_entry
< block_type
trigger_entry_type
typedef AllocStr_ alloc_strategy_type
typedef CompareType_ cmp_type
typedef sorted_runs
< trigger_entry_type, cmp_type
sorted_runs_data_type
typedef counting_ptr
< sorted_runs_data_type
sorted_runs_type
typedef sorted_runs_type result_type

Public Member Functions

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

Private Types

typedef
sorted_runs_data_type::run_type 
run_type

Private Attributes

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

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 707 of file sort_stream.h.


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 718 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 716 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 721 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 724 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 727 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 722 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 723 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 717 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 715 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 745 of file sort_stream.h.

References 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 797 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 764 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 840 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 738 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 729 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 734 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 736 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 737 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 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_ >::offset [private]

Definition at line 735 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 731 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 733 of file sort_stream.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines