Use this base class to implement the load tasks that load new resources.
More...
#include <kanzi/core.ui/resource/resource_manager.hpp>
Use this base class to implement the load tasks that load new resources.
A load task consist of:
- Loading part. Implement the loading part by overriding the loadFunction.
- Finishing part. Implement the finishing part by overriding the finishFunction.
The load task execution happens in this order:
- The loading thread executes the loadFunction.
- The main thread executes the finishFunction.
- The load task returns the created resource with getResult.
The state of the load task.
Enumerator |
---|
NotStarted |
The loading has not started.
|
InProgress |
The load task is in the loading queue.
|
Completed |
The loadFunction and finishFunction are executed.
|
kanzi::ResourceManager::LoadTask::LoadTask |
( |
| ) |
|
|
inlineexplicit |
virtual kanzi::ResourceManager::LoadTask::~LoadTask |
( |
| ) |
|
|
inlinevirtual |
You can override this function to define the part of the resource loading task that a worker thread executes.
You cannot access any shared data inside the function.
- Parameters
-
resourceLoaderThreadContext | The context of the loader thread. |
Implemented in kanzi::ResourceProfilingLoadTask.
The part of the loading that the main thread executes.
The function creates and stores a new resource that getResult returns.
- Parameters
-
resourceLoaderThreadContext | The context of the loader thread that was used to call loadFunction. |
Implemented in kanzi::ResourceProfilingLoadTask.
The documentation for this struct was generated from the following file: