distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
distortos::StaticSoftwareTimer< Function, Args > Class Template Reference

StaticSoftwareTimer class is a templated interface for software timer. More...

#include <StaticSoftwareTimer.hpp>

Inheritance diagram for distortos::StaticSoftwareTimer< Function, Args >:
[legend]
Collaboration diagram for distortos::StaticSoftwareTimer< Function, Args >:
[legend]

Public Member Functions

 StaticSoftwareTimer (Function &&function, Args &&... args)
 StaticSoftwareTimer's constructor. More...
 
- Public Member Functions inherited from distortos::SoftwareTimerCommon
constexpr SoftwareTimerCommon ()
 SoftwareTimerCommon's constructor. More...
 
 ~SoftwareTimerCommon () override
 SoftwareTimerCommon's destructor. More...
 
bool isRunning () const override
 
int start (TickClock::time_point timePoint, TickClock::duration period={}) override
 Starts the timer. More...
 
int stop () override
 Stops the timer. More...
 
 SoftwareTimerCommon (const SoftwareTimerCommon &)=delete
 
 SoftwareTimerCommon (SoftwareTimerCommon &&)=default
 
const SoftwareTimerCommonoperator= (const SoftwareTimerCommon &)=delete
 
SoftwareTimerCommonoperator= (SoftwareTimerCommon &&)=delete
 
- Public Member Functions inherited from distortos::SoftwareTimer
virtual ~SoftwareTimer ()=0
 SoftwareTimer's destructor. More...
 
int start (TickClock::duration duration, TickClock::duration period={})
 Starts the timer. More...
 
template<typename Rep1 , typename Period1 , typename Rep2 = TickClock::rep, typename Period2 = TickClock::period>
int start (const std::chrono::duration< Rep1, Period1 > duration, const std::chrono::duration< Rep2, Period2 > period={})
 Starts the timer. More...
 
template<typename Duration , typename Rep = TickClock::rep, typename Period = TickClock::period>
int start (const std::chrono::time_point< TickClock, Duration > timePoint, const std::chrono::duration< Rep, Period > period={})
 Starts the timer. More...
 

Private Member Functions

void run () override
 "Run" function of software timer More...
 

Private Attributes

decltype(std::bind(std::declval< Function >(), std::declval< Args >()...)) boundFunction_
 bound function object More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from distortos::SoftwareTimer
static void softwareTimerRunner (SoftwareTimer &softwareTimer)
 Software timer's function runner. More...
 

Detailed Description

template<typename Function, typename... Args>
class distortos::StaticSoftwareTimer< Function, Args >

StaticSoftwareTimer class is a templated interface for software timer.

Template Parameters
Functionis the function that will be executed
Argsare the arguments for function

Constructor & Destructor Documentation

◆ StaticSoftwareTimer()

template<typename Function , typename... Args>
distortos::StaticSoftwareTimer< Function, Args >::StaticSoftwareTimer ( Function &&  function,
Args &&...  args 
)
inline

StaticSoftwareTimer's constructor.

Parameters
[in]functionis a function that will be executed from interrupt context at a later time
[in]argsare arguments for function

Member Function Documentation

◆ run()

template<typename Function , typename... Args>
void distortos::StaticSoftwareTimer< Function, Args >::run ( )
inlineoverrideprivatevirtual

"Run" function of software timer

Executes bound function object.

Implements distortos::SoftwareTimer.

Member Data Documentation

◆ boundFunction_

template<typename Function , typename... Args>
decltype(std::bind(std::declval<Function>(), std::declval<Args>()...)) distortos::StaticSoftwareTimer< Function, Args >::boundFunction_
private

bound function object


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