#include <src/orxonox/tools/Timer.h>
Public Member Functions | |
void | addTime (float time) |
Gives the Timer some extra time. | |
void | deleteExecutor () |
Deletes the executor. | |
float | getRemainingTime () const |
Returns the remaining time until the Timer calls the function. | |
bool | isActive () const |
Returns true if the Timer is active (= not stoped, not paused). | |
void | pauseTimer () |
Pauses the Timer - it will continue with the actual state if you unpause it. | |
void | removeTime (float time) |
Decreases the remaining time of the Timer. | |
void | run () const |
Executes the executor. | |
void | setInterval (float interval) |
Sets the interval of the Timer. | |
void | setLoop (bool bLoop) |
Sets bLoop to a given value. | |
void | startTimer () |
Starts the Timer: Function-call after 'interval' seconds. | |
void | stopTimer () |
Stops the Timer. | |
void | tick (const Clock &time) |
Updates the timer before the frames are rendered. | |
void | unpauseTimer () |
Unpauses the Timer - continues with the given state. | |
~TimerBase () | |
Deletes the executor. | |
Protected Member Functions | |
TimerBase () | |
Constructor: Sets the default-values. | |
Protected Attributes | |
bool | bActive_ |
If true, the Timer ticks and calls the function if the time's up. | |
bool | bKillAfterCall_ |
If true the timer gets deleted after it called the function. | |
bool | bLoop_ |
If true, the function gets called every 'interval' seconds. | |
Executor * | executor_ |
The executor of the function that should be called when the time expires. | |
long long | interval_ |
The time-interval in micro seconds. | |
long long | time_ |
Internal variable, counting the time till the next function-call. |
orxonox::TimerBase::~TimerBase | ( | ) |
orxonox::TimerBase::TimerBase | ( | ) | [protected] |
Constructor: Sets the default-values.
References bActive_, bKillAfterCall_, bLoop_, executor_, interval_, RegisterObject, and time_.
void orxonox::TimerBase::addTime | ( | float | time | ) | [inline] |
void orxonox::TimerBase::deleteExecutor | ( | ) |
Deletes the executor.
References executor_.
Referenced by orxonox::StaticTimer::setTimer(), orxonox::Timer< orxonox::FadeoutText >::setTimer(), and ~TimerBase().
float orxonox::TimerBase::getRemainingTime | ( | ) | const [inline] |
bool orxonox::TimerBase::isActive | ( | void | ) | const [inline] |
void orxonox::TimerBase::pauseTimer | ( | ) | [inline] |
Pauses the Timer - it will continue with the actual state if you unpause it.
void orxonox::TimerBase::removeTime | ( | float | time | ) | [inline] |
void orxonox::TimerBase::run | ( | ) | const |
void orxonox::TimerBase::setInterval | ( | float | interval | ) | [inline] |
Sets the interval of the Timer.
interval | The interval |
Referenced by orxonox::StaticTimer::setTimer(), and orxonox::Timer< orxonox::FadeoutText >::setTimer().
void orxonox::TimerBase::setLoop | ( | bool | bLoop | ) | [inline] |
Sets bLoop to a given value.
bLoop | True = loop |
void orxonox::TimerBase::startTimer | ( | ) | [inline] |
Starts the Timer: Function-call after 'interval' seconds.
void orxonox::TimerBase::tick | ( | const Clock & | time | ) |
Updates the timer before the frames are rendered.
References bActive_, bKillAfterCall_, bLoop_, orxonox::Clock::getDeltaTimeMicroseconds(), orxonox::TimeFactorListener::getTimeFactor(), interval_, run(), stopTimer(), and time_.
void orxonox::TimerBase::unpauseTimer | ( | ) | [inline] |
Unpauses the Timer - continues with the given state.
bool orxonox::TimerBase::bActive_ [protected] |
If true, the Timer ticks and calls the function if the time's up.
Referenced by orxonox::StaticTimer::setTimer(), orxonox::Timer< orxonox::FadeoutText >::setTimer(), tick(), and TimerBase().
bool orxonox::TimerBase::bKillAfterCall_ [protected] |
If true the timer gets deleted after it called the function.
Referenced by run(), orxonox::StaticTimer::setTimer(), orxonox::Timer< orxonox::FadeoutText >::setTimer(), tick(), and TimerBase().
bool orxonox::TimerBase::bLoop_ [protected] |
If true, the function gets called every 'interval' seconds.
Referenced by orxonox::StaticTimer::setTimer(), orxonox::Timer< orxonox::FadeoutText >::setTimer(), tick(), and TimerBase().
Executor* orxonox::TimerBase::executor_ [protected] |
The executor of the function that should be called when the time expires.
Referenced by deleteExecutor(), run(), orxonox::StaticTimer::setTimer(), orxonox::Timer< orxonox::FadeoutText >::setTimer(), and TimerBase().
long long orxonox::TimerBase::interval_ [protected] |
The time-interval in micro seconds.
Referenced by orxonox::StaticTimer::setTimer(), orxonox::Timer< orxonox::FadeoutText >::setTimer(), tick(), and TimerBase().
long long orxonox::TimerBase::time_ [protected] |
Internal variable, counting the time till the next function-call.
Referenced by orxonox::StaticTimer::setTimer(), orxonox::Timer< orxonox::FadeoutText >::setTimer(), tick(), and TimerBase().