bolar_2 backup

This commit is contained in:
2026-11-27 16:38:11 +08:00
commit e96d6d19df
305 changed files with 43350 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#pragma once
#include <array>
#include <cstddef>
#include <cstdint>
namespace borla {
class ReminderSchedule final {
public:
static constexpr size_t kCapacity = 16;
bool Add(uint64_t deadline_ms);
void CancelAll();
bool CancelNext();
size_t PopDue(uint64_t now_ms);
size_t count() const { return count_; }
uint64_t next_deadline_ms() const
{
return count_ == 0 ? 0 : deadlines_[0];
}
private:
size_t count_ = 0;
std::array<uint64_t, kCapacity> deadlines_{};
};
} // namespace borla