You.i Engine
YiViewPool.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_VIEW_POOL_H_
3 #define _YI_VIEW_POOL_H_
4 
5 #include "framework/YiPredef.h"
6 #include "utility/YiRtti.h"
7 #include "utility/YiString.h"
8 
9 class CYISceneView;
10 class CYISceneManager;
11 
12 namespace yi
13 {
19 namespace deprecated
20 {
32 {
33 public:
38  enum TYPE
39  {
42  };
43 
44  CYIViewPool(CYISceneManager *pSceneManager, TYPE eType = STATIC);
45  virtual ~CYIViewPool();
46 
51  void AddViewType(const CYIString &viewTemplateName, const CYIRuntimeTypeInfo &viewType, int32_t nPreAllocate);
52 
57  std::unique_ptr<CYISceneView> TakeView(const CYIString &viewTemplateName, const CYIRuntimeTypeInfo &viewType);
58 
63  void ReleaseView(std::unique_ptr<CYISceneView> pView);
64 
68  int32_t GetAllocatedAmount(const CYIString &templateName, const CYIRuntimeTypeInfo &viewType) const;
69 
74  int32_t GetAllocatedAmountRemaining(const CYIString &templateName, const CYIRuntimeTypeInfo &viewType) const;
75 
76 private:
77  typedef std::map<CYISceneView *, bool> ViewMap;
78  typedef std::map<CYIString, ViewMap> TypeMap;
80  TypeMap m_pool;
81 
82  CYISceneManager *m_pSceneManager;
83  TYPE m_eType;
84 };
85 
86 } // namespace deprecated
87 
92 } // namespace yi
93 
94 #endif // _YI_VIEW_POOL_H_
95 
Definition: YiAbstractSignalTransition.h:7
int32_t GetAllocatedAmount(const CYIString &templateName, const CYIRuntimeTypeInfo &viewType) const
Scene trees composed of CYISceneNode objects are registered with the scene manager in order for them ...
Definition: YiSceneManager.h:73
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:35
Definition: YiViewPool.h:40
CYIViewPool(CYISceneManager *pSceneManager, TYPE eType=STATIC)
std::unique_ptr< CYISceneView > TakeView(const CYIString &viewTemplateName, const CYIRuntimeTypeInfo &viewType)
void ReleaseView(std::unique_ptr< CYISceneView > pView)
int32_t GetAllocatedAmountRemaining(const CYIString &templateName, const CYIRuntimeTypeInfo &viewType) const
The abstract runtime representation of a C++ type.
Definition: YiRtti.h:48
Definition: YiViewPool.h:41
This class provides a collection of views that can be re-used.
Definition: YiViewPool.h:31
TYPE
Definition: YiViewPool.h:38
void AddViewType(const CYIString &viewTemplateName, const CYIRuntimeTypeInfo &viewType, int32_t nPreAllocate)
This file contains the classes and macros used to implement RTTI in You.i Engine. ...