You.i Engine
CYIDelegatingNodeAdapter Class Reference

Detailed Description

An CYINodeAdapter implementation that delegates its responsibilities to a CYIDelegatingNodeAdapter::Delegate implementation.

CYIDelegatingNodeAdapter allows the extension of existing classes, such as a CYIAbstractScreenViewController subclass, with CYINodeAdapter responsibilities. The adapter does not take ownership of the delegate and so the delegate may be re-used across adapter instances.

In order to make use of this adapter, extend CYIDelegatingNodeAdapter::Delegate and construct this adapter with the delegate implementation.

#include <streamer/YiDelegatingNodeAdapter.h>

Inheritance diagram for CYIDelegatingNodeAdapter:

Classes

class  Delegate
 

Public Member Functions

 CYIDelegatingNodeAdapter (Delegate *pDelegate)
 
virtual ~CYIDelegatingNodeAdapter ()
 
DelegateGetDelegate () const
 
virtual uint32_t GetItemsCount () const override
 
virtual glm::vec3 GetInitialNodeSize (uint32_t uIndex) const override
 
virtual std::unique_ptr< CYISceneNodeBuildNode (uint32_t uIndex, CYISceneManager *pSceneManager) override
 
virtual void ReleaseNode (uint32_t uIndex, std::unique_ptr< CYISceneNode > pNode) override
 
- Public Member Functions inherited from CYINodeAdapter
 CYINodeAdapter ()
 
virtual ~CYINodeAdapter ()
 
virtual void ConfigureProperties (uint32_t uIndex, CYISceneNode *pNode) const
 
IYIPropertiesSourceGetProperties (const CYIString &viewTemplateName) const
 
void SetProperties (const std::map< CYIString, IYIPropertiesSource * > &properties)
 
- Public Member Functions inherited from CYIScriptableObject
 CYIScriptableObject ()
 
 CYIScriptableObject (const CYIScriptableObject &other)
 
CYIScriptableObjectoperator= (const CYIScriptableObject &other)
 
virtual ~CYIScriptableObject ()
 
CYIBindingImplementationGetBindingImplementation () const
 
void SetBindingImplementation (CYIBindingImplementation *pBindingImplementation)
 
virtual const CYIRuntimeTypeInfoGetRuntimeTypeInfoForScriptObject () const
 

Additional Inherited Members

- Public Attributes inherited from CYINodeAdapter
CYISignal< uint32_t > ItemAddedAtIndex
 
CYISignal< uint32_t > ItemRemovedAtIndex
 
CYISignal< uint32_t, uint32_t > ItemMoved
 

Constructor & Destructor Documentation

CYIDelegatingNodeAdapter::CYIDelegatingNodeAdapter ( Delegate pDelegate)

Creates a new delegate adapter using delegate pDelegate. pDelegate must be non-null. The created object does not take ownership of the provided pointer.

virtual CYIDelegatingNodeAdapter::~CYIDelegatingNodeAdapter ( )
virtual

Member Function Documentation

virtual std::unique_ptr<CYISceneNode> CYIDelegatingNodeAdapter::BuildNode ( uint32_t  uIndex,
CYISceneManager pSceneManager 
)
overridevirtual

Override to provide the node representing the visual subtree at 0-based uIndex. This may be a newly constructed CYISceneNode or one that is recycled, so long as it is fully initialized. The same CYISceneNode may not be re-used until CYINodeAdapter::ReleaseNode is called at which point the implementation is free to deallocate or recycle the node.

See also
ReleaseNode

Implements CYINodeAdapter.

Delegate* CYIDelegatingNodeAdapter::GetDelegate ( ) const

Returns the delegate assigned to this adapter.

virtual glm::vec3 CYIDelegatingNodeAdapter::GetInitialNodeSize ( uint32_t  uIndex) const
overridevirtual

Override to return the initial node size for 0-based adapter index uIndex. This is only used when items are initially added and does not need to reflect changes in size.

Implements CYINodeAdapter.

virtual uint32_t CYIDelegatingNodeAdapter::GetItemsCount ( ) const
overridevirtual

Returns the number of items managed by this adapter. This may be queried throughout the lifetime of the adapter and must report the correct value as items are added and removed. The number of items will be used to produce the 0-based consecutive indices. Indices may be invalidated when the number of items have changed and may no longer correspond to the same visual representations.

See also
CYINodeAdapter::ItemAddedAtIndex
CYINodeAdapter::ItemRemovedAtIndex

Implements CYINodeAdapter.

virtual void CYIDelegatingNodeAdapter::ReleaseNode ( uint32_t  uIndex,
std::unique_ptr< CYISceneNode pNode 
)
overridevirtual

Override to reclaim ownership of pNode, which represents the visual subtree at uIndex. pNode may be recycled or destroyed.

Note
By the time ReleaseNode has been called the node has already been detached from the scene tree.
See also
BuildNode

Implements CYINodeAdapter.


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