Kanzi  3.9.7
Kanzi Engine API
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. More...
 
PrefabTemplateSharedPtr getPrefab () const
 Gets the value of PrefabProperty. More...
 
void loadPrefabAsynchronously (ResourceID key)
 Post LoadAsynchronouslyMessage to load a prefab. More...
 
void setPrefab (PrefabTemplateSharedPtr value)
 Sets the value of PrefabProperty. More...
 

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

Static Protected Member Functions

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

Additional Inherited Members

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

Detailed Description

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

Base class for prefab views.

Member Typedef Documentation

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

Constructor & Destructor Documentation

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

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

Gets the value of PrefabProperty.

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

Sets the value of PrefabProperty.

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

Gets the node instantiated from prefab.

Returns
Instantiated node.
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.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::PrefabViewConceptImpl< TBaseClass, TDerivedClass >::initialize ( )
protected

Initialize the prefab view.

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

Message handler for load asynchronously message.

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.

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

Function to be ran from onAsyncLoadCompletedCallback.

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: