1#ifndef NNGN_TIMING_SCHEDULE_H
2#define NNGN_TIMING_SCHEDULE_H
42 std::vector<std::byte>
data = {};
47 std::size_t
n(
void)
const {
return this->
v.size(); }
50 std::size_t
next(Entry
e);
52 std::size_t
in(std::chrono::milliseconds t, Entry
e);
75 std::size_t
add(std::vector<T> *
v,
T t);
78 std::vector<TimeEntry>
v = {};
Executor of deferred and recurrent tasks.
Definition schedule.h:21
std::size_t n_atexit(void) const
Definition schedule.h:48
bool cancel_atexit(std::size_t i)
Definition schedule.cpp:110
u32 cur_gen
Definition schedule.h:80
Flag
Definition schedule.h:29
@ NONE
Definition schedule.h:30
@ HEARTBEAT
After it is triggered, execute again at every frame.
Definition schedule.h:34
@ IGNORE_FAILURES
Whether a failure in the task is critical or can be tolerated.
Definition schedule.h:32
bool update(void)
Definition schedule.cpp:114
void init(const Timing *t)
Definition schedule.h:45
std::vector< BaseEntry > atexit_v
Definition schedule.h:79
std::size_t frame(u64 f, Entry e)
Definition schedule.cpp:95
std::size_t at(Timing::time_point t, Entry e)
Definition schedule.cpp:88
std::size_t add(std::vector< T > *v, T t)
Definition schedule.cpp:56
std::size_t n(void) const
Definition schedule.h:47
bool exit(void)
Definition schedule.cpp:133
const Timing * timing
Definition schedule.h:81
std::size_t atexit(Entry e)
Definition schedule.cpp:102
bool(*)(void *) Fn
Signature for task functions.
Definition schedule.h:28
std::vector< TimeEntry > v
Definition schedule.h:78
std::size_t in(std::chrono::milliseconds t, Entry e)
Definition schedule.cpp:84
bool cancel_common(std::vector< T > *v, std::size_t i)
Definition schedule.cpp:67
map next
Definition demo1.lua:80
for i
Definition font.lua:5
static auto now(const Timing &t)
Definition timing.cpp:14
std::uint32_t u32
Definition def.h:14
std::uint8_t u8
Definition def.h:12
std::uint64_t u64
Definition def.h:15
bool is_heartbeat() const
Definition schedule.h:64
bool active() const
Definition schedule.h:63
bool call(void)
Definition schedule.cpp:34
bool destroy(void)
Definition schedule.cpp:38
std::vector< std::byte > data
Opaque byte array associated with the task.
Definition schedule.h:42
Fn dest
Destructor for the associated data.
Definition schedule.h:40
Fn f
The task's main function.
Definition schedule.h:38
Flag flags
Definition schedule.h:43
u32 gen
Definition schedule.h:71
u64 frame
Definition schedule.h:70
Timing::time_point time
Definition schedule.h:69
clock::time_point time_point
Definition timing.h:22
local e
Definition math.lua:4