#include <Timer.h>
Inherits Object.
Inheritance diagram for Timer:


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< SingleShot > | SingleShotList |
| typedef set< Timer * > | TimerList |
Private Member Functions | |
| int | shoot () |
Static Private Member Functions | |
| static int | singleShoot () |
| static unsigned int | since (const struct timeval ×tamp) |
| 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 |
Definition at line 25 of file Timer.h.
typedef vector<SingleShot> Timer::SingleShotList [private] |
typedef set<Timer *> Timer::TimerList [private] |
| 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] |
| int Timer::setPeriodical | ( | const bool | yes = true |
) |
| bool Timer::periodical | ( | ) | const |
| int Timer::setTime | ( | const unsigned int | 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().
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] |
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] |
1.5.1