Comparision object based Internal_Sorter_base subclass implementation; uses quick_sort_obj(). More...
#include <tpie/internal_sort.h>
Inherits tpie::ami::Internal_Sorter_Base< T >.
Public Member Functions | |
Internal_Sorter_Obj (Compare cmp) | |
Empty constructor. More... | |
~Internal_Sorter_Obj () | |
Empty destructor. More... | |
void | sort (file_stream< T > *InStr, file_stream< T > *OutStr, TPIE_OS_SIZE_T nItems, progress_indicator_base *pi=0) |
Reads nItems sequentially from InStr, starting at the current file position; writes the sorted output to OutStr, starting from the current file position. More... | |
void | allocate (TPIE_OS_SIZE_T nItems) |
Allocate ItemArray as array that can hold nItems . More... | |
void | deallocate (void) |
Clean up internal array ItemArray. More... | |
TPIE_OS_SIZE_T | MaxItemCount (TPIE_OS_SIZE_T memSize) |
Returns maximum number of items that can be sorted using memSize bytes. More... | |
TPIE_OS_SIZE_T | space_per_item () |
Returns memory usage in bytes per sort item. More... | |
TPIE_OS_SIZE_T | space_overhead () |
Returns fixed memory usage overhead in bytes per class instantiation. More... | |
Protected Attributes | |
Compare | cmp_o |
Comparison object used for sorting. More... | |
array< T > | ItemArray |
Array that holds items to be sorted. More... | |
TPIE_OS_SIZE_T | len |
length of ItemArray More... | |
Comparision object based Internal_Sorter_base subclass implementation; uses quick_sort_obj().
Definition at line 165 of file internal_sort.h.
|
inline |
Empty constructor.
Definition at line 176 of file internal_sort.h.
|
inline |
|
inlineinherited |
Allocate ItemArray as array that can hold nItems
.
Definition at line 127 of file internal_sort.h.
|
inlineinherited |
Clean up internal array ItemArray.
Definition at line 133 of file internal_sort.h.
|
inlineinherited |
Returns maximum number of items that can be sorted using memSize
bytes.
Definition at line 139 of file internal_sort.h.
void tpie::ami::Internal_Sorter_Obj< T, Compare >::sort | ( | file_stream< T > * | InStr, |
file_stream< T > * | OutStr, | ||
TPIE_OS_SIZE_T | nItems, | ||
progress_indicator_base * | pi = 0 |
||
) |
Reads nItems sequentially from InStr, starting at the current file position; writes the sorted output to OutStr, starting from the current file position.
Definition at line 201 of file internal_sort.h.
References tpie::fractional_subindicator::done(), tpie::fractional_progress::done(), tpie::fractional_progress::id(), tpie::fractional_subindicator::init(), tpie::fractional_progress::init(), tpie::file_stream< T >::read(), tpie::stream_crtp< child_t >::seek(), tpie::progress_indicator_base::step(), tp_assert, TPIE_FSI, tpie::file_stream_base::truncate(), and tpie::file_stream< T >::write().
|
inlineinherited |
Returns fixed memory usage overhead in bytes per class instantiation.
Definition at line 149 of file internal_sort.h.
|
inlineinherited |
Returns memory usage in bytes per sort item.
Definition at line 156 of file internal_sort.h.
|
protected |
Comparison object used for sorting.
Definition at line 170 of file internal_sort.h.
|
protectedinherited |
Array that holds items to be sorted.
Definition at line 81 of file internal_sort.h.
|
protectedinherited |
length of ItemArray
Definition at line 83 of file internal_sort.h.