Timer Class Reference

#include <Timer.h>

Inherits Object.

Inheritance diagram for Timer:

Inheritance graph
[legend]
Collaboration diagram for Timer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Timer (const unsigned int msTime, const bool periodical=true)
virtual ~Timer ()
int setPeriodical (const bool yes=true)
bool periodical () const
int setTime (const unsigned int msTime)
unsigned int time () const
virtual int suspend ()
virtual int resume ()
unsigned int sinceShot () const
unsigned int tillShot () const
bool ready () const
 SIGNAL (suspended)
 SIGNAL (resumed)
 SIGNAL (shot)

Static Public Member Functions

static int singleShot (const unsigned int msTime, Object *slotObject, SlotMethod slotMethod)
static int list (String &text)
static int listSingleShot (String &text)

Private Types

typedef vector< SingleShotSingleShotList
typedef set< Timer * > TimerList

Private Member Functions

int shoot ()

Static Private Member Functions

static int singleShoot ()
static unsigned int since (const struct timeval &timestamp)
static int shootTimers ()

Private Attributes

bool _periodical
unsigned int _msTime
timeval _lastShotTimestamp

Static Private Attributes

static SingleShotList _singleShots
static TimerList _timers

Friends

class Core

Classes

struct  SingleShot

Detailed Description

Definition at line 25 of file Timer.h.


Member Typedef Documentation

typedef vector<SingleShot> Timer::SingleShotList [private]

Definition at line 69 of file Timer.h.

typedef set<Timer *> Timer::TimerList [private]

Definition at line 71 of file Timer.h.


Constructor & Destructor Documentation

Timer::Timer ( const unsigned int  msTime,
const bool  periodical = true 
)

Definition at line 16 of file Timer.cpp.

References _lastShotTimestamp, _msTime, _periodical, _timers, and periodical().

Timer::~Timer (  )  [virtual]

Definition at line 25 of file Timer.cpp.

References _timers, ERROR, and MSG_INTEGRITY_FAILURE.


Member Function Documentation

int Timer::setPeriodical ( const bool  yes = true  ) 

Definition at line 34 of file Timer.cpp.

References _periodical, and OK.

bool Timer::periodical (  )  const

Definition at line 40 of file Timer.cpp.

References _periodical.

Referenced by Timer().

int Timer::setTime ( const unsigned int  msTime  ) 

Definition at line 45 of file Timer.cpp.

References _msTime, and OK.

unsigned int Timer::time (  )  const

Definition at line 51 of file Timer.cpp.

References _msTime.

int Timer::singleShot ( const unsigned int  msTime,
Object slotObject,
SlotMethod  slotMethod 
) [static]

Definition at line 56 of file Timer.cpp.

References _singleShots, ERROR, Object::id(), MSG_NULL_POINTER, MSG_TIMER_CANNOT_GET_TIME, and OK.

int Timer::suspend (  )  [virtual]

Reimplemented from Object.

Definition at line 73 of file Timer.cpp.

References EMIT, ERROR_BACKTRACE(), FAILED(), OK, Object::suspend(), and Object::suspended().

Referenced by Core::suspendTimers().

int Timer::resume (  )  [virtual]

Reimplemented from Object.

Definition at line 88 of file Timer.cpp.

References EMIT, ERROR_BACKTRACE(), FAILED(), OK, Object::resume(), and Object::suspended().

Referenced by Core::resumeTimers().

unsigned int Timer::sinceShot (  )  const

Definition at line 103 of file Timer.cpp.

References _lastShotTimestamp, and since().

Referenced by ready(), and tillShot().

unsigned int Timer::tillShot (  )  const

Definition at line 108 of file Timer.cpp.

References _lastShotTimestamp, _msTime, _periodical, and sinceShot().

Referenced by listSingleShot().

bool Timer::ready (  )  const

Definition at line 117 of file Timer.cpp.

References _lastShotTimestamp, _msTime, _periodical, and sinceShot().

Referenced by shoot().

int Timer::list ( String text  )  [static]

Definition at line 126 of file Timer.cpp.

References _timers, String::eol(), OK, String::sprintf(), and TIMER_COLOR_TITLE().

int Timer::listSingleShot ( String text  )  [static]

Definition at line 148 of file Timer.cpp.

References _singleShots, String::eol(), OK, since(), String::sprintf(), tillShot(), and TIMER_COLOR_TITLE().

Timer::SIGNAL ( suspended   ) 

Timer::SIGNAL ( resumed   ) 

Timer::SIGNAL ( shot   ) 

int Timer::shoot (  )  [private]

Definition at line 174 of file Timer.cpp.

References _lastShotTimestamp, EMIT, ERROR, MSG_TIMER_CANNOT_GET_TIME, OK, ready(), and Object::suspended().

int Timer::singleShoot (  )  [static, private]

Definition at line 187 of file Timer.cpp.

References _singleShots, ERROR_BACKTRACE(), FAILED(), Object::get(), OK, since(), and Object::suspended().

Referenced by shootTimers().

unsigned int Timer::since ( const struct timeval &  timestamp  )  [static, private]

Definition at line 220 of file Timer.cpp.

References ERROR, and MSG_TIMER_CANNOT_GET_TIME.

Referenced by listSingleShot(), sinceShot(), and singleShoot().

int Timer::shootTimers (  )  [static, private]

Definition at line 232 of file Timer.cpp.

References _timers, ERROR_BACKTRACE(), FAILED(), OK, and singleShoot().

Referenced by Core::dispatch().


Friends And Related Function Documentation

friend class Core [friend]

Reimplemented from Object.

Definition at line 28 of file Timer.h.


Member Data Documentation

bool Timer::_periodical [private]

Definition at line 79 of file Timer.h.

Referenced by periodical(), ready(), setPeriodical(), tillShot(), and Timer().

unsigned int Timer::_msTime [private]

Definition at line 80 of file Timer.h.

Referenced by ready(), setTime(), tillShot(), time(), and Timer().

struct timeval Timer::_lastShotTimestamp [private]

Definition at line 81 of file Timer.h.

Referenced by ready(), shoot(), sinceShot(), tillShot(), and Timer().

Timer::SingleShotList Timer::_singleShots [static, private]

Definition at line 83 of file Timer.h.

Referenced by listSingleShot(), singleShoot(), and singleShot().

Timer::TimerList Timer::_timers [static, private]

Definition at line 85 of file Timer.h.

Referenced by list(), shootTimers(), Timer(), and ~Timer().


The documentation for this class was generated from the following files:
Generated on Thu Sep 6 20:14:04 2007 for Pylon Application Platform by  doxygen 1.5.1