Tizen Native API
6.5
|
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 | Pause () |
Pauses timer. | |
void | Resume () |
Resumes timer. | |
void | SetInterval (unsigned int milliSec) |
Sets a new interval on the timer and starts the timer. | |
void | SetInterval (unsigned int milliSec, bool restart) |
Sets a new interval on the timer with option to restart 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. |
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, DALi version 1.0.0
Member Typedef Documentation
typedef Signal< bool () > Dali::Timer::TimerSignalType |
Timer finished signal callback type.
- Since:
- 2.4, DALi version 1.0.0
Constructor & Destructor Documentation
Constructor, creates an uninitialized timer.
Call New to fully construct a timer.
- Since:
- 2.4, DALi version 1.0.0
Dali::Timer::Timer | ( | const Timer & | timer | ) |
Copy constructor.
- Since:
- 2.4, DALi version 1.0.0
- 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, DALi version 1.0.0
Member Function Documentation
static Timer Dali::Timer::DownCast | ( | BaseHandle | handle | ) | [static] |
unsigned int Dali::Timer::GetInterval | ( | ) | const |
Gets the interval of timer.
- Since:
- 2.4, DALi version 1.0.0
- Returns:
- Interval in milliseconds
bool Dali::Timer::IsRunning | ( | ) | const |
Tells whether timer is running.
- Since:
- 2.4, DALi version 1.0.0
- Returns:
- Whether Timer is started or not
static Timer Dali::Timer::New | ( | unsigned int | milliSec | ) | [static] |
Creates a tick Timer that emits periodic signal.
- Since:
- 2.4, DALi version 1.0.0
- Parameters:
-
[in] milliSec Interval in milliseconds
- Returns:
- A new timer
Assignment operator.
- Since:
- 2.4, DALi version 1.0.0
- 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::Pause | ( | ) |
Pauses timer.
- Since:
- 5.0, DALi version 1.3.41
void Dali::Timer::Resume | ( | ) |
Resumes timer.
- Since:
- 5.0, DALi version 1.3.41
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, DALi version 1.0.0
- Parameters:
-
[in] milliSec Interval in milliseconds
void Dali::Timer::SetInterval | ( | unsigned int | milliSec, |
bool | restart | ||
) |
Sets a new interval on the timer with option to restart the timer.
Cancels the previous timer.
- Since:
- 5.0, DALi version 1.3.41
- Parameters:
-
[in] milliSec Interval in milliseconds [in] restart Flag to set enabled to restart or not.
void Dali::Timer::Start | ( | ) |
Starts timer.
In case a Timer is already running, its time is reset and timer is restarted.
- Since:
- 2.4, DALi version 1.0.0
void Dali::Timer::Stop | ( | ) |
Stops timer.
- Since:
- 2.4, DALi version 1.0.0
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, DALi version 1.0.0