tin  1.5.9
tsm Namespace Reference

Namespaces

 chrono_ticks
 
 core
 
 detail
 
 dispatch_model
 
 io
 
 log
 
 overflow
 
 platform
 
 policy
 
 reflection
 
 runtime
 
 transport
 

Classes

struct  bare_metal_wake_hooks
 
class  bare_metal_tick_source
 
class  bare_metal_task_executor
 
struct  FreeRTOSClock
 
struct  FreeRTOSTickSource
 
class  freertos_task_executor
 
struct  reflected_hsm
 
struct  queue_policy
 
struct  runtime_policy
 
struct  dispatch_context
 
class  task
 
class  static_coroutine_arena
 
class  task_context
 
struct  yield_awaitable
 
struct  sleep_ticks_awaitable
 
class  periodic_ticks
 
struct  timeout_ticks_awaitable
 
struct  select_result
 Result of a select wait. More...
 
class  select_awaitable
 
class  send_event_awaitable
 
class  checked_send_event_awaitable
 
class  until_active_awaitable
 
struct  instances
 
struct  frame_bytes
 
struct  task_priority
 
struct  dynamic_task_slots
 
struct  task_group
 
struct  task_def
 
struct  tasks
 
class  queue
 
class  event_flag
 
class  irq_event
 
class  cancellation_source
 
class  cancellation_token
 Read-only cancellation capability for cooperative tasks. More...
 
class  signal
 
class  mutex
 
class  cooperative_executor
 
class  priority_cooperative_executor
 
class  runtime_group
 
class  actor_group
 
class  tick_executor
 
struct  tick_count
 Strong value type for semantic scheduler ticks. More...
 

Typedefs

template<typename... Tasks>
using task_executor = bare_metal_task_executor< Tasks... >
 
template<typename Definition , typename RuntimePolicy , template< typename... > class Executor = runtime::cooperative_executor, std::size_t TimerSlots = 0U>
using app = runtime::app< Definition, RuntimePolicy, Executor, TimerSlots >
 
using every_ticks = periodic_ticks
 
template<std::size_t Capacity>
using static_storage = runtime::storage::static_ring< Capacity >
 
template<std::size_t Capacity>
using target_storage = runtime::storage::target_queue< Capacity >
 
template<std::size_t MaxWaiters = 4U>
using os_event = irq_event< MaxWaiters >
 
template<typename T , std::size_t Capacity, typename Overflow = overflow::reject_newest, std::size_t MaxWaiters = 4U>
using channel = runtime::channel< T, Capacity, Overflow, MaxWaiters >
 
template<typename Definition , typename Policy , template< typename > class MachinePolicy = runtime::detail::default_machine_policy>
using Runtime = runtime::Runtime< Definition, Policy, MachinePolicy >
 
template<typename Definition , typename Policy , template< typename > class MachinePolicy = runtime::detail::default_machine_policy>
using runtime_for = Runtime< Definition, Policy, MachinePolicy >
 
template<typename Runtime , std::size_t Capacity = 16U>
using delayed_event_timer = runtime::delayed_event_timer< Runtime, Capacity >
 
template<std::size_t Capacity>
using timer_queue = runtime::timer_queue< Capacity >
 
using inline_executor = runtime::inline_executor
 
using resource_budget = runtime::resource_budget
 
using resource_snapshot = runtime::resource_snapshot
 
template<typename Runtime >
using task_resources = runtime::task_resources< Runtime >
 
template<typename Runtime , std::size_t TimerSlots = 0U, typename... Groups>
using runtime_resources = runtime::runtime_resources< Runtime, TimerSlots, Groups... >
 
template<typename Runtime , resource_budget Budget, std::size_t TimerSlots = 0U, typename... Groups>
using resource_contract = runtime::resource_contract< Runtime, Budget, TimerSlots, Groups... >
 
