STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType > 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 RunsCreatorType = runs_creator<Input, CompareType, BlockSize, AllocStr>>
class stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >

Produces sorted stream from input stream.

Template Parameters
Inputtype of the input stream
CompareTypetype of comparison object used for sorting the runs
BlockSizesize of blocks used to store the runs
AllocStrfunctor 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 1537 of file sort_stream.h.

+ Inheritance diagram for stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >:
+ Collaboration diagram for stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >:

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 RunsCreatorType runs_creator_type
 
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 RunsCreatorType = runs_creator<Input, CompareType, BlockSize, AllocStr>>
typedef RunsCreatorType stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >::runs_creator_type
private

Definition at line 1539 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 RunsCreatorType = runs_creator<Input, CompareType, BlockSize, AllocStr>>
typedef runs_merger<sorted_runs_type, CompareType, AllocStr> stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >::runs_merger_type
private

Definition at line 1541 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 RunsCreatorType = runs_creator<Input, CompareType, BlockSize, AllocStr>>
typedef runs_creator_type::sorted_runs_type stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >::sorted_runs_type
private

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 RunsCreatorType = runs_creator<Input, CompareType, BlockSize, AllocStr>>
typedef Input::value_type stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >::value_type

Standard stream typedef.

Definition at line 1548 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 RunsCreatorType = runs_creator<Input, CompareType, BlockSize, AllocStr>>
stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >::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 1554 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 RunsCreatorType = runs_creator<Input, CompareType, BlockSize, AllocStr>>
stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >::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 1566 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 RunsCreatorType = runs_creator<Input, CompareType, BlockSize, AllocStr>>
bool stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >::empty ( ) const
inline

Standard stream method.

Definition at line 1575 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 RunsCreatorType = runs_creator<Input, CompareType, BlockSize, AllocStr>>
const value_type& stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >::operator* ( ) const
inline

Standard stream method.

Definition at line 1581 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 RunsCreatorType = runs_creator<Input, CompareType, BlockSize, AllocStr>>
sort& stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >::operator++ ( )
inline

Standard stream method.

Definition at line 1594 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 RunsCreatorType = runs_creator<Input, CompareType, BlockSize, AllocStr>>
const value_type* stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >::operator-> ( ) const
inline

Definition at line 1587 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 RunsCreatorType = runs_creator<Input, CompareType, BlockSize, AllocStr>>
runs_creator_type stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >::creator
private

Definition at line 1543 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 RunsCreatorType = runs_creator<Input, CompareType, BlockSize, AllocStr>>
runs_merger_type stxxl::stream::sort< Input, CompareType, BlockSize, AllocStr, RunsCreatorType >::merger
private

Definition at line 1544 of file sort_stream.h.


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