Tizen Native API
|
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 () |
Start timer. | |
void | Stop () |
Stop timer. | |
void | SetInterval (unsigned int milliSec) |
Sets a new interval on the timer and starts the timer. | |
unsigned int | GetInterval () const |
Get 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) |
Create an tick Timer that emits periodic signal. | |
static Timer | DownCast (BaseHandle handle) |
Downcast a handle to Timer handle. |
Detailed Description
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.
- Since :
- 2.4
Member Typedef Documentation
typedef Signal< bool () > Dali::Timer::TimerSignalType |
Timer finished signal callback type.
- Since :
- 2.4
Constructor & Destructor Documentation
Constructor, creates an uninitialized timer.
Call New to fully construct a timer.
- Since :
- 2.4
Dali::Timer::Timer | ( | const Timer & | timer | ) |
Copy constructor.
- Since :
- 2.4
- Parameters:
-
[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.
- Since :
- 2.4
Member Function Documentation
static Timer Dali::Timer::DownCast | ( | BaseHandle | handle | ) | [static] |
unsigned int Dali::Timer::GetInterval | ( | ) | const |
Get the interval of timer.
- Returns:
- Interval in milliseconds.
- Since :
- 2.4
bool Dali::Timer::IsRunning | ( | ) | const |
static Timer Dali::Timer::New | ( | unsigned int | milliSec | ) | [static] |
Create an tick Timer that emits periodic signal.
- Since :
- 2.4
- Parameters:
-
[in] milliSec Interval in milliseconds.
- Returns:
- a new timer
Assignment operator.
- Since :
- 2.4
- Parameters:
-
[in] timer The handle to copy. This handle will point at the same implementation as the copied handle.
- Returns:
- Reference to this timer handle
void Dali::Timer::SetInterval | ( | unsigned int | milliSec | ) |
Sets a new interval on the timer and starts the timer.
Cancels the previous timer.
- Since :
- 2.4
- Parameters:
-
milliSec Interval in milliseconds.
void Dali::Timer::Start | ( | ) |
Start timer.
In case a Timer is already running it's time is reset and timer is restarted.
- Since :
- 2.4
void Dali::Timer::Stop | ( | ) |
Stop timer.
- Since :
- 2.4
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.
- Returns:
- The signal to Connect() with.
- Since :
- 2.4