template<typename Profile , typename Runtime , std::size_t TimerSlots = 0U, typename... Groups>
using profile_resource_contract = runtime::profile_resource_contract< Profile, Runtime, TimerSlots, Groups... >
 
template<typename Definition >
using direct_runtime = Runtime< Definition, runtime_policy< dispatch_model::direct, queue_policy< static_storage< 2 > >> >
 
template<typename Definition , std::size_t Capacity, typename Overflow = overflow::reject_newest>
using queued_runtime = Runtime< Definition, runtime_policy< dispatch_model::queued, queue_policy< target_storage< Capacity >, Overflow > >>
 
template<typename Definition , std::size_t Capacity, typename Overflow = overflow::reject_newest>
using per_region_runtime = Runtime< Definition, runtime_policy< dispatch_model::per_region_queued, queue_policy< target_storage< Capacity >, Overflow > >>
 
using tick_rep = TSM_TICK_REP
 
using tick_period = TSM_TICK_PERIOD
 
using tick_duration = std::chrono::duration< tick_rep, tick_period >
 Chrono duration type used for semantic scheduler ticks. More...
 
template<typename... Tasks>
using thread_executor = detail::thread_executor< Tasks... >
 
template<typename... Tasks>
using realtime_thread_executor = detail::realtime_thread_executor< Tasks... >
 
template<typename... Deferred>
using deferred_events = detail::type_list< Deferred... >
 
template<typename... Rules>
using synchronization = detail::type_list< Rules... >
 
template<typename... TransitionEntries>
using transition_table = detail::type_list< TransitionEntries... >
 
template<typename... TransitionEntries>
using Ts = transition_table< TransitionEntries... >
 

Enumerations

enum class  task_wait_kind : unsigned char {
  ready , running , sleeping , predicate ,
  completed , failed
}
 
enum class  task_status : unsigned char {
  not_started , ready , running , waiting ,
  completed , failed
}
 
enum class  task_failure_reason : unsigned char {
  none , allocation_failed , frame_too_large , wait_queue_full ,
  timer_queue_full , cancelled , unhandled_exception
}
 
enum class  spawn_result : unsigned char {
  started , no_slot , frame_too_large , allocation_failed ,
  invalid_entry
}
 

Functions

template<typename... Tasks>
 bare_metal_task_executor (Tasks &...) -> bare_metal_task_executor< Tasks... >
 
template<typename... Tasks>
 freertos_task_executor (Tasks &...) -> freertos_task_executor< Tasks... >
 
yield_awaitable yield () noexcept
 
sleep_ticks_awaitable sleep_ticks (tsm::tick_rep ticks) noexcept
 
sleep_ticks_awaitable sleep_ticks (tick_count ticks) noexcept
 
sleep_ticks_awaitable after_ticks (tsm::tick_rep ticks) noexcept
 
sleep_ticks_awaitable after_ticks (tick_count ticks) noexcept
 
timeout_ticks_awaitable timeout_ticks (tsm::tick_rep ticks) noexcept
 
timeout_ticks_awaitable timeout_ticks (tick_count ticks) noexcept
 
template<typename... Awaitables>
auto select (Awaitables &&... awaitables)
 
template<typename Awaitable >
auto with_timeout (Awaitable &&awaitable, tsm::tick_rep ticks)
 
template<typename Awaitable >
auto with_timeout (Awaitable &&awaitable, tick_count ticks)
 
template<typename Runtime , typename Event >
auto send_event (Runtime &runtime, Event &&event)
 
template<typename Event , typename Runtime , typename... Args>
auto send (Runtime &runtime, Args &&... args)
 
template<typename Runtime , typename Event >
auto try_send_event (Runtime &runtime, Event &&event)
 
template<typename Event , typename Runtime , typename... Args>
auto try_send (Runtime &runtime, Args &&... args)
 
template<typename State , typename Machine >
auto until_active (Machine &machine) noexcept
 
