Public Member Functions | Private Member Functions | Private Attributes | List of all members
uavcan::TimerBase Class Referenceabstract

#include <timer.hpp>

Inheritance diagram for uavcan::TimerBase:
Inheritance graph
[legend]

Public Member Functions

MonotonicTime getDeadline () const
 
MonotonicDuration getPeriod () const
 
SchedulergetScheduler () const
 
virtual void handleTimerEvent (const TimerEvent &event)=0
 
bool isRunning () const
 
void startOneShotWithDeadline (MonotonicTime deadline)
 
void startOneShotWithDelay (MonotonicDuration delay)
 
void startPeriodic (MonotonicDuration period)
 
void stop ()
 
 TimerBase (INode &node)
 

Private Member Functions

virtual void handleDeadline (MonotonicTime current)
 
- Private Member Functions inherited from uavcan::DeadlineHandler
void generateDeadlineImmediately ()
 
MonotonicTime getDeadline () const
 
SchedulergetScheduler () const
 
bool isRunning () const
 
void startWithDeadline (MonotonicTime deadline)
 
void startWithDelay (MonotonicDuration delay)
 
void stop ()
 
 DeadlineHandler (Scheduler &scheduler)
 
virtual ~DeadlineHandler ()
 
- Private Member Functions inherited from uavcan::LinkedListNode< DeadlineHandler >
DeadlineHandlergetNextListNode () const
 
void setNextListNode (DeadlineHandler *node)
 
 LinkedListNode ()
 
 ~LinkedListNode ()
 

Private Attributes

MonotonicDuration period_
 
- Private Attributes inherited from uavcan::DeadlineHandler
Schedulerscheduler_
 

Detailed Description

Inherit this class if you need a timer callback method in your class.

Definition at line 46 of file timer.hpp.

Constructor & Destructor Documentation

◆ TimerBase()

uavcan::TimerBase::TimerBase ( INode node)
inlineexplicit

Definition at line 58 of file timer.hpp.

Member Function Documentation

◆ getDeadline()

MonotonicTime uavcan::DeadlineHandler::getDeadline
inline

Definition at line 41 of file scheduler.hpp.

◆ getPeriod()

MonotonicDuration uavcan::TimerBase::getPeriod ( ) const
inline

Returns period if the timer is in periodic mode. Returns infinite duration if the timer is in one-shot mode or stopped.

Definition at line 77 of file timer.hpp.

◆ getScheduler()

Scheduler& uavcan::DeadlineHandler::getScheduler
inline

Definition at line 42 of file scheduler.hpp.

◆ handleDeadline()

void uavcan::TimerBase::handleDeadline ( MonotonicTime  current)
privatevirtual

Implements uavcan::DeadlineHandler.

Definition at line 13 of file uc_timer.cpp.

◆ handleTimerEvent()

virtual void uavcan::TimerBase::handleTimerEvent ( const TimerEvent event)
pure virtual

◆ isRunning()

bool uavcan::DeadlineHandler::isRunning

Definition at line 32 of file uc_scheduler.cpp.

◆ startOneShotWithDeadline()

void uavcan::TimerBase::startOneShotWithDeadline ( MonotonicTime  deadline)

Various ways to start the timer - periodically or once. If it is running already, it will be restarted. If the deadline is in the past, the event will fire immediately. In periodic mode the timer does not accumulate error over time.

Definition at line 28 of file uc_timer.cpp.

◆ startOneShotWithDelay()

void uavcan::TimerBase::startOneShotWithDelay ( MonotonicDuration  delay)

Definition at line 35 of file uc_timer.cpp.

◆ startPeriodic()

void uavcan::TimerBase::startPeriodic ( MonotonicDuration  period)

Definition at line 42 of file uc_timer.cpp.

◆ stop()

void uavcan::DeadlineHandler::stop

Definition at line 27 of file uc_scheduler.cpp.

Member Data Documentation

◆ period_

MonotonicDuration uavcan::TimerBase::period_
private

Definition at line 48 of file timer.hpp.


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


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:05