IAsyncPeriodic Class Reference

Space-ng SDK: sol3::core::IAsyncPeriodic Class Reference
Space-ng SDK
sol3::core::IAsyncPeriodic Class Referenceabstract

#include <sol3/core/async_periodic.h>

Public Member Functions

virtual ~IAsyncPeriodic ()=default
 
virtual void start (std::function< void(std::chrono::steady_clock::time_point expiry)> handler)=0
 Starts the periodic timer with the specified handler. More...
 
virtual void cancel ()=0
 Cancels the periodic timer. More...
 
virtual void setPeriod (std::chrono::steady_clock::duration period)=0
 Sets a new period for the timer. More...
 
virtual void setPhase (std::chrono::steady_clock::duration phase)=0
 Sets the phase for the timer. More...
 
virtual std::chrono::steady_clock::duration period () const =0
 Gets the current period. More...
 
virtual std::chrono::steady_clock::duration phase () const =0
 Gets the phase time of the timer. More...
 
virtual std::chrono::steady_clock::time_point expiry () const =0
 Gets the expiry time of the timer. More...
 

Constructor & Destructor Documentation

◆ ~IAsyncPeriodic()

virtual sol3::core::IAsyncPeriodic::~IAsyncPeriodic ( )
virtualdefault

Member Function Documentation

◆ cancel()

virtual void sol3::core::IAsyncPeriodic::cancel ( )
pure virtual

Cancels the periodic timer.

◆ expiry()

virtual std::chrono::steady_clock::time_point sol3::core::IAsyncPeriodic::expiry ( ) const
pure virtual

Gets the expiry time of the timer.

Returns
The time point when the timer will next expire

◆ period()

virtual std::chrono::steady_clock::duration sol3::core::IAsyncPeriodic::period ( ) const
pure virtual

Gets the current period.

Returns
The current period between handler invocations

◆ phase()

virtual std::chrono::steady_clock::duration sol3::core::IAsyncPeriodic::phase ( ) const
pure virtual

Gets the phase time of the timer.

Returns
The phase offset of the time

◆ setPeriod()

virtual void sol3::core::IAsyncPeriodic::setPeriod ( std::chrono::steady_clock::duration  period)
pure virtual

Sets a new period for the timer.

Parameters
periodThe new period between handler invocations

◆ setPhase()

virtual void sol3::core::IAsyncPeriodic::setPhase ( std::chrono::steady_clock::duration  phase)
pure virtual

Sets the phase for the timer.

Parameters
phaseThe duration in the range [0, period)

◆ start()

virtual void sol3::core::IAsyncPeriodic::start ( std::function< void(std::chrono::steady_clock::time_point expiry)>  handler)
pure virtual

Starts the periodic timer with the specified handler.

Parameters
handlerThe function to call periodically

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