template<typename... Tasks>
 cooperative_executor (Tasks &...) -> cooperative_executor< Tasks... >
 
template<typename... Tasks>
 priority_cooperative_executor (Tasks &...) -> priority_cooperative_executor< Tasks... >
 
template<typename... Runtimes>
 runtime_group (Runtimes &...) -> runtime_group< Runtimes... >
 
template<typename... Actors>
 actor_group (Actors &...) -> actor_group< Actors... >
 
template<typename Runtime >
 tick_executor (Runtime &) -> tick_executor< Runtime >
 
consteval tick_count operator""_ticks (unsigned long long value)
 
constexpr tick_count ticks (tick_rep value) noexcept
 
template<typename Rep , typename Period >
constexpr tick_count ticks (std::chrono::duration< Rep, Period > value) noexcept
 
template<detail::transition_like... TransitionEntries>
consteval auto transitions (TransitionEntries...)
 

Variables

constexpr unsigned qnx_supported_major = 7U
 QNX support is intentionally a QNX 7.x target surface. More...
 
template<typename DispatchModel >
concept dispatch_model_policy
 
template<typename Overflow >
concept overflow_policy
 

Typedef Documentation

◆ app

template<typename Definition , typename RuntimePolicy , template< typename... > class Executor = runtime::cooperative_executor, std::size_t TimerSlots = 0U>
using tsm::app = typedef runtime::app<Definition, RuntimePolicy, Executor, TimerSlots>

◆ channel

template<typename T , std::size_t Capacity, typename Overflow = overflow::reject_newest, std::size_t MaxWaiters = 4U>
using tsm::channel = typedef runtime::channel<T, Capacity, Overflow, MaxWaiters>

◆ deferred_events

template<typename... Deferred>
using tsm::deferred_events = typedef detail::type_list<Deferred...>

◆ delayed_event_timer

template<typename Runtime , std::size_t Capacity = 16U>
using tsm::delayed_event_timer = typedef runtime::delayed_event_timer<Runtime, Capacity>

◆ direct_runtime

template<typename Definition >
using tsm::direct_runtime = typedef Runtime< Definition, runtime_policy<dispatch_model::direct, queue_policy<static_storage<2> >> >

◆ every_ticks

◆ inline_executor

◆ os_event

template<std::size_t MaxWaiters = 4U>
using tsm::os_event = typedef irq_event<MaxWaiters>

◆ per_region_runtime

template<typename Definition , std::size_t Capacity, typename Overflow = overflow::reject_newest>
using tsm::per_region_runtime = typedef Runtime<Definition, runtime_policy<dispatch_model::per_region_queued, queue_policy<target_storage<Capacity>, Overflow> >>

◆ profile_resource_contract

template<typename Profile , typename Runtime , std::size_t TimerSlots = 0U, typename... Groups>
using tsm::profile_resource_contract = typedef runtime::profile_resource_contract<Profile, Runtime, TimerSlots, Groups...>

◆ queued_runtime

template<typename Definition , std::size_t Capacity, typename Overflow = overflow::reject_newest>
using tsm::queued_runtime = typedef Runtime<Definition, runtime_policy<dispatch_model::queued, queue_policy<target_storage<Capacity>, Overflow> >>

◆ realtime_thread_executor

template<typename... Tasks>
using tsm::realtime_thread_executor = typedef detail::realtime_thread_executor<Tasks...>

◆ resource_budget

◆ resource_contract

template<typename Runtime , resource_budget Budget, std::size_t TimerSlots = 0U, typename... Groups>
using tsm::resource_contract = typedef runtime::resource_contract<Runtime, Budget, TimerSlots, Groups...>

◆ resource_snapshot

◆ Runtime

template<typename Definition , typename Policy , template< typename > class MachinePolicy = runtime::detail::default_machine_policy>
using tsm::Runtime = typedef runtime::Runtime<Definition, Policy, MachinePolicy>

◆ runtime_for

