Developer Documentation
RAVL, Recognition And Vision Library
USER HOME PAGE CLASS LIST CONTENTS
Ravl - OS - Time - DeadLineTimerC
 

  PUBLIC
DeadLineTimerC::DeadLineTimerC(bool)
DeadLineTimerC::~DeadLineTimerC(void)
DeadLineTimerC::DeadLineTimerC(const DateC &,bool)
DeadLineTimerC::DeadLineTimerC(RealT,bool)
DeadLineTimerC::Stop(void)
DeadLineTimerC::Reset(RealT)
DeadLineTimerC::Reset(const DateC &)
DeadLineTimerC::IsTimeUp(void) const
DeadLineTimerC::IsRunning(void) const
DeadLineTimerC::IsVirtual(void) const
DeadLineTimerC::Remaining(void) const
DeadLineTimerC::WaitForIt(void) const

   DeadLineTimerC   
 
Dead line timer.
 
include "Ravl/OS/DeadLineTimer.hh"
Created:// 
Source file:Ravl/OS/Time/DeadLineTimer.hh
User Level:Normal
Library:RavlOS
Example:exDeadLine.cc
In Scope:RavlN

Comments:
When the timer is started the timesUp flag is set to false, when the time expires the flag is set to true. Note the timer flag is always true if the timer is not running.

You should not expect a resolution in time better than 1ms. The actual resolution depends on the system the code is run on and may be worse than this. This is a SMALL object.

Variables:
bool virt;
Virtual timer ?

bool timesUp;

IntT id;

Methods:
DeadLineTimerC(bool useVirt = false)
Default constructor.

~DeadLineTimerC()
Destructor.

DeadLineTimerC(const DateC & timetoGo,bool useVirt = false)
Constructor for an absolute time.

DeadLineTimerC(RealT timetoGo,bool useVirt = false)
Constructor for a relative (to now) time.
Dead line will expire in 'timetoGo' seonds.

void Stop()
Stop timer.
This will set the timesUp flag, and free the deadline timer.

bool Reset(RealT time)
Reset timer with 'time' left before deadline.
Will return false if deadline setup failed, or if the time as expired before the setup is completed. Any time smaller than zero is treated as infinite. NB. There is currently a maximum number of 64 deadline timers that can be active at any time.

This isn't a trivial routine, it involves several system calles, and alot of mucking about. Avoid calling it excessively.


bool Reset(const DateC & time)
Set the deadline for 'time'
Will return false if deadline setup failed, or if the time as expired before the setup is completed. NB. There is currently a maximum number of 64 deadline timers that can be active at any time.

This isn't a trivial routine, it involves several system calles, and alot of mucking about. Avoid calling it excessively.


const bool & IsTimeUp() const
Has dead line been reached ?

bool IsRunning() const
Is timer still running ?

bool IsVirtual() const
Is virtual timer.

RealT Remaining() const
Get an estimate of the time remaining on deadline.
If dead line has expired 0 is returned.

bool WaitForIt() const
Wait for deadline to expire.
May return false if no deadline pending, which could happen if the timer expires before the call.


Maintainer:Charles Galambos, Created: //, Documentation by CxxDoc: Tue Aug 13 09:59:30 2002