#pragma once #include "function/frame_policy/global.hpp" #include "model/Model.hpp" #include #include namespace aethera { /* * 固定帧率、最多一帧在途的策略。Scene 创建具体帧;策略持有并重复使用, * stop completion 执行前会排空 Scene/Sink 借用并销毁该帧。 */ struct Throttled_Latest_only : Def> { enum struct Start_Result : std::uint8_t { started, already_running, start_in_progress, stop_in_progress, dependency_unavailable, frame_unavailable, invalid_frames_per_second, interval_out_of_range }; enum struct Stop_Result : std::uint8_t { stopping, already_stopped, already_stopping, start_in_progress, completion_missing }; using Stop_Completion = std::function; struct Prop : Prev_Prop {}; struct Private; Throttled_Latest_only(proxy timer_service, proxy scene, proxy sink); ~Throttled_Latest_only() noexcept; Start_Result start(double frames_per_second); Stop_Result stop(Stop_Completion completion); }; } #include "Throttled_Latest_Only.ipp"