|
| template<std::size_t Capacity> |
| using | timer_queue = detail::timer_queue< Capacity > |
| |
| template<typename Runtime > |
| using | task_resources = detail::task_resources< Runtime > |
| |
| template<typename Executor > |
| using | spawner = task_spawner< Executor > |
| |
| template<typename Runtime , std::size_t Capacity = 16U> |
| using | delayed_event_timer = tick_executor< Runtime, Capacity > |
| |
| template<typename Topology , typename Storage , typename Scheduler = void, typename Overflow = ::tsm::overflow::reject_newest, typename Transport = void> |
| using | policy = ::tsm::runtime_policy< Topology, Storage, Scheduler, Overflow, Transport > |
| |
| template<typename Definition , typename Policy , template< typename > class MachinePolicy = detail::default_machine_policy> |
| using | Runtime = detail::runtime_impl< Definition, Policy, MachinePolicy > |
| |
| template<typename Definition , typename Policy , template< typename > class MachinePolicy = detail::default_machine_policy> |
| using | runtime_for = Runtime< Definition, Policy, MachinePolicy > |
| |
| template<typename Definition , template< typename > class MachinePolicy = detail::default_machine_policy> |
| using | direct_runtime = Runtime< Definition, ::tsm::runtime_policy<::tsm::dispatch_model::direct, ::tsm::queue_policy<::tsm::static_storage< 2 > >>, MachinePolicy > |
| |
| template<typename Definition , std::size_t Capacity, typename Overflow = overflow::reject_newest, template< typename > class MachinePolicy = detail::default_machine_policy> |
| using | queued_runtime = Runtime< Definition, ::tsm::runtime_policy< ::tsm::dispatch_model::queued, ::tsm::queue_policy<::tsm::target_storage< Capacity >, Overflow > >, MachinePolicy > |
| |
| template<typename Definition , std::size_t Capacity, typename Overflow = overflow::reject_newest, template< typename > class MachinePolicy = detail::default_machine_policy> |
| using | per_region_runtime = Runtime< Definition, ::tsm::runtime_policy< ::tsm::dispatch_model::per_region_queued, ::tsm::queue_policy<::tsm::target_storage< Capacity >, Overflow > >, MachinePolicy > |
| |
|
| template<typename Event , typename Sink > |
| constexpr input_port< Event, Sink > | make_input_port (Sink &sink) |
| |
| template<typename Event , typename Source > |
| constexpr output_port< Event, Source > | make_output_port (Source &source) |
| |
| template<typename Source , typename Sink > |
| | actor_link (Source &, Sink &) -> actor_link< Source, Sink > |
| |
| template<typename... Links> |
| bool | link_all (Links &... links) |
| |
| template<typename... Actors> |
| | actor_group (Actors &...) -> actor_group< Actors... > |
| |
| template<typename... Runtimes> |
| | runtime_group (Runtimes &...) -> runtime_group< Runtimes... > |
| |
| template<typename... Tasks> |
| | cooperative_executor (Tasks &...) -> cooperative_executor< Tasks... > |
| |
| template<typename... Tasks> |
| | priority_cooperative_executor (Tasks &...) -> priority_cooperative_executor< Tasks... > |
| |
| template<typename TickSource , typename Executor , typename DelayedEvents > |
| tsm::tick_rep | drive_elapsed_ticks (TickSource &tick_source, Executor &executor, DelayedEvents &delayed_events) |
| |
| template<typename Runtime > |
| | tick_executor (Runtime &) -> tick_executor< Runtime > |
| |
| template<typename Stream > |
| void | write_resource_manifest (Stream &output, char const *name, resource_snapshot const &snapshot) |
| |
| consteval bool | fits (resource_snapshot const &snapshot, resource_budget const &budget) |
| |
template<typename Definition , typename Policy , template< typename > class MachinePolicy = detail::default_machine_policy>
Runtime alias selected by definition and policy.
The alias chooses a concrete implementation from the topology tag in the policy. Public code names Runtime<Definition, Policy> while implementation details remain in runtime::detail.
template<std::size_t Capacity>
Fixed-capacity integer-tick timer queue used by coroutine schedulers.
The scheduler owns this queue internally, but the type is public so tests, resource checks, and target adapters can exercise the same bounded timer admission rule without depending on implementation namespace names. The queue stores only explicit tick deadlines and sequence numbers; it has no chrono or OS dependency. Equal deadlines wake deterministically by sequence.
template<typename TickSource , typename Executor , typename DelayedEvents >
| tsm::tick_rep tsm::runtime::drive_elapsed_ticks |
( |
TickSource & |
tick_source, |
|
|
Executor & |
executor, |
|
|
DelayedEvents & |
delayed_events |
|
) |
| |
Advance runtime work from a single elapsed-tick source.
The tick source owns the platform-time boundary: SysTick, an RTOS tick counter, or a host clock adapter converts elapsed time into integer ticks. This helper then applies those same ticks to coroutine/task sleeps and to delayed HSM events before draining ready runtime work. Using one elapsed value keeps task timing and delayed event timing coherent on embedded targets.
template<typename Stream >
| void tsm::runtime::write_resource_manifest |
( |
Stream & |
output, |
|
|
char const * |
name, |
|
|
resource_snapshot const & |
snapshot |
|
) |
| |
Write a stable JSON resource manifest for one runtime snapshot.
The stream is supplied by the caller so the same function can write to std::ostream, a test double, or another host-side sink. The input snapshot is normally produced by the runtime resource accounting API.
template<typename Source , typename Sink >
| concept tsm::runtime::compatible_link |
Initial value:
typename Source::event_type;
typename Sink::event_type;
requires std::same_as<
typename Source::event_type,
typename Sink::event_type>;
} &&
requires(Source source, Sink sink,
typename Source::event_type event) {
{ source.try_receive(event) } -> std::convertible_to<bool>;
{ sink.try_send(event) } -> std::convertible_to<bool>;
}
True when a source and sink port can be connected by actor_link.
Compatible links have the same event_type, the source can try to receive that type, and the sink can try to send that type.
template<typename Executor >
| concept tsm::runtime::executor_backend |
Initial value:
{
{
executor.step()
} -> std::convertible_to<bool>;
{
executor.run_ready()
} -> std::convertible_to<std::size_t>;
}
Executor backend contract.
An executor is intentionally smaller than a runtime. It decides when and how much ready work to run, but it does not own HSM semantics. Platform-specific wait primitives such as epoll, kevent, FreeRTOS notifications, Zephyr k_poll, or bare-metal interrupt flags should wake an executor that then calls a runtime through this shape.
template<typename Executor >
| concept tsm::runtime::wake_executor_backend |
Initial value:= executor_backend<Executor> &&
{
executor.wake();
executor.wake_from_isr();
executor.wait_for_work();
}
Wake-aware executor backend contract.
Platform executors may block an OS task, host thread, or bare-metal idle loop when no cooperative work is ready. wake releases that wait surface, and wait_for_work performs one bounded target-specific wait. The runtime queue remains the event storage authority; the wake primitive is only a scheduling signal.