Tizen Native API  4.0
Dali::Timer Class Reference

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

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]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, DALi version 1.0.0

Member Function Documentation

static Timer Dali::Timer::DownCast ( BaseHandle  handle) [static]

Downcasts 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, DALi version 1.0.0
Parameters:
[in]handleto An object
Returns:
handle to a Timer object or an uninitialized handle
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]milliSecInterval in milliseconds
Returns:
A new timer
Timer& Dali::Timer::operator= ( const Timer timer)

Assignment operator.

Since:
2.4, DALi version 1.0.0
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, DALi version 1.0.0
Parameters:
[in]milliSecInterval in milliseconds

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

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