flatten 20260225

This commit is contained in:
Timothy Prepscius
2026-02-25 12:39:24 -05:00
commit fa54be052a
315 changed files with 49791 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
// TJP COPYRIGHT HEADER
//
// Timer.h
// algorithm
//
// Created by Timothy Prepscius on 1/19/18.
// Copyright © 2018 Timothy Prepscius. All rights reserved.
//
#pragma once
#include "Scheduler.h"
#include <core/future/Future.hpp>
#include <functional>
#include "Time.h"
namespace timprepscius::core::time {
struct SchedulerEvent {
virtual ~SchedulerEvent () {}
virtual void cancel () = 0;
} ;
struct Scheduler
{
virtual SchedulerEventPtr schedule(Duration period, bool repeat, std::function<void()> &&f) = 0;
virtual ~Scheduler();
Future<void> after(Duration period);
template<typename T, typename F>
Future<T> schedule(Duration period, F &&f);
template<typename T, typename F>
Future<T> schedule_future(Duration period, F &&f);
template<typename T, typename F>
Future<T> schedule(F &&f);
template<typename T, typename F>
Future<T> schedule_future(F &&f);
template<typename F>
void run(F &&f);
};
} // namespace
#include "Scheduler.inl"