C++ TargetRTS
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Attributes | Friends | List of all members
RTTimerId Class Reference

An identifier for a timer request. More...

#include <RTTimerId.h>

Public Member Functions

 RTTimerId (RTTimerNode *)
 
 RTTimerId (const RTTimerId &)
 
RTTimerIdoperator= (const RTTimerId &)
 
RTTimerIdoperator= (RTTimerNode *)
 
int operator== (const RTTimerId &) const
 
int operator!= (const RTTimerId &) const
 
int isValid (void) const
 Check if this object identifies a valid timer request.
 
int timeouts (void) const
 Get the number of timeout intervals that passed before the timeout of a periodic timer was actually processed.
 

Static Public Attributes

static const RTObject_class classData
 Type descriptor for an RTTimerId.
 

Friends

class RTTimerNode
 

Detailed Description

An identifier for a timer request.

The functions in Timing::Base which start timers (Timing::Base::informIn(), Timing::Base::informAt() and Timing::Base::informEvery()) return an object of this class, and you can use that object to interact with the started timer (for example to cancel it).

Member Function Documentation

◆ isValid()

int RTTimerId::isValid ( void  ) const

Check if this object identifies a valid timer request.

This function does not return the exact state of the timer. For example, it does not tell you if the timer is still active, or if the timer has already timed out but the timeout event has not yet been delivered; or if the timer has been canceled or a non-periodic timer has timed out. You should call this function before performing any operations on the timer, to ensure that it still is valid.

Returns
1 if the timer id identifies a valid timer request, 0 otherwise.

◆ timeouts()

int RTTimerId::timeouts ( void  ) const

Get the number of timeout intervals that passed before the timeout of a periodic timer was actually processed.

Calling this function is a way to measure the accuracy of a periodic timer. For more information see Timing::Base::timeouts().

Returns
A measurement of the number of missed timeout intervals since the last time the timer expired. If the timer never has expired 0 is returned. If no interval is missed (i.e. the timer expired at the specified time) 1 is returned. The higher number returned, the less accurate is the timer.

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