add ClearActive() in Pool template.
This commit is contained in:
parent
b003585d43
commit
eba0d78617
@ -139,6 +139,17 @@ namespace hgl
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void Pool<T>::ClearActive()
|
||||
{
|
||||
T *p=Active.GetData();
|
||||
int ac=Active.GetCount();
|
||||
|
||||
Inactive.Push(p,ac);
|
||||
|
||||
Active.ClearData();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void Pool<T>::ClearInactive()
|
||||
{
|
||||
|
@ -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<typename T> class Pool
|
||||
|
Loading…
x
Reference in New Issue
Block a user