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::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type > Class Template Reference

Produces sorted stream from input stream. More...

#include <sort_stream.h>

Inheritance diagram for stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >:
Inheritance graph
[legend]
Collaboration diagram for stxxl::stream::sort< Input_, CompareType_, BlockSize_, AllocStr_, runs_creator_type >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Input_::value_type value_type
 Standard stream typedef.

Public Member Functions

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

Private Types

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

Private Attributes

runs_creator_type creator
runs_merger_type merger

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:
algo/copy_and_sort_file.cpp, containers/berkeley_db_benchmark.cpp, stream/test_naive_transpose.cpp, and stream/test_stream.cpp.

Definition at line 1507 of file sort_stream.h.


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 1510 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 1509 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 1517 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 1523 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 1535 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 1544 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 1550 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 1563 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 1556 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 1512 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 1513 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