template<typename Definition , typename Policy , template< typename > class MachinePolicy = runtime::detail::default_machine_policy>
using tsm::runtime_for = typedef Runtime<Definition, Policy, MachinePolicy>

◆ runtime_resources

template<typename Runtime , std::size_t TimerSlots = 0U, typename... Groups>
using tsm::runtime_resources = typedef runtime::runtime_resources<Runtime, TimerSlots, Groups...>

◆ static_storage

template<std::size_t Capacity>
using tsm::static_storage = typedef runtime::storage::static_ring<Capacity>

◆ synchronization

template<typename... Rules>
using tsm::synchronization = typedef detail::type_list<Rules...>

◆ target_storage

template<std::size_t Capacity>
using tsm::target_storage = typedef runtime::storage::target_queue<Capacity>

◆ task_executor

template<typename... Tasks>
using tsm::task_executor = typedef detail::task_executor<Tasks...>

◆ task_resources

template<typename Runtime >
using tsm::task_resources = typedef runtime::task_resources<Runtime>

◆ thread_executor

template<typename... Tasks>
using tsm::thread_executor = typedef detail::thread_executor<Tasks...>

◆ tick_duration

using tsm::tick_duration = typedef std::chrono::duration<tick_rep, tick_period>

Chrono duration type used for semantic scheduler ticks.

◆ tick_period

Chrono period used by one semantic scheduler tick.

The default period is unitless std::ratio<1>. Applications can define TSM_TICK_PERIOD to a std::ratio, such as std::milli or std::micro, when they want the type system to carry the tick scale.

◆ tick_rep

using tsm::tick_rep = typedef TSM_TICK_REP

Integer representation used for semantic scheduler ticks.

The default is std::uint32_t for small embedded targets. Applications that run high-frequency or long-horizon tick domains can override it at compile time, for example -DTSM_TICK_REP=std::uint64_t.

◆ timer_queue

template<std::size_t Capacity>
using tsm::timer_queue = typedef runtime::timer_queue<Capacity>

◆ transition_table

template<typename... TransitionEntries>
using tsm::transition_table = typedef detail::type_list<TransitionEntries...>

◆ Ts

template<typename... TransitionEntries>
using tsm::Ts = typedef transition_table<TransitionEntries...>

Enumeration Type Documentation

◆ spawn_result

enum tsm::spawn_result : unsigned char
strong
Enumerator
started 
no_slot 
frame_too_large 
allocation_failed 
invalid_entry 

◆ task_failure_reason

enum tsm::task_failure_reason : unsigned char
strong
Enumerator
none 
allocation_failed 
frame_too_large 
wait_queue_full 
timer_queue_full 
cancelled 
unhandled_exception 

◆ task_status

enum tsm::task_status : unsigned char
strong
Enumerator
not_started 
ready 
running 
waiting 
completed 
failed 

◆ task_wait_kind

enum tsm::task_wait_kind : unsigned char
strong
Enumerator
ready 
running 
sleeping 
predicate 
completed 
failed 

Function Documentation

◆ actor_group()

template<typename... Actors>
tsm::actor_group ( Actors &  ...) -> actor_group< Actors... >

◆ after_ticks() [1/2]

sleep_ticks_awaitable tsm::after_ticks ( tick_count  ticks)
inlinenoexcept

◆ after_ticks() [2/2]

sleep_ticks_awaitable tsm::after_ticks ( tsm::tick_rep  ticks)
inlinenoexcept

Embassy-style spelling for a one-shot tick sleep.

This is only a clearer name for sleep_ticks; it still receives explicit semantic ticks, not a wall-clock duration.

◆ bare_metal_task_executor()

template<typename... Tasks>
tsm::bare_metal_task_executor ( Tasks &  ...) -> bare_metal_task_executor< Tasks... >

◆ cooperative_executor()

