My Project
|
#include <AbsTimer.h>
Classes | |
class | TimerId |
class | TimerId_eq |
class | TimerSig_eq |
Public Member Functions | |
AbsTimer (int signo, void(*handler)(int)) | |
AbsTimer (int signo) | |
~AbsTimer () | |
unsigned long | getResolution () |
void | setInitialDelay (unsigned long sec, unsigned long nsec) |
void | setIntervalDelay (unsigned long sec, unsigned long nsec) |
void | reArm () |
void | start (bool rearm=false) |
void | start (unsigned long sec, unsigned long nsec) |
void | stop () |
bool | isRunning () |
void | setIntegral (bool integral) |
void | checkTimer () |
void | fix (unsigned long inSec, unsigned long inNsec, unsigned long &outSec, unsigned long &outNsec) |
void | setFutureTime (unsigned long initSec, unsigned long initNanoSec, unsigned long intervalSec, unsigned long intervalNanoSec) |
Static Public Attributes | |
static std::list< TimerId > | timerList_ |
Class used to set up repetitive or one-shot timers on integral boundries relative to the system clock. For example, use this class if you want to fire events every 500 msec starting at a specific absolute time.
Author: Erik Leitch, extended from Rick Hobbs' Abstimer class Version:
,
AbsTimer::AbsTimer | ( | int | signo, |
void(*)(int) | handler | ||
) |
AbsTimer constructor
AntException |
AbsTimer::AbsTimer | ( | int | sigNo | ) |
Constructor with no handler.
....................................................................... Constructor. Create a timer for the requested signal, with no handler.
AbsTimer::~AbsTimer | ( | ) |
AbsTimer destructor
....................................................................... Destructor. Remove a timer.
void AbsTimer::checkTimer | ( | ) |
A debugging function, to print out the signals of all know timers
....................................................................... A debugging function, to print out the signals of all know timers
void AbsTimer::fix | ( | unsigned long | inSec, |
unsigned long | inNsec, | ||
unsigned long & | outSec, | ||
unsigned long & | outNsec | ||
) |
Shift time intervals around so that nsec arg is always < NSEC_PER_SEC
....................................................................... Shift time intervals around so that nsec arg is always < NSEC_PER_SEC
unsigned long AbsTimer::getResolution | ( | ) |
Returns the resolution of the clock in nsec
AntException | ....................................................................... Return the resolution of the default clock |
bool AbsTimer::isRunning | ( | ) |
void AbsTimer::reArm | ( | ) |
Re-arm a periodic timer which we want to fire relative to absolute second boundaries.
....................................................................... Re-arm a periodic integral timer.
void AbsTimer::setFutureTime | ( | unsigned long | initSec, |
unsigned long | initNanoSec, | ||
unsigned long | intervalSec, | ||
unsigned long | intervalNanoSec | ||
) |
Set up a timer to go off at a future time
AntException | ....................................................................... Private function to set up timing conditions for a timer |
void AbsTimer::setInitialDelay | ( | unsigned long | sec, |
unsigned long | nsec | ||
) |
void AbsTimer::setIntegral | ( | bool | integral | ) |
Set whether this clock should run on integral second boundaries relative to the current time.
....................................................................... Set whether this clock should run on integral second boundaries relative to the current time.
void AbsTimer::setIntervalDelay | ( | unsigned long | sec, |
unsigned long | nsec | ||
) |
Set interval delay for timer.
....................................................................... Set the interval between successive firings of this timer
void AbsTimer::start | ( | bool | reArm = false | ) |
Start the Timer. If rearm == false, setup the timer as a periodic system timer. If rearm = true, set up the timer as a one-shot timer that gets re-armed each time it expires
....................................................................... Start the timer
void AbsTimer::start | ( | unsigned long | sec, |
unsigned long | nsec | ||
) |
....................................................................... Set a timer to go off at the specified absolute time
void AbsTimer::stop | ( | ) |
Stop the Timer
AntException | ....................................................................... Stop the timer |
|
static |
A static list of timers. This list is added to by addTimer() each time a timer gets created for a unique signal
....................................................................... Intialization of the static list of known timers