Kanzi  3.9.7
Kanzi Engine API
kanzi::ActivityPrefabLoader Class Reference

Helper class for the Activity Host class types. More...

#include <kanzi/ui/node/concept/activity/activity_prefab_loader.hpp>

Inheritance diagram for kanzi::ActivityPrefabLoader:
[legend]

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

Detailed Description

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.

Since
Kanzi 3.9.0

Member Typedef Documentation

Constructor & Destructor Documentation

kanzi::ActivityPrefabLoader::ActivityPrefabLoader ( NodeWeakPtr  callbackOwner,
ActivityPrefabLoaderCallback  callback 
)
inlineexplicit

Constructor.

Parameters
callbackOwnerThe node that owns the callback.
callbackThe callback that Kanzi calls when the prefab loading is completed.
virtual kanzi::ActivityPrefabLoader::~ActivityPrefabLoader ( )
virtualdefault

Destructor.

Member Function Documentation

void kanzi::ActivityPrefabLoader::requestPrefabLoading ( string_view  prefabPath,
string_view  activityName 
)

Requests the loading of a prefab.

Parameters
prefabPathPath to the prefab to load.
activityNameThe 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.

Parameters
loadedPrefabPathThe path to the loaded prefab.
virtual bool kanzi::ActivityPrefabLoader::isValid ( ) const
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.


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