Tizen Native API
4.0
|
Mechanism to issue simple periodic or one-shot events. More...
Public Types | |
typedef Signal< bool() > | TimerSignalType |
Timer finished signal callback type. | |
Public Member Functions | |
Timer () | |
Constructor, creates an uninitialized timer. | |
Timer (const Timer &timer) | |
Copy constructor. | |
Timer & | operator= (const Timer &timer) |
Assignment operator. | |
~Timer () | |
Destructor. | |
void | Start () |
Starts timer. | |
void | Stop () |
Stops timer. | |
void | SetInterval (unsigned int milliSec) |
Sets a new interval on the timer and starts the timer. | |
unsigned int | GetInterval () const |
Gets the interval of timer. | |
bool | IsRunning () const |
Tells whether timer is running. | |
TimerSignalType & | TickSignal () |
Signal emitted after specified time interval. | |
Static Public Member Functions | |
static Timer | New (unsigned int milliSec) |
Creates a tick Timer that emits periodic signal. | |
static Timer | DownCast (BaseHandle handle) |
Downcasts a handle to Timer handle. |
Mechanism to issue simple periodic or one-shot events.
Timer is provided for application developers to be able to issue simple periodic or one-shot events. Please note that timer callback functions should return as soon as possible, because they block the next SignalTick. Please note that timer signals are not in sync with Dali's render timer.
This class is a handle class so it can be stack allocated and used as a member.
typedef Signal< bool () > Dali::Timer::TimerSignalType |
Timer finished signal callback type.
Constructor, creates an uninitialized timer.
Call New to fully construct a timer.
Dali::Timer::Timer | ( | const Timer & | timer | ) |
Copy constructor.
[in] | timer | The handle to copy. The copied handle will point at the same implementation |
Destructor.
This is non-virtual since derived Handle types must not contain data or virtual methods.
static Timer Dali::Timer::DownCast | ( | BaseHandle | handle | ) | [static] |
unsigned int Dali::Timer::GetInterval | ( | ) | const |
Gets the interval of timer.
bool Dali::Timer::IsRunning | ( | ) | const |
Tells whether timer is running.
static Timer Dali::Timer::New | ( | unsigned int | milliSec | ) | [static] |
Creates a tick Timer that emits periodic signal.
[in] | milliSec | Interval in milliseconds |
Assignment operator.
[in] | timer | The handle to copy. This handle will point at the same implementation as the copied handle |
void Dali::Timer::SetInterval | ( | unsigned int | milliSec | ) |
Sets a new interval on the timer and starts the timer.
Cancels the previous timer.
[in] | milliSec | Interval in milliseconds |
void Dali::Timer::Start | ( | ) |
Starts timer.
In case a Timer is already running, its time is reset and timer is restarted.
void Dali::Timer::Stop | ( | ) |
Stops timer.
Signal emitted after specified time interval.
The return of the callback decides whether signal emission stops or continues. If the callback function returns false, emission will stop and if true, it will continue. This return value is ignored for one-shot events, which will always stop after the first execution.