28 _pending.push_back(
entry);
39 return _pending.empty() && std::ranges::all_of(_entries, &Entry::Removed);
45 for (Entry&
entry : _entries)
60 const auto waiting = std::ranges::find(_pending,
token, &Entry::Token);
71 template <
class Visit>
78 template <
class Visit>
81 Walk([&](
const Entry&
entry) {
84 visit(entry.Call, entry.Context);
96 void* Context =
nullptr;
100 template <
class Visit>
106 const size_t count = _entries.size();
109 const Entry&
entry = _entries[
i];
122 void Insert(
const Entry&
entry)
124 const auto at = std::ranges::find_if(_entries, [&](
const Entry&
held) {
return held.Order >
entry.Order; });
130 std::erase_if(_entries, [](
const Entry&
entry) {
return entry.Removed; });
131 for (
const Entry&
entry : _pending)
138 std::vector<Entry> _entries;
139 std::vector<Entry> _pending;
bool Remove(uint64_t token)
void DispatchTo(uint64_t order, Visit &&visit)
bool Dispatch(Visit &&visit)
void Add(uint64_t token, uint64_t order, Fn callback, void *context)
static std::string ReadFile(const std::filesystem::path &path)