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,47 @@
// TJP COPYRIGHT HEADER
//
// Timer.h
// algorithm
//
// Created by Timothy Prepscius on 1/19/18.
// Copyright © 2018 Timothy Prepscius. All rights reserved.
//
#pragma once
#include "SchedulerPool.h"
#include "Scheduler.hpp"
#include <core/threads/Lock.hpp>
#include <core/ptr/Ptr.hpp>
#include <map>
#include <set>
namespace timprepscius {
namespace core {
namespace time {
struct SchedulerPool : StrongThis<SchedulerPool>
{
QMutex mutex;
std::set<SchedulerEventPtr> events;
std::atomic<size_t> nextIndex;
std::map<size_t, SchedulerEventPtr> onces;
SchedulerPtr scheduler;
SchedulerPool();
virtual ~SchedulerPool ();
SchedulerEventPtr schedule(const SchedulerPtr &scheduler, Time period, std::function<void()> &&f);
SchedulerEventPtr once(const SchedulerPtr &scheduler, Time offset, std::function<void()> &&f);
void remove_once(size_t index);
void remove_once_no_lock(size_t index);
void clear();
} ;
} // namespace
} // namespace
} // namespace