diff --git a/inc/hgl/type/Map.cpp b/inc/hgl/type/Map.cpp index 125e3f2..65264ab 100644 --- a/inc/hgl/type/Map.cpp +++ b/inc/hgl/type/Map.cpp @@ -342,7 +342,7 @@ namespace hgl template bool _Map::DeleteByKey(const K &flag) { - return DeleteBySerial(Find(flag)); + return DeleteAt(Find(flag)); } /** @@ -360,7 +360,7 @@ namespace hgl for(int i=0;i bool _Map::DeleteByValue(const V &data) { - return DeleteBySerial(FindByValue(data)); + return DeleteAt(FindByValue(data)); } /** @@ -387,7 +387,7 @@ namespace hgl * @return 是否成功 */ template - bool _Map::DeleteBySerial(int index) + bool _Map::DeleteAt(int index) { if(index<0 ||index>=data_list.GetCount())return(false); @@ -405,7 +405,7 @@ namespace hgl * @return 是否成功 */ template - bool _Map::DeleteBySerial(int start,int number) + bool _Map::DeleteAt(int start,int number) { KVData **dp=data_list.GetData()+start; diff --git a/inc/hgl/type/Map.h b/inc/hgl/type/Map.h index 0054b18..fec6219 100644 --- a/inc/hgl/type/Map.h +++ b/inc/hgl/type/Map.h @@ -57,8 +57,8 @@ namespace hgl virtual bool DeleteByKey(const K &); ///<根据索引将指定数据从列表中移除 virtual int DeleteByKey(const K *,const int); ///<根据索引将指定数据从列表中批量移除 virtual bool DeleteByValue(const V &); ///<根据数据将指定数据从列表中移除 - virtual bool DeleteBySerial(int); ///<根据序号将指定数据从列表中移除 - virtual bool DeleteBySerial(int,int); ///<根据序号将指定数据从列表中移除 + virtual bool DeleteAt(int); ///<根据序号将指定数据从列表中移除 + virtual bool DeleteAt(int,int); ///<根据序号将指定数据从列表中移除 virtual bool ChangeOrAdd(const K &,const V &); ///<更改一个数据的内容(如不存在则添加) virtual bool Change(const K &,const V &); ///<更改一个数据的内容(如不存在则更改失效) virtual void Clear(); ///<清除所有数据 @@ -222,7 +222,7 @@ namespace hgl { if(index<0||index>=this->data_list.GetCount())return(false); - SuperClass::DeleteBySerial(index); + SuperClass::DeleteAt(index); return(true); } @@ -242,7 +242,7 @@ namespace hgl */ bool DeleteByKey(const K &flag) { - return DeleteBySerial(SuperClass::Find(flag)); + return DeleteAt(SuperClass::Find(flag)); } /** @@ -252,7 +252,7 @@ namespace hgl */ bool DeleteByValue(V *tp) { - return DeleteBySerial(this->FindByValue(tp)); + return DeleteAt(this->FindByValue(tp)); } /** @@ -260,12 +260,12 @@ namespace hgl * @param index 要删除的数据的序列号 * @return 是否删除成功 */ - bool DeleteBySerial(int index) + bool DeleteAt(int index) { if(index<0||index>=this->data_list.GetCount())return(false); DeleteObject(index); - SuperClass::DeleteBySerial(index); + SuperClass::DeleteAt(index); return(true); } diff --git a/inc/hgl/type/ObjectManage.h b/inc/hgl/type/ObjectManage.h index 63d570d..dae4773 100644 --- a/inc/hgl/type/ObjectManage.h +++ b/inc/hgl/type/ObjectManage.h @@ -65,7 +65,7 @@ namespace hgl if(obj->ref_count<=0) { Clear(obj->value); - items.DeleteBySerial(n); + items.DeleteAt(n); } } } @@ -169,7 +169,7 @@ namespace hgl { Clear(obj->value); - items.DeleteBySerial(index); + items.DeleteAt(index); } return 0; diff --git a/inc/hgl/type/ResPool.h b/inc/hgl/type/ResPool.h index 80f76f6..2ebbecb 100644 --- a/inc/hgl/type/ResPool.h +++ b/inc/hgl/type/ResPool.h @@ -135,7 +135,7 @@ namespace hgl if(pos>0) //在闲置列表中找 { active_items.Add(key,new ActiveItem(value)); - idle_items.DeleteBySerial(pos); + idle_items.DeleteAt(pos); return(true); } @@ -167,7 +167,7 @@ namespace hgl if(ai->ref_count==0) { idle_items.Add(key,ai->data); - active_items.DeleteBySerial(pos); + active_items.DeleteAt(pos); } return;