Руслан Урядинский / libuavcan

Dependents:   UAVCAN UAVCAN_Subscriber

Embed: (wiki syntax)

« Back to documentation index

TimerBase Class Reference

TimerBase Class Reference

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

#include <timer.hpp>

Inherits uavcan::DeadlineHandler.

Inherited by BackgroundSpinner, TimerEventForwarder< TimerCallback >, ClusterManager [private], RaftCore [private], NodeDiscoverer [private], DynamicNodeIDClient [private], FirmwareUpdateTrigger [private], NodeInfoRetriever [private], NodeStatusProvider [private], PanicBroadcaster [private], TimerEventForwarder< Callback_ >, and BasicFileServerBackend::FDCache [protected].

Public Member Functions

void startOneShotWithDeadline (MonotonicTime deadline)
 Various ways to start the timer - periodically or once.
MonotonicDuration getPeriod () const
 Returns period if the timer is in periodic mode.
virtual void handleTimerEvent (const TimerEvent &event)=0
 Implement this method in your class to receive callbacks.

Detailed Description

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

Definition at line 46 of file timer.hpp.


Member Function Documentation

MonotonicDuration getPeriod (  ) const

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.

virtual void handleTimerEvent ( const TimerEvent event ) [pure virtual]

Implement this method in your class to receive callbacks.

void 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.