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

Detailed Description

template<class Input_, class CompareType_, unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY, class runs_creator_type = runs_creator<Input_, CompareType_, BlockSize_, AllocStr_>>
class stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >

Produces sorted stream from input stream.

Template Parameters
Input_type of the input stream
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
Remarks
Implemented as the composition of runs_creator and runs_merger .
Examples:
examples/algo/copy_and_sort_file.cpp.

Definition at line 1503 of file sort_stream.h.

+ Inheritance diagram for stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >:
+ Collaboration diagram for stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >:

Public Types

typedef Input_::value_type value_type
 Standard stream typedef. More...
 

Public Member Functions

 sort (Input_ &in, CompareType_ c, unsigned_type memory_to_use)
 Creates the object. More...
 
 sort (Input_ &in, CompareType_ c, unsigned_type m_memory_to_userc, unsigned_type m_memory_to_use)
 Creates the object. More...
 
bool empty () const
 Standard stream method. More...
 
const value_typeoperator* () const
 Standard stream method. More...
 
sortoperator++ ()
 Standard stream method. More...
 
const value_typeoperator-> () const
 

Private Types

typedef runs_merger
< sorted_runs_type,
CompareType_, AllocStr_ > 
runs_merger_type
 
typedef
runs_creator_type::sorted_runs_type 
sorted_runs_type
 

Private Attributes

runs_creator_type creator
 
runs_merger_type merger
 

Additional Inherited Members

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

Member Typedef Documentation

template<class Input_ , class CompareType_ , unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY, class runs_creator_type = runs_creator<Input_, CompareType_, BlockSize_, AllocStr_>>
typedef runs_merger<sorted_runs_type, CompareType_, AllocStr_> stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >::runs_merger_type
private

Definition at line 1506 of file sort_stream.h.

template<class Input_ , class CompareType_ , unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY, class runs_creator_type = runs_creator<Input_, CompareType_, BlockSize_, AllocStr_>>
typedef runs_creator_type::sorted_runs_type stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >::sorted_runs_type
private

Definition at line 1505 of file sort_stream.h.

template<class Input_ , class CompareType_ , unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY, class runs_creator_type = runs_creator<Input_, CompareType_, BlockSize_, AllocStr_>>
typedef Input_::value_type stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >::value_type

Standard stream typedef.

Definition at line 1513 of file sort_stream.h.

Constructor & Destructor Documentation

template<class Input_ , class CompareType_ , unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY, class runs_creator_type = runs_creator<Input_, CompareType_, BlockSize_, AllocStr_>>
stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >::sort ( Input_ &  in,
CompareType_  c,
unsigned_type  memory_to_use 
)
inline

Creates the object.

Parameters
ininput stream
ccomparator object
memory_to_usememory amount that is allowed to used by the sorter in bytes

Definition at line 1519 of file sort_stream.h.

References stxxl::sort_helper::verify_sentinel_strict_weak_ordering().

template<class Input_ , class CompareType_ , unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY, class runs_creator_type = runs_creator<Input_, CompareType_, BlockSize_, AllocStr_>>
stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >::sort ( Input_ &  in,
CompareType_  c,
unsigned_type  m_memory_to_userc,
unsigned_type  m_memory_to_use 
)
inline

Creates the object.

Parameters
ininput stream
ccomparator object
m_memory_to_usercmemory amount that is allowed to used by the runs creator in bytes
m_memory_to_usememory amount that is allowed to used by the merger in bytes

Definition at line 1531 of file sort_stream.h.

References stxxl::sort_helper::verify_sentinel_strict_weak_ordering().

Member Function Documentation

template<class Input_ , class CompareType_ , unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY, class runs_creator_type = runs_creator<Input_, CompareType_, BlockSize_, AllocStr_>>
bool stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >::empty ( ) const
inline

Standard stream method.

Definition at line 1540 of file sort_stream.h.

template<class Input_ , class CompareType_ , unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY, class runs_creator_type = runs_creator<Input_, CompareType_, BlockSize_, AllocStr_>>
const value_type& stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >::operator* ( ) const
inline

Standard stream method.

Definition at line 1546 of file sort_stream.h.

template<class Input_ , class CompareType_ , unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY, class runs_creator_type = runs_creator<Input_, CompareType_, BlockSize_, AllocStr_>>
sort& stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >::operator++ ( )
inline

Standard stream method.

Definition at line 1559 of file sort_stream.h.

template<class Input_ , class CompareType_ , unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY, class runs_creator_type = runs_creator<Input_, CompareType_, BlockSize_, AllocStr_>>
const value_type* stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >::operator-> ( ) const
inline

Definition at line 1552 of file sort_stream.h.

Member Data Documentation

template<class Input_ , class CompareType_ , unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY, class runs_creator_type = runs_creator<Input_, CompareType_, BlockSize_, AllocStr_>>
runs_creator_type stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >::creator
private

Definition at line 1508 of file sort_stream.h.

template<class Input_ , class CompareType_ , unsigned BlockSize_ = STXXL_DEFAULT_BLOCK_SIZE(typename Input_::value_type), class AllocStr_ = STXXL_DEFAULT_ALLOC_STRATEGY, class runs_creator_type = runs_creator<Input_, CompareType_, BlockSize_, AllocStr_>>
runs_merger_type stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >::merger
private

Definition at line 1509 of file sort_stream.h.


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