Dali 3D User Interface Engine
List of all members | Public Types | Public Member Functions | Private Attributes
Dali::Internal::Message< T > Class Template Reference

Templated message which calls a member function of an object. More...

#include <message.h>

Inheritance diagram for Dali::Internal::Message< T >:
Inheritance graph
Collaboration diagram for Dali::Internal::Message< T >:
Collaboration graph

Public Types

typedef void(T::* MemberFunction )()

Public Member Functions

 Message (const T *obj, MemberFunction member)
 Create a message. More...
virtual ~Message ()
 Virtual destructor. More...
virtual void Process (BufferIndex)
 Called to process the message. More...
- Public Member Functions inherited from Dali::Internal::MessageBase
 MessageBase ()
 Construct the message base. More...
virtual ~MessageBase ()
 Virtual destructor. More...

Private Attributes

T * object
MemberFunction memberFunction

Detailed Description

template<typename T>
class Dali::Internal::Message< T >

Templated message which calls a member function of an object.

This allows nodes etc. to be modified in a thread-safe manner, when the update occurs in a separate thread. The object lifetime must controlled i.e. not destroyed before the message is processed.

Definition at line 70 of file message.h.

Member Typedef Documentation

template<typename T >
typedef void(T::* Dali::Internal::Message< T >::MemberFunction)()

Definition at line 74 of file message.h.

Constructor & Destructor Documentation

template<typename T >
Dali::Internal::Message< T >::Message ( const T *  obj,
MemberFunction  member 

Create a message.

The object is expected to be const in the thread which sends this message. However it can be modified when Process() is called in a different thread.
[in]objThe object to be updated in a separate thread.
[in]memberThe member function of the object.

Definition at line 83 of file message.h.

template<typename T >
virtual Dali::Internal::Message< T >::~Message ( )

Virtual destructor.

Definition at line 93 of file message.h.

Member Function Documentation

template<typename T >
virtual void Dali::Internal::Message< T >::Process ( BufferIndex  )

Called to process the message.

[in]bufferIndexThe current update/render buffer index (depending on which thread processes the message).

Implements Dali::Internal::MessageBase.

Definition at line 100 of file message.h.

References DALI_ASSERT_DEBUG, and Dali::Internal::Message< T >::memberFunction.

Member Data Documentation

template<typename T >
MemberFunction Dali::Internal::Message< T >::memberFunction

Definition at line 109 of file message.h.

Referenced by Dali::Internal::Message< T >::Process().

template<typename T >
T* Dali::Internal::Message< T >::object

Definition at line 108 of file message.h.

The documentation for this class was generated from the following file:
Dali Docs Home
Read more about Dali