Kanzi 3.9.10
kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass > Class Template Reference

Base class for prefab views. More...

#include <kanzi/ui/node/concept/prefab_view.hpp>

Inheritance diagram for kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >:
[legend]

Public Types

typedef shared_ptr< TBaseClass > NodeTypeSharedPtr
 

Public Member Functions

NodeTypeSharedPtr getInstantiatedNode () const
 Gets the node instantiated from prefab.
 
PrefabTemplateSharedPtr getPrefab () const
 Gets the value of PrefabProperty.
 
void loadPrefabAsynchronously (ResourceID key)
 Post LoadAsynchronouslyMessage to load a prefab.
 
void setPrefab (PrefabTemplateSharedPtr value)
 Sets the value of PrefabProperty.
 

Static Public Member Functions

static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- Static Public Member Functions inherited from kanzi::PrefabViewConcept
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 

Protected Member Functions

void initialize ()
 Initialize the prefab view.
 
void onAsyncLoadCompleted (ResourceID key)
 Function to be ran from onAsyncLoadCompletedCallback.
 
void onLoadAsynchronously (LoadAsynchronouslyMessageArguments &arguments)
 Message handler for load asynchronously message.
 
void onNodePropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) override
 Node::onNodePropertyChanged() implementation.
 
 PrefabViewConceptImpl (Domain *domain, string_view name)
 Constructor.
 
void updateNode (PrefabTemplateSharedPtr prefabTemplate)
 Updates the displayed node by creating a new node from the specified prefab template and removing the old node.
 

Static Protected Member Functions

static void onAsyncLoadCompletedCallback (weak_ptr< TDerivedClass > prefabView, ResourceID key)
 Callback for async load completion.
 

Additional Inherited Members

- Static Public Attributes inherited from kanzi::PrefabViewConcept
static MessageType< AsynchronousLoadCompletedMessageArgumentsAsynchronousLoadCompletedMessage
 Asynchronous load complete message.
 
static MessageType< LoadAsynchronouslyMessageArgumentsLoadAsynchronouslyMessage
 Start asynchronous load message.
 
static PropertyType< ResourceSharedPtrPrefabProperty
 Prefab property.
 

Detailed Description

template<typename TBaseClass, typename TDerivedClass>
class kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >

Base class for prefab views.

Member Typedef Documentation

◆ NodeTypeSharedPtr

template<typename TBaseClass , typename TDerivedClass >
typedef shared_ptr<TBaseClass> kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::NodeTypeSharedPtr

Constructor & Destructor Documentation

◆ PrefabViewConceptImpl()

template<typename TBaseClass , typename TDerivedClass >
kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::PrefabViewConceptImpl ( Domain * domain,
string_view name )
explicitprotected

Constructor.

Parameters
domainThe domain the new node belongs to.
nameThe name of the node.

Member Function Documentation

◆ makeEditorInfo()

template<typename TBaseClass , typename TDerivedClass >
PropertyTypeEditorInfoSharedPtr kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::makeEditorInfo ( )
static

◆ getPrefab()

template<typename TBaseClass , typename TDerivedClass >
PrefabTemplateSharedPtr kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::getPrefab ( ) const

Gets the value of PrefabProperty.

See also
setPrefab()

◆ setPrefab()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::setPrefab ( PrefabTemplateSharedPtr value)

Sets the value of PrefabProperty.

See also
getPrefab()

◆ getInstantiatedNode()

template<typename TBaseClass , typename TDerivedClass >
shared_ptr< TBaseClass > kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::getInstantiatedNode ( ) const

Gets the node instantiated from prefab.

Returns
Instantiated node.

◆ loadPrefabAsynchronously()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::loadPrefabAsynchronously ( ResourceID key)

Post LoadAsynchronouslyMessage to load a prefab.

Parameters
keyResourceID referring to the prefab to load.

◆ initialize()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::initialize ( )
protected

Initialize the prefab view.

◆ onNodePropertyChanged()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::onNodePropertyChanged ( AbstractPropertyType propertyType,
PropertyNotificationReason reason )
overrideprotected

◆ onLoadAsynchronously()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::onLoadAsynchronously ( LoadAsynchronouslyMessageArguments & arguments)
protected

Message handler for load asynchronously message.

◆ onAsyncLoadCompletedCallback()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::onAsyncLoadCompletedCallback ( weak_ptr< TDerivedClass > prefabView,
ResourceID key )
staticprotected

Callback for async load completion.

Takes weak_ptr of prefab view to allow the prefab view to be destroyed before completion.

◆ onAsyncLoadCompleted()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::onAsyncLoadCompleted ( ResourceID key)
protected

Function to be ran from onAsyncLoadCompletedCallback.

◆ updateNode()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::updateNode ( PrefabTemplateSharedPtr prefabTemplate)
protected

Updates the displayed node by creating a new node from the specified prefab template and removing the old node.

Parameters
prefabTemplateThe prefab template that will be instantiated.

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