You.i Engine
YiPooledViewRecycler.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_POOLED_VIEW_RECYCLER_H_
3 #define _YI_POOLED_VIEW_RECYCLER_H_
4 
6 
8 class CYISceneView;
9 class CYISceneManager;
10 class CYIViewTemplate;
11 
25 {
26 public:
28  virtual ~CYIPooledViewRecycler();
29 
36  virtual std::unique_ptr<CYISceneView> TakeView(const std::shared_ptr<CYIAssetViewTemplate> &pAssetViewTemplate, CYISceneManager *pSceneManager, const CYIRuntimeTypeInfo *pViewType = nullptr) override;
37 
41  virtual void RecycleView(std::unique_ptr<CYISceneView> pView) override;
42 
43 private:
44  CYIString GetViewPoolID(const std::shared_ptr<CYIAssetViewTemplate> &pAssetViewTemplate, const CYIRuntimeTypeInfo *pViewType) const;
45  void AddViewTypeToPool(const CYIString &viewPoolID);
46 
47  std::unique_ptr<CYISceneView> TakeViewFromPool(const CYIString &viewPoolID);
48  void AddViewToPool(const CYIString &viewPoolID, CYISceneView *pView);
49 
50  typedef std::map<CYISceneView *, bool> ViewMap;
51  typedef std::map<CYIString, ViewMap> TypeMap;
53  TypeMap m_pool;
54 };
55 
58 #endif // _YI_POOLED_VIEW_RECYCLER_H_
virtual ~CYIPooledViewRecycler()
Scene trees composed of CYISceneNode objects are registered with the scene manager in order for them ...
Definition: YiSceneManager.h:75
The base class for all view types. Views are containers of renderable elements that often define inte...
Definition: YiSceneView.h:47
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:36
virtual std::unique_ptr< CYISceneView > TakeView(const std::shared_ptr< CYIAssetViewTemplate > &pAssetViewTemplate, CYISceneManager *pSceneManager, const CYIRuntimeTypeInfo *pViewType=nullptr) override
A view template defines information about a view, so it can be built automatically.
Definition: YiViewTemplate.h:29
Definition: YiPooledViewRecycler.h:24
The abstract runtime representation of a C++ type.
Definition: YiRtti.h:56
Definition: YiCreateDeleteViewRecycler.h:22
virtual void RecycleView(std::unique_ptr< CYISceneView > pView) override