diff --git a/inc/hgl/type/Pool.cpp b/inc/hgl/type/Pool.cpp index d29c90d..4f37530 100644 --- a/inc/hgl/type/Pool.cpp +++ b/inc/hgl/type/Pool.cpp @@ -139,6 +139,17 @@ namespace hgl } } + template + void Pool::ClearActive() + { + T *p=Active.GetData(); + int ac=Active.GetCount(); + + Inactive.Push(p,ac); + + Active.ClearData(); + } + template void Pool::ClearInactive() { diff --git a/inc/hgl/type/Pool.h b/inc/hgl/type/Pool.h index 0bd7c08..594d8f9 100644 --- a/inc/hgl/type/Pool.h +++ b/inc/hgl/type/Pool.h @@ -58,6 +58,7 @@ namespace hgl bool IsActive(const T &data)const{return Active.IsExist(data);} bool IsInactive(const T &data)const{return Inactive.IsExist(data);} + virtual void ClearActive(); ///<清除所有活跃的 virtual void ClearInactive(); ///<清除所有空闲的 virtual void ClearAll(); ///<清除所有的 };//template class Pool