Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::IDelayedScheduler Class Referenceabstract

Tiny interface — anything that can post a function to run after a delay. More...

#include <property_ops.hpp>

Inheritance diagram for aria::IDelayedScheduler:
[legend]

Public Member Functions

 ~IDelayedScheduler () override
virtual void post_after (std::chrono::milliseconds delay, std::function< void()> fn)=0
 Legacy / canonical timer entry point.
SchedulerCaps caps () const noexcept override
 Capability bitmask.
void schedule (std::function< void()> fn) override
 Submit fn for execution "soon". Defines Caps::Post.
void schedule_after (std::chrono::milliseconds delay, std::function< void()> fn) override
 Submit fn for execution after delay.
Public Member Functions inherited from aria::IScheduler
virtual ~IScheduler ()=default
virtual bool is_main_thread () const noexcept
 True iff the calling thread is the scheduler's "main" thread.

Detailed Description

Tiny interface — anything that can post a function to run after a delay.

Inherits virtually from IScheduler so that multi-role implementations (e.g. VirtualTimeExecutor : IExecutor, IDelayedScheduler) collapse to a single IScheduler subobject.

The base contract IScheduler::schedule(fn) is satisfied by routing through post_after(0ms, fn), and caps() advertises Delay | Post by default. Concrete implementations that also offer main-thread affinity, pumping, etc. should override caps() to widen the bitmask.

Constructor & Destructor Documentation

◆ ~IDelayedScheduler()

aria::IDelayedScheduler::~IDelayedScheduler ( )
override

Member Function Documentation

◆ post_after()

virtual void aria::IDelayedScheduler::post_after ( std::chrono::milliseconds delay,
std::function< void()> fn )
pure virtual

Legacy / canonical timer entry point.

Implementations override this; the unified IScheduler::schedule_after is wired to it below.

Implemented in aria::async::VirtualTimeExecutor, aria::runtime::DispatcherScheduler, and aria::runtime::IDispatcher.

◆ caps()

SchedulerCaps aria::IDelayedScheduler::caps ( ) const
inlinenodiscardoverridevirtualnoexcept

Capability bitmask.

Implementations should return a constant value (or at least a value stable across the object's lifetime).

Implements aria::IScheduler.

Reimplemented in aria::adapters::qt6::QtDispatcher, aria::async::VirtualTimeExecutor, and aria::runtime::IDispatcher.

◆ schedule()

void aria::IDelayedScheduler::schedule ( std::function< void()> fn)
inlineoverridevirtual

Submit fn for execution "soon". Defines Caps::Post.

Implements aria::IScheduler.

Reimplemented in aria::async::VirtualTimeExecutor, and aria::runtime::IDispatcher.

◆ schedule_after()

void aria::IDelayedScheduler::schedule_after ( std::chrono::milliseconds delay,
std::function< void()> fn )
inlineoverridevirtual

Submit fn for execution after delay.

Default implementation throws unsupported_capability; implementations that advertise Caps::Delay MUST override.

Reimplemented from aria::IScheduler.

Reimplemented in aria::async::VirtualTimeExecutor, and aria::runtime::IDispatcher.


The documentation for this class was generated from the following file: