distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
distortos::internal::SoftwareTimerControlBlock Class Reference

SoftwareTimerControlBlock class is a control block of software timer. More...

#include "distortos/internal/scheduler/SoftwareTimerControlBlock.hpp"

Inheritance diagram for distortos::internal::SoftwareTimerControlBlock:
[legend]
Collaboration diagram for distortos::internal::SoftwareTimerControlBlock:
[legend]

Public Types

using FunctionRunner = void(SoftwareTimer &)
 type of runner for software timer's function More...
 

Public Member Functions

constexpr SoftwareTimerControlBlock (FunctionRunner &functionRunner, SoftwareTimer &owner)
 SoftwareTimerControlBlock's constructor. More...
 
 ~SoftwareTimerControlBlock ()
 SoftwareTimerControlBlock's destructor. More...
 
bool isRunning () const
 
void run (SoftwareTimerSupervisor &supervisor)
 Runs software timer's function. More...
 
void start (SoftwareTimerSupervisor &supervisor, TickClock::time_point timePoint, TickClock::duration period)
 Starts the timer. More...
 
void stop ()
 Stops the timer. More...
 
 SoftwareTimerControlBlock (const SoftwareTimerControlBlock &)=delete
 
 SoftwareTimerControlBlock (SoftwareTimerControlBlock &&)=default
 
const SoftwareTimerControlBlockoperator= (const SoftwareTimerControlBlock &)=delete
 
SoftwareTimerControlBlockoperator= (SoftwareTimerControlBlock &&)=delete
 
- Public Member Functions inherited from distortos::internal::SoftwareTimerListNode
constexpr SoftwareTimerListNode ()
 SoftwareTimerListNode's constructor. More...
 
const TickClock::time_pointgetTimePoint () const
 

Private Member Functions

void startInternal (SoftwareTimerSupervisor &supervisor, TickClock::time_point timePoint)
 Starts the timer - internal version, with no interrupt masking, no stopping and no configuration of period. More...
 
void stopInternal ()
 Stops the timer - internal version, with no interrupt masking. More...
 

Private Attributes

TickClock::duration period_
 period used to restart repetitive software timer, 0 for one-shot software timers More...
 
FunctionRunnerfunctionRunner_
 reference to runner for software timer's function More...
 
SoftwareTimerowner_
 reference to SoftwareTimer object that owns this SoftwareTimerControlBlock More...
 

Additional Inherited Members

- Public Attributes inherited from distortos::internal::SoftwareTimerListNode
estd::IntrusiveListNode node
 node for intrusive list More...
 
- Protected Member Functions inherited from distortos::internal::SoftwareTimerListNode
void setTimePoint (const TickClock::time_point timePoint)
 Sets time point of expiration. More...
 

Detailed Description

SoftwareTimerControlBlock class is a control block of software timer.

Member Typedef Documentation

◆ FunctionRunner

type of runner for software timer's function

Constructor & Destructor Documentation

◆ SoftwareTimerControlBlock()

constexpr distortos::internal::SoftwareTimerControlBlock::SoftwareTimerControlBlock ( FunctionRunner functionRunner,
SoftwareTimer owner 
)
inline

SoftwareTimerControlBlock's constructor.

Parameters
[in]functionRunneris a reference to runner for software timer's function
[in]owneris a reference to SoftwareTimer object that owns this SoftwareTimerControlBlock

◆ ~SoftwareTimerControlBlock()

distortos::internal::SoftwareTimerControlBlock::~SoftwareTimerControlBlock ( )
inline

SoftwareTimerControlBlock's destructor.

If the timer is running it is stopped.

Here is the call graph for this function:

Member Function Documentation

◆ isRunning()

bool distortos::internal::SoftwareTimerControlBlock::isRunning ( ) const
inline
Returns
true if the timer is running, false otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

void distortos::internal::SoftwareTimerControlBlock::run ( SoftwareTimerSupervisor supervisor)

Runs software timer's function.

Note
this should only be called by SoftwareTimerSupervisor::tickInterruptHandler()
Parameters
[in]supervisoris a reference to SoftwareTimerSupervisor that manages this object
Here is the call graph for this function:

◆ start()

void distortos::internal::SoftwareTimerControlBlock::start ( SoftwareTimerSupervisor supervisor,
TickClock::time_point  timePoint,
TickClock::duration  period 
)

Starts the timer.

Parameters
[in]supervisoris a reference to SoftwareTimerSupervisor to which this object will be added
[in]timePointis the time point at which the function will be executed
[in]periodis the period used to restart repetitive software timer, 0 for one-shot software timers
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startInternal()

void distortos::internal::SoftwareTimerControlBlock::startInternal ( SoftwareTimerSupervisor supervisor,
TickClock::time_point  timePoint 
)
private

Starts the timer - internal version, with no interrupt masking, no stopping and no configuration of period.

Parameters
[in]supervisoris a reference to SoftwareTimerSupervisor to which this object will be added
[in]timePointis the time point at which the function will be executed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stop()

void distortos::internal::SoftwareTimerControlBlock::stop ( )

Stops the timer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopInternal()

void distortos::internal::SoftwareTimerControlBlock::stopInternal ( )
private

Stops the timer - internal version, with no interrupt masking.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ functionRunner_

FunctionRunner& distortos::internal::SoftwareTimerControlBlock::functionRunner_
private

reference to runner for software timer's function

◆ owner_

SoftwareTimer& distortos::internal::SoftwareTimerControlBlock::owner_
private

reference to SoftwareTimer object that owns this SoftwareTimerControlBlock

◆ period_

TickClock::duration distortos::internal::SoftwareTimerControlBlock::period_
private

period used to restart repetitive software timer, 0 for one-shot software timers


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