Kanzi  3.9.9
Kanzi Engine C++ API
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. More...
 
void notifyTasksAvailable () override
 TaskDispatcherBase::notifyTasksAvailable() implementation. More...
 
void notifyTasksConsumed () override
 TaskDispatcherBase::notifyTasksConsumed() implementation. More...
 
 TaskDispatcher ()=default
 Constructor. More...
 
- Public Member Functions inherited from kanzi::TaskDispatcherBase
void cleanUpTasks ()
 Clean up tasks until no tasks remain. More...
 
size_t executeTasks ()
 Executes the tasks that have been dispatched to the UI thread. More...
 
bool isEmpty () const
 Indicates whether the task dispatcher does not contain pending tasks. More...
 
bool isQuitting () const
 Indicates whether the task dispatcher is quitting. More...
 
void setDomain (Domain *domain)
 Setter for domain. More...
 
void setQuitting (bool flag)
 Set the quitting flag state. More...
 
void submit (Task task)
 Submits a task. More...
 

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. More...
 
- Protected Member Functions inherited from kanzi::TaskDispatcherBase
 TaskDispatcherBase ()
 Constructor. More...
 
virtual ~TaskDispatcherBase ()
 Destructor. More...
 

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

kanzi::TaskDispatcher::TaskDispatcher ( )
explicitdefault

Constructor.

Member Function Documentation

NativeEventHandle kanzi::TaskDispatcher::getNativeEventHandle ( )

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

This is an internal function.

void kanzi::TaskDispatcher::notifyTasksAvailable ( )
overridevirtual
void kanzi::TaskDispatcher::notifyTasksConsumed ( )
overridevirtual

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