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. 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 | 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... | |
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.