Tizen Native API

Mechanism to issue simple periodic or one-shot events. More...

Inheritance diagram for Dali::Timer:
Dali::BaseHandle

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.
Timeroperator= (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.
TimerSignalTypeTickSignal ()
 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

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]timerThe 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]

Downcast a handle to Timer handle.

If handle points to a Timer object the downcast produces a valid handle. If not the returned handle is left uninitialized.

Since :
2.4
Parameters:
[in]handleto An object
Returns:
handle to a Timer object or an uninitialized handle
unsigned int Dali::Timer::GetInterval ( ) const

Get the interval of timer.

Returns:
Interval in milliseconds.
Since :
2.4
bool Dali::Timer::IsRunning ( ) const

Tells whether timer is running.

Since :
2.4
Returns:
Whether Timer is started or not.
static Timer Dali::Timer::New ( unsigned int  milliSec) [static]

Create an tick Timer that emits periodic signal.

Since :
2.4
Parameters:
[in]milliSecInterval in milliseconds.
Returns:
a new timer
Timer& Dali::Timer::operator= ( const Timer timer)

Assignment operator.

Since :
2.4
Parameters:
[in]timerThe 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:
milliSecInterval in milliseconds.

Start timer.

In case a Timer is already running it's time is reset and timer is restarted.

Since :
2.4

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