tin  1.5.9
tsm::periodic_ticks Class Reference

#include <coroutine.h>

Collaboration diagram for tsm::periodic_ticks:
Collaboration graph

Public Member Functions

constexpr periodic_ticks (tsm::tick_rep period) noexcept
 
constexpr periodic_ticks (tick_count period) noexcept
 
sleep_ticks_awaitable operator co_await () const noexcept
 
tsm::tick_rep period () const noexcept
 

Detailed Description

Reusable periodic tick source for coroutine loops.

A task keeps the periodic_ticks object in its coroutine frame and awaits it once per loop iteration. The first await sleeps for the configured period; later awaits use the same period again. This gives periodic task code a stable local object without installing global timers or callbacks.

Constructor & Destructor Documentation

◆ periodic_ticks() [1/2]

constexpr tsm::periodic_ticks::periodic_ticks ( tsm::tick_rep  period)
inlineexplicitconstexprnoexcept

◆ periodic_ticks() [2/2]

constexpr tsm::periodic_ticks::periodic_ticks ( tick_count  period)
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ operator co_await()

sleep_ticks_awaitable tsm::periodic_ticks::operator co_await ( ) const
inlinenoexcept

◆ period()

tsm::tick_rep tsm::periodic_ticks::period ( ) const
inlinenoexcept

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