You.i Engine
CYIPooledViewRecycler Class Reference

Detailed Description

A IYIViewRecycler implementation that creates views and pools them when they are released so they can be reused.

Views returned to the view pool using RecycleView() will be deleted when the view pool is deleted. Users must ensure that any views that have not been returned are deleted in another manner. Views that are attached to the scene tree will be managed by the scene manager and will automatically be deleted.

#include <view/YiPooledViewRecycler.h>

Inheritance diagram for CYIPooledViewRecycler:

Public Member Functions

 CYIPooledViewRecycler ()
virtual ~CYIPooledViewRecycler ()
virtual std::unique_ptr< CYISceneViewTakeView (const std::shared_ptr< CYIAssetViewTemplate > &pAssetViewTemplate, CYISceneManager *pSceneManager, const CYIRuntimeTypeInfo *pViewType=nullptr) override
virtual void RecycleView (std::unique_ptr< CYISceneView > pView) override
- Public Member Functions inherited from IYIViewRecycler
virtual ~IYIViewRecycler ()

Constructor & Destructor Documentation

◆ CYIPooledViewRecycler()

CYIPooledViewRecycler::CYIPooledViewRecycler ( )

◆ ~CYIPooledViewRecycler()

virtual CYIPooledViewRecycler::~CYIPooledViewRecycler ( )

Member Function Documentation

◆ RecycleView()

virtual void CYIPooledViewRecycler::RecycleView ( std::unique_ptr< CYISceneView pView)

Releases pView back into a pool of views where it can be reused when GetView() is called. If pView is not in the pool it will be deleted.

Reimplemented from CYICreateDeleteViewRecycler.

◆ TakeView()

virtual std::unique_ptr<CYISceneView> CYIPooledViewRecycler::TakeView ( const std::shared_ptr< CYIAssetViewTemplate > &  pAssetViewTemplate,
CYISceneManager pSceneManager,
const CYIRuntimeTypeInfo pViewType = nullptr 

If available returns a previously created view. Otherwise returns a newly created view and adds it to the pool.

The Node returned may have been initialized on a previous call to GetView(). Users should use the same CYISceneManager every time they call GetView().
See also

Reimplemented from CYICreateDeleteViewRecycler.

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