Dali 3D User Interface Engine
List of all members | Public Member Functions | Private Member Functions | Private Attributes
Dali::Internal::Adaptor::TriggerEvent Class Reference

The TriggerEvent class is used to send events between threads. More...

#include <trigger-event.h>

Inheritance diagram for Dali::Internal::Adaptor::TriggerEvent:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::Adaptor::TriggerEvent:
Collaboration graph
[legend]

Public Member Functions

 TriggerEvent (CallbackBase *callback, TriggerEventInterface::Options options)
 Constructor Creates an event file descriptor and starts a GSource which reads from the file descriptor when there is data. More...
 
 ~TriggerEvent ()
 Destructor. More...
 
void Trigger ()
 Triggers the event. More...
 

Private Member Functions

void Triggered (FileDescriptorMonitor::EventType eventBitMask)
 Called when our event file descriptor has been written to. More...
 

Private Attributes

FileDescriptorMonitormFileDescriptorMonitor
 
CallbackBasemCallback
 
int mFileDescriptor
 
TriggerEventInterface::Options mOptions
 

Detailed Description

The TriggerEvent class is used to send events between threads.

For example, this can be used to wake up one thread from another thread.

Typically, these should be created in the application thread.

The observer will be informed whenever the event is triggered.

The implementation of TriggerEvent uses an event file descriptor.

Definition at line 49 of file trigger-event.h.

Constructor & Destructor Documentation

Dali::Internal::Adaptor::TriggerEvent::TriggerEvent ( CallbackBase callback,
TriggerEventInterface::Options  options 
)

Constructor Creates an event file descriptor and starts a GSource which reads from the file descriptor when there is data.

Parameters
[in]callbackThe callback to call
[in]optionsTrigger event options.
Note
The ownership of callback is taken by this class.

Definition at line 40 of file trigger-event.cpp.

References DALI_LOG_ERROR, Dali::Internal::Adaptor::FileDescriptorMonitor::FD_READABLE, Dali::MakeCallback(), mFileDescriptor, mFileDescriptorMonitor, and Triggered().

Here is the call graph for this function:

Dali::Internal::Adaptor::TriggerEvent::~TriggerEvent ( )

Destructor.

Definition at line 59 of file trigger-event.cpp.

References mCallback, mFileDescriptor, and mFileDescriptorMonitor.

Member Function Documentation

void Dali::Internal::Adaptor::TriggerEvent::Trigger ( )

Triggers the event.

This can be called from one thread in order to wake up another thread.

Definition at line 71 of file trigger-event.cpp.

References DALI_LOG_ERROR, DALI_LOG_WARNING, and mFileDescriptor.

void Dali::Internal::Adaptor::TriggerEvent::Triggered ( FileDescriptorMonitor::EventType  eventBitMask)
private

Called when our event file descriptor has been written to.

Parameters
[in]eventBitMaskbit mask of events that occured on the file descriptor

Definition at line 93 of file trigger-event.cpp.

References DALI_ASSERT_ALWAYS, DALI_LOG_WARNING, Dali::CallbackBase::Execute(), Dali::Internal::Adaptor::FileDescriptorMonitor::FD_READABLE, mCallback, mFileDescriptor, and mOptions.

Referenced by TriggerEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

CallbackBase* Dali::Internal::Adaptor::TriggerEvent::mCallback
private

Definition at line 93 of file trigger-event.h.

Referenced by Triggered(), and ~TriggerEvent().

int Dali::Internal::Adaptor::TriggerEvent::mFileDescriptor
private

Definition at line 94 of file trigger-event.h.

Referenced by Trigger(), Triggered(), TriggerEvent(), and ~TriggerEvent().

FileDescriptorMonitor* Dali::Internal::Adaptor::TriggerEvent::mFileDescriptorMonitor
private

Definition at line 88 of file trigger-event.h.

Referenced by TriggerEvent(), and ~TriggerEvent().

TriggerEventInterface::Options Dali::Internal::Adaptor::TriggerEvent::mOptions
private

Definition at line 95 of file trigger-event.h.

Referenced by Triggered().


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