Kanzi  3.9.5
Kanzi Engine API
kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader Class Reference

Extends ActivityPrefabLoader with a specialized behavior for child Activity nodes of a ParallelExclusiveActivityHost. More...

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

Inheritance diagram for kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader:
[legend]

Public Member Functions

void activatedByMessage (bool value)
 Notifies the prefab loader that the activation of an Activity node is requested through the ActivateActivityMessage. More...
 
void activatedOnHostAttach (bool value)
 Notifies the prefab loader that the activation of an Activity node is requested. More...
 
 ActivityInParallelHostPrefabLoader (NodeWeakPtr callbackOwner, ActivityPrefabLoader::ActivityPrefabLoaderCallback callback)
 Constructor. More...
 
void addApplyActivationModifier (BindingTokenWeakPtr weakModifier)
 Stores callback to the ApplyActivationAction that Kanzi executes when an Activity Host node loads the prefab of an Activity node. More...
 
void finalizeActivation (NodeSharedPtr node)
 Finalizes the activation by setting the appropriate property or setting the property modifier binding: More...
 
bool hasValidActivationModifier () const
 Indicates whether the activation of any child Activity node of a ParallelActivityHost is requested by modifier bindings callbacks of ApplyActivationAction. More...
 
void invalidate ()
 Invalidates the prefab loading. More...
 
bool isActivatedByMessage () const
 Indicates whether the activation of any child Activity node of a ParallelActivityHost is requested by ActivateActivityMessage. More...
 
bool isActivatedOnHostAttach () const
 Indicates whether of the activation of any child Activity node of a ParallelActivityHost is requested. More...
 
bool isValid () const override
 ActivityPrefabLoader::isValid() implementation. More...
 
- Public Member Functions inherited from kanzi::ActivityPrefabLoader
 ActivityPrefabLoader (NodeWeakPtr callbackOwner, ActivityPrefabLoaderCallback callback)
 Constructor. 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...
 

Public Attributes

vector< BindingTokenWeakPtrm_applyActivationModifiers
 Container of the property modifier bindings callbacks of ApplyActivationAction. More...
 

Additional Inherited Members

- Public Types inherited from kanzi::ActivityPrefabLoader
using ActivityPrefabLoaderCallback = function< void(PrefabTemplateSharedPtr, string_view)>
 

Detailed Description

Extends ActivityPrefabLoader with a specialized behavior for child Activity nodes of a ParallelExclusiveActivityHost.

An activation request to an Activity node in a ParallelExclusiveActivityHost is valid for as long as an ApplyActivationAction request is valid, or there is an ActivateActivityMessage request, given that it is not invalidated by a DeactivateActivityMessage message.

The ApplyActivationAction mechanism sets a property modifier to apply activation to a child Activity node.

For ParallelActivityHost:

For ExclusiveActivityHost:

  • This modifier binding is created for the ExclusiveActivityHostConcept::ActiveActivityProperty.
  • This property must be set on the ExclusiveActivityHost itself.
  • For ParallelActivityHost, Kanzi waits until the child Activity node prefab is instantiated. Only after the prefab is instantiated can Kanzi set the property modifier binding on the child Activity node.
  • For ExclusiveActivityHost Kanzi does not have to wait for prefab to instantiate because it sets the property modifier directly on the Activity Host and not on its child Activity nodes.
Since
Kanzi 3.9.0

Constructor & Destructor Documentation

◆ ActivityInParallelHostPrefabLoader()

kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader::ActivityInParallelHostPrefabLoader ( NodeWeakPtr  callbackOwner,
ActivityPrefabLoader::ActivityPrefabLoaderCallback  callback 
)
explicit

Constructor.

Parameters
callbackOwnerThe node that owns the callback.
callbackThe callback that Kanzi calls when the prefab loading is completed.

Member Function Documentation

◆ hasValidActivationModifier()

bool kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader::hasValidActivationModifier ( ) const

Indicates whether the activation of any child Activity node of a ParallelActivityHost is requested by modifier bindings callbacks of ApplyActivationAction.

Returns
If any child Activity node is activated by ApplyActivationAction, true, otherwise false.

◆ isActivatedByMessage()

bool kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader::isActivatedByMessage ( ) const

Indicates whether the activation of any child Activity node of a ParallelActivityHost is requested by ActivateActivityMessage.

Returns
If any child Activity node is activated by ActivateActivityMessage, true, otherwise false.

◆ isActivatedOnHostAttach()

bool kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader::isActivatedOnHostAttach ( ) const

Indicates whether of the activation of any child Activity node of a ParallelActivityHost is requested.

  • either because it was set to be initially active,
  • or is the result deserialization of an Activity Host.
    Returns
    If any child Activity node is activated because of Activity Host attach, true, otherwise false.

◆ addApplyActivationModifier()

void kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader::addApplyActivationModifier ( BindingTokenWeakPtr  weakModifier)

Stores callback to the ApplyActivationAction that Kanzi executes when an Activity Host node loads the prefab of an Activity node.

Parameters
weakModifierA property modifier binding callback provided by the ApplyActivationAction to finalize the activation.
See also
isAnyActivationRequestValid(), hasValidActivationModifier()

◆ activatedByMessage()

void kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader::activatedByMessage ( bool  value)

Notifies the prefab loader that the activation of an Activity node is requested through the ActivateActivityMessage.

This message invalidates the active prefab loading of an Activity node, if the activation request is no longer valid.

See also
isAnyActivationRequestValid(), isActivatedByMessage()
Parameters
valueSet to e\ true, when the activation of the Activity node is requested by ActivateActivityMessage. Set to e\ false, when the requested activation is no longer valid.

◆ activatedOnHostAttach()

void kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader::activatedOnHostAttach ( bool  value)

Notifies the prefab loader that the activation of an Activity node is requested.

  • either because it was set to be initially active,
  • or is the result deserialization of an Activity Host. This message invalidates the active prefab loading of an Activity node, if the activation request is no longer valid.
    See also
    isAnyActivationRequestValid(), isActivatedOnHostAttach()
    Parameters
    valueSet to e\ true, when the activation of the Activity node is requested by ActivateActivityMessage. Set to e\ false, when the requested activation is no longer valid.

◆ finalizeActivation()

void kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader::finalizeActivation ( NodeSharedPtr  node)

Finalizes the activation by setting the appropriate property or setting the property modifier binding:

◆ isValid()

bool kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader::isValid ( ) const
overridevirtual

ActivityPrefabLoader::isValid() implementation.

Indicates whether a ParallelActivityHost must load the prefab of a child Activity node.

Returns
If the Action is not unapplied, in other words, the ParallelActivityHost must load the prefab of the child Activity node, true, otherwise false.

Reimplemented from kanzi::ActivityPrefabLoader.

◆ invalidate()

void kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader::invalidate ( )

Invalidates the prefab loading.

Once invalidated, Kanzi neither acquires the prefab, nor calls the callback when the asynchronous resource loading is completed.

Member Data Documentation

◆ m_applyActivationModifiers

vector<BindingTokenWeakPtr> kanzi::ParallelActivityHostConcept::ActivityInParallelHostPrefabLoader::m_applyActivationModifiers

Container of the property modifier bindings callbacks of ApplyActivationAction.

Kanzi uses this container to set the modifier that ensures an Activity node stays active.


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