Kanzi 3.9.10
kanzi::TaskDispatcher Class Reference

Task dispatcher. More...

#include <kanzi/core.ui/platform/task_dispatcher/common/task_dispatcher.hpp>

Inheritance diagram for kanzi::TaskDispatcher:
[legend]

Public Member Functions

NativeEventHandle getNativeEventHandle ()
 Returns the native handle that can be used to wait for available tasks.
 
void notifyTasksAvailable () override
 TaskDispatcherBase::notifyTasksAvailable() implementation.
 
void notifyTasksConsumed () override
 TaskDispatcherBase::notifyTasksConsumed() implementation.
 
 TaskDispatcher ()=default
 Constructor.
 
- Public Member Functions inherited from kanzi::TaskDispatcherBase
void cleanUpTasks ()
 Clean up tasks until no tasks remain.
 
size_t executeTasks ()
 Executes the tasks that have been dispatched to the UI thread.
 
bool isEmpty () const
 Indicates whether the task dispatcher does not contain pending tasks.
 
bool isQuitting () const
 Indicates whether the task dispatcher is quitting.
 
void setDomain (Domain *domain)
 Setter for domain.
 
void setQuitting (bool flag)
 Set the quitting flag state.
 
void submit (Task task)
 Submits a task.
 

Additional Inherited Members

- Public Types inherited from kanzi::TaskDispatcherBase
typedef function< void()> Task
 Task is a callback that is dispatched by TaskDispatcher and executed on a specific UI thread.
 
- Protected Member Functions inherited from kanzi::TaskDispatcherBase
 TaskDispatcherBase ()
 Constructor.
 
virtual ~TaskDispatcherBase ()
 Destructor.
 

Detailed Description

Task dispatcher.

You can use TaskDispatcher to schedule execution of callbacks to the UI thread. You can access Kanzi UI objects only on the thread that you create them on. You can wrap code that accesses UI objects with tasks and submit them from any thread to the TaskDispatcher. The UI thread will execute these tasks during its main loop.

Constructor & Destructor Documentation

◆ TaskDispatcher()

kanzi::TaskDispatcher::TaskDispatcher ( )
explicitdefault

Constructor.

Member Function Documentation

◆ getNativeEventHandle()

NativeEventHandle kanzi::TaskDispatcher::getNativeEventHandle ( )

Returns the native handle that can be used to wait for available tasks.

This is an internal function.

◆ notifyTasksAvailable()

void kanzi::TaskDispatcher::notifyTasksAvailable ( )
overridevirtual

◆ notifyTasksConsumed()

void kanzi::TaskDispatcher::notifyTasksConsumed ( )
overridevirtual

The documentation for this class was generated from the following file: