#pragma once #include #include #include #include namespace ResourceDASM { class InterruptManager { public: InterruptManager(); ~InterruptManager() = default; struct PendingCall { std::shared_ptr next; uint64_t at_cycle_count; bool canceled; bool completed; std::function fn; inline void cancel() { this->canceled = true; } }; std::shared_ptr add(uint64_t cycle_count, std::function fn); void on_cycle_start(); uint64_t cycles() const; protected: uint64_t cycle_count; std::shared_ptr head; }; } // namespace ResourceDASM