|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
A bottom-up merge sort over row indices that can stop and resume. More...
#include <sort.hpp>
Public Member Functions | |
| ChunkedMergeSort (std::vector< std::uint32_t > rows, RowOrder order) | |
Prepares to sort rows by order. | |
| bool | run (Deadline deadline, ::core::async::StopToken const &stop) |
| Sorts until done, the deadline passes, or a stop is requested. | |
| bool | done () const noexcept |
| Whether the sort has finished. | |
| std::vector< std::uint32_t > | take () && |
| The sorted rows. Valid once done(). | |
Static Public Attributes | |
| static constexpr std::size_t | kRun = 512 |
| Rows per initial run. | |
A bottom-up merge sort over row indices that can stop and resume.
Runs of kRun rows are sorted first, then merged pass by pass. run returns at a deadline or a stop request and continues from there on the next call, which is how the engine sorts 100,000 rows on an owner thread in frame-sized steps, or abandons a superseded sort on a worker.
|
inline |
|
inline |
|
inlinenodiscardnoexcept |
|
inlinenodiscard |
|
staticconstexpr |