My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::util::AbsTimer Class Reference

#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< TimerIdtimerList_
 

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

,

Date:
2009/07/06 23:57:24

Constructor & Destructor Documentation

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

AbsTimer constructor

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

Member Function Documentation

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

Exceptions
AntException....................................................................... Return the resolution of the default clock
bool 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();

....................................................................... A query function to see if this timer has been started

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

Exceptions
AntException....................................................................... Private function to set up timing conditions for a timer
void 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.

....................................................................... Set the amount of time we will delay after calling start() before this timer goes off

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

Exceptions
AntException....................................................................... Stop the timer

Member Data Documentation

list< AbsTimer::TimerId > 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

....................................................................... Intialization of the static list of known timers


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