CARMA C++
sza::util::AbsTimer Class Reference

Class used to set up repetitive or one-shot timers on integral boundries relative to the system clock. More...

#include <carma/szautil/AbsTimer.h>

Classes

class  TimerId
 A class for storing information about a known Timer. More...
 
class  TimerId_eq
 A predicate for testing if a timer's id matches a requested id. More...
 
class  TimerSig_eq
 A predicate for testing if a timer's signal matches a requested signal. More...
 

Public Member Functions

 AbsTimer (int signo, void(*handler)(int))
 AbsTimer constructor. More...
 
 AbsTimer (int signo)
 Constructor with no handler. More...
 
void checkTimer ()
 A debugging function, to print out the signals of all know timers. More...
 
unsigned long getResolution ()
 Returns the resolution of the clock in nsec. More...
 
bool isRunning ()
 Query if this timer is running. More...
 
void reArm ()
 Re-arm a periodic timer which we want to fire relative to absolute second boundaries. More...
 
void setInitialDelay (unsigned long sec, unsigned long nsec)
 Set initial delay when timer is to start from the moment its start() method is called. More...
 
void setIntegral (bool integral)
 Set whether this clock should run on integral second boundaries relative to the current time. More...
 
void setIntervalDelay (unsigned long sec, unsigned long nsec)
 Set interval delay for timer. More...
 
void start ()
 Start the Timer. More...
 
void stop ()
 Stop the Timer. More...
 
 ~AbsTimer ()
 AbsTimer destructor. More...
 

Static Public Attributes

static std::list< TimerIdtimerList_
 A static list of timers. More...
 

Detailed Description

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:

Revision:
1.1

,

Date:
2010/12/13 21:06:28

Definition at line 52 of file AbsTimer.h.

Constructor & Destructor Documentation

sza::util::AbsTimer::AbsTimer ( int  signo,
void(*)(int)  handler 
)

AbsTimer constructor.

Exceptions
AntException
sza::util::AbsTimer::AbsTimer ( int  signo)

Constructor with no handler.

sza::util::AbsTimer::~AbsTimer ( )

AbsTimer destructor.

Member Function Documentation

void sza::util::AbsTimer::checkTimer ( )

A debugging function, to print out the signals of all know timers.

unsigned long sza::util::AbsTimer::getResolution ( )

Returns the resolution of the clock in nsec.

Exceptions
AntException
bool sza::util::AbsTimer::isRunning ( )

Query if this timer is running.

Returns true after start() has been called, false before start() has been called, and false after a call to stop();

void sza::util::AbsTimer::reArm ( )

Re-arm a periodic timer which we want to fire relative to absolute second boundaries.

void sza::util::AbsTimer::setInitialDelay ( unsigned long  sec,
unsigned long  nsec 
)

Set initial delay when timer is to start from the moment its start() method is called.

Remember, sec is in absolute time from start of epoch.

void sza::util::AbsTimer::setIntegral ( bool  integral)

Set whether this clock should run on integral second boundaries relative to the current time.

void sza::util::AbsTimer::setIntervalDelay ( unsigned long  sec,
unsigned long  nsec 
)

Set interval delay for timer.

void sza::util::AbsTimer::start ( )

Start the Timer.

void sza::util::AbsTimer::stop ( )

Stop the Timer.

Exceptions
AntException

Member Data Documentation

std::list<TimerId> sza::util::AbsTimer::timerList_
static

A static list of timers.

This list is added to by addTimer() each time a timer gets created for a unique signal

Definition at line 104 of file AbsTimer.h.


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