Task dispatcher. More...
#include <kanzi/core.ui/platform/task_dispatcher/common/task_dispatcher.hpp>
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. | |
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.
|
explicitdefault |
Constructor.
NativeEventHandle kanzi::TaskDispatcher::getNativeEventHandle | ( | ) |
Returns the native handle that can be used to wait for available tasks.
This is an internal function.
|
overridevirtual |
TaskDispatcherBase::notifyTasksAvailable() implementation.
Implements kanzi::TaskDispatcherBase.
|
overridevirtual |
TaskDispatcherBase::notifyTasksConsumed() implementation.
Implements kanzi::TaskDispatcherBase.