Helper class for the Activity Host class types. More...
#include <kanzi/ui/node/concept/activity/activity_prefab_loader.hpp>
Public Types | |
using | ActivityPrefabLoaderCallback = function< void(PrefabTemplateSharedPtr, string_view)> |
Public Member Functions | |
ActivityPrefabLoader (NodeWeakPtr callbackOwner, ActivityPrefabLoaderCallback callback) | |
Constructor. More... | |
virtual bool | isValid () const |
Validates the prefab loading task. More... | |
void | onAsyncLoadCompleted (string_view loadedPrefabPath) |
Callback for asynchronous resource loading. More... | |
void | requestPrefabLoading (string_view prefabPath, string_view activityName) |
Requests the loading of a prefab. More... | |
virtual | ~ActivityPrefabLoader ()=default |
Destructor. More... | |
Helper class for the Activity Host class types.
This class is responsible for loading a requested prefab and informing the owner class when that prefab is loaded. A new prefab loading request overwrites any existing prefab loading request.
using kanzi::ActivityPrefabLoader::ActivityPrefabLoaderCallback = function<void(PrefabTemplateSharedPtr, string_view)> |
|
inlineexplicit |
Constructor.
callbackOwner | The node that owns the callback. |
callback | The callback that Kanzi calls when the prefab loading is completed. |
|
virtualdefault |
Destructor.
void kanzi::ActivityPrefabLoader::requestPrefabLoading | ( | string_view | prefabPath, |
string_view | activityName | ||
) |
Requests the loading of a prefab.
prefabPath | Path to the prefab to load. |
activityName | The name of an Activity whose prefab to load. |
void kanzi::ActivityPrefabLoader::onAsyncLoadCompleted | ( | string_view | loadedPrefabPath | ) |
Callback for asynchronous resource loading.
Kanzi calls this callback when the asynchronous resource loading is completed.
loadedPrefabPath | The path to the loaded prefab. |
|
virtual |
Validates the prefab loading task.
Once validated, Kanzi acquires the prefab and calls the callback when the asynchronous resource loading is completed.
Reimplemented in kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader.