Public Member Functions | |
internal_sort (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 63 of file serialization_sort.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 142 of file serialization_sort.h.
|
inline |
Deallocate buffer and call reset().
Definition at line 185 of file serialization_sort.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 156 of file serialization_sort.h.
References tpie::array< T, Allocator >::size().
Referenced by tpie::serialization_bits::internal_sort< T, pred_t >::push().
|
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 99 of file serialization_sort.h.
References tpie::serialization_bits::internal_sort< T, pred_t >::memory_usage(), tpie::serialized_size(), and tpie::array< T, Allocator >::size().
|
inline |
Reset sorter, but keep the remembered largest item size and buffer size.
Definition at line 194 of file serialization_sort.h.
Referenced by tpie::serialization_bits::internal_sort< T, pred_t >::free().