template<typename... Tasks>
tsm::cooperative_executor ( Tasks &  ...) -> cooperative_executor< Tasks... >

◆ freertos_task_executor()

template<typename... Tasks>
tsm::freertos_task_executor ( Tasks &  ...) -> freertos_task_executor< Tasks... >

◆ operator""_ticks()

consteval tick_count tsm::operator""_ticks ( unsigned long long  value)

◆ priority_cooperative_executor()

template<typename... Tasks>
tsm::priority_cooperative_executor ( Tasks &  ...) -> priority_cooperative_executor< Tasks... >

◆ runtime_group()

template<typename... Runtimes>
tsm::runtime_group ( Runtimes &  ...) -> runtime_group< Runtimes... >

◆ select()

template<typename... Awaitables>
auto tsm::select ( Awaitables &&...  awaitables)

◆ send()

template<typename Event , typename Runtime , typename... Args>
auto tsm::send ( Runtime runtime,
Args &&...  args 
)

◆ send_event()

template<typename Runtime , typename Event >
auto tsm::send_event ( Runtime runtime,
Event &&  event 
)

◆ sleep_ticks() [1/2]

sleep_ticks_awaitable tsm::sleep_ticks ( tick_count  ticks)
inlinenoexcept

◆ sleep_ticks() [2/2]

sleep_ticks_awaitable tsm::sleep_ticks ( tsm::tick_rep  ticks)
inlinenoexcept

◆ tick_executor()

template<typename Runtime >
tsm::tick_executor ( Runtime ) -> tick_executor< Runtime >

◆ ticks() [1/2]

template<typename Rep , typename Period >
constexpr tick_count tsm::ticks ( std::chrono::duration< Rep, Period >  value)
constexprnoexcept

◆ ticks() [2/2]

constexpr tick_count tsm::ticks ( tick_rep  value)
constexprnoexcept

◆ timeout_ticks() [1/2]

timeout_ticks_awaitable tsm::timeout_ticks ( tick_count  ticks)
inlinenoexcept

◆ timeout_ticks() [2/2]

timeout_ticks_awaitable tsm::timeout_ticks ( tsm::tick_rep  ticks)
inlinenoexcept

◆ transitions()

template<detail::transition_like... TransitionEntries>
consteval auto tsm::transitions ( TransitionEntries...  )

◆ try_send()

template<typename Event , typename Runtime , typename... Args>
auto tsm::try_send ( Runtime runtime,
Args &&...  args 
)

◆ try_send_event()

template<typename Runtime , typename Event >
auto tsm::try_send_event ( Runtime runtime,
Event &&  event 
)

◆ until_active()

template<typename State , typename Machine >
auto tsm::until_active ( Machine &  machine)
noexcept

◆ with_timeout() [1/2]

template<typename Awaitable >
auto tsm::with_timeout ( Awaitable &&  awaitable,
tick_count  ticks 
)

◆ with_timeout() [2/2]

template<typename Awaitable >
auto tsm::with_timeout ( Awaitable &&  awaitable,
tsm::tick_rep  ticks 
)

◆ yield()

yield_awaitable tsm::yield ( )
inlinenoexcept

Variable Documentation

◆ dispatch_model_policy

template<typename DispatchModel >
concept tsm::dispatch_model_policy
Initial value:
=
std::same_as<DispatchModel, dispatch_model::direct> ||
std::same_as<DispatchModel, dispatch_model::queued> ||
std::same_as<DispatchModel, dispatch_model::per_region_queued>

◆ overflow_policy

template<typename Overflow >
concept tsm::overflow_policy
Initial value:
= std::same_as<Overflow, overflow::reject_newest> ||
std::same_as<Overflow, overflow::drop_oldest> ||
std::same_as<Overflow, overflow::overwrite_latest>

◆ qnx_supported_major

constexpr unsigned tsm::qnx_supported_major = 7U
inlineconstexpr

QNX support is intentionally a QNX 7.x target surface.