Public Member Functions | |
internal_sort (memory_bucket_ref buffer_bucket, memory_bucket_ref item_bucket, pred_t pred=pred_t()) | |
void | begin (memory_size_type memAvail) |
bool | push (const T &item) |
True if all items up to and including this one fits in buffer. More... | |
memory_size_type | get_largest_item_size () |
memory_size_type | current_serialized_size () |
Get the serialized size of the items written. More... | |
memory_size_type | memory_usage () |
Compute current memory usage. More... | |
bool | can_shrink_buffer () |
void | shrink_buffer () |
void | sort () |
const T * | begin () const |
const T * | end () const |
void | free () |
Deallocate buffer and call reset(). More... | |
void | reset () |
Reset sorter, but keep the remembered largest item size and buffer size. More... | |
Definition at line 89 of file serialization_sorter.h.
|
inline |
Get the serialized size of the items written.
This is exactly the size the current run will use when serialized to disk.
Definition at line 165 of file serialization_sorter.h.
|
inline |
Deallocate buffer and call reset().
Definition at line 207 of file serialization_sorter.h.
References tpie::serialization_bits::internal_sort< T, pred_t >::reset(), and tpie::array< T, Allocator >::resize().
|
inline |
Compute current memory usage.
This includes the item buffer array as well as the extra serialized size of the items already written to the buffer. This assumes that items use as much primary memory as their serialized size. If this assumption does not hold, the memory usage reported may be useless. Nevertheless, this is the memory usage we use in our calculations.
Definition at line 179 of file serialization_sorter.h.
|
inline |
True if all items up to and including this one fits in buffer.
Once push() returns false, it will keep returning false until the sequence is sorted, read out, and the buffer has been cleared.
Definition at line 131 of file serialization_sorter.h.
References tpie::array< T, Allocator >::size().
|
inline |
Reset sorter, but keep the remembered largest item size and buffer size.
Definition at line 216 of file serialization_sorter.h.
Referenced by tpie::serialization_bits::internal_sort< T, pred_t >::free().