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>
Public Member Functions | |
CYIPooledViewRecycler () | |
virtual | ~CYIPooledViewRecycler () |
virtual std::unique_ptr< CYISceneView > | TakeView (const std::shared_ptr< CYIAssetViewTemplate > &pAssetViewTemplate, CYISceneManager *pSceneManager, const CYIRuntimeTypeInfo *pViewType=nullptr) override |
virtual void | RecycleView (std::unique_ptr< CYISceneView > pView) override |
![]() | |
virtual | ~IYIViewRecycler () |
CYIPooledViewRecycler::CYIPooledViewRecycler | ( | ) |
|
virtual |
|
overridevirtual |
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.
|
overridevirtual |
If available returns a previously created view. Otherwise returns a newly created view and adds it to the pool.
Reimplemented from CYICreateDeleteViewRecycler.