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,35 @@
#pragma once
#include "schedule/schedule_types.h"
#include <cstddef>
#include <cstdint>
namespace borla {
class AlarmSchedule final {
public:
bool Upsert(const AlarmEntry& alarm);
bool Delete(int32_t id);
bool Replace(const AlarmList& alarms);
bool EnsureBuiltInFirstDay(bool consumed);
AlarmFireBatch TakeDue(
const CalendarMinute& local_time,
int64_t epoch_seconds);
const AlarmList& list() const { return alarms_; }
bool first_day_consumed() const { return first_day_consumed_; }
static bool Validate(const AlarmEntry& alarm);
static bool Matches(
const AlarmEntry& alarm,
const CalendarMinute& local_time,
int64_t epoch_seconds);
private:
AlarmList alarms_{};
bool first_day_consumed_ = false;
int64_t last_fired_minute_key_ = -1;
};
} // namespace borla