diff --git a/inc/hgl/io/MemoryOutputStream.h b/inc/hgl/io/MemoryOutputStream.h index 9c48bdb..ade132a 100644 --- a/inc/hgl/io/MemoryOutputStream.h +++ b/inc/hgl/io/MemoryOutputStream.h @@ -140,7 +140,7 @@ namespace hgl max_size=0; } - void ClearData() + void Clear() { cur_pos=0; buf_size=0; diff --git a/inc/hgl/thread/DataPost.h b/inc/hgl/thread/DataPost.h index f4f1a93..6cc0025 100644 --- a/inc/hgl/thread/DataPost.h +++ b/inc/hgl/thread/DataPost.h @@ -88,7 +88,7 @@ namespace hgl } else { - data_list[recv_index].ClearData(); //清空接收区的数据 + data_list[recv_index].Clear(); //清空接收区的数据 post_lock.Lock(); _Swap(); diff --git a/inc/hgl/thread/SwapColl.h b/inc/hgl/thread/SwapColl.h index 7e5a0f7..4d72e99 100644 --- a/inc/hgl/thread/SwapColl.h +++ b/inc/hgl/thread/SwapColl.h @@ -54,7 +54,7 @@ namespace hgl { lock.Lock(); proc_list.Add(join_list); - join_list.ClearData(); + join_list.Clear(); lock.Unlock(); return proc_list; @@ -124,7 +124,7 @@ namespace hgl lock.Lock(); proc_list.Add(join_list); - join_list.ClearData(); + join_list.Clear(); lock.Unlock(); return(true); @@ -140,7 +140,7 @@ namespace hgl lock.Lock(); proc_list.Add(join_list); - join_list.ClearData(); + join_list.Clear(); lock.Unlock(); return(true); diff --git a/inc/hgl/thread/Thread.h b/inc/hgl/thread/Thread.h index 73766c7..875366b 100644 --- a/inc/hgl/thread/Thread.h +++ b/inc/hgl/thread/Thread.h @@ -176,7 +176,7 @@ namespace hgl ++p; } - thread_set.ClearData(); + thread_set.Clear(); } /** diff --git a/inc/hgl/thread/Workflow.h b/inc/hgl/thread/Workflow.h index 14d038a..8edd01c 100644 --- a/inc/hgl/thread/Workflow.h +++ b/inc/hgl/thread/Workflow.h @@ -134,7 +134,7 @@ namespace hgl this->OnFinish(wt_index); - wl.ClearData(); + wl.Clear(); } return(true); diff --git a/inc/hgl/type/Gradient.h b/inc/hgl/type/Gradient.h index 549068a..e999ed1 100644 --- a/inc/hgl/type/Gradient.h +++ b/inc/hgl/type/Gradient.h @@ -32,7 +32,7 @@ namespace hgl Comparator comp; - hgl::Sort(stop_list.GetArray(),&comp); + ::Sort(stop_list.GetArray(),&comp); dirty=false; } diff --git a/inc/hgl/type/List.h b/inc/hgl/type/List.h index 713e29b..8feeafb 100644 --- a/inc/hgl/type/List.h +++ b/inc/hgl/type/List.h @@ -115,8 +115,8 @@ namespace hgl int Add(const List &l){return Add(l.items,l.count);} ///<增加一批数据 - virtual void Free(){data_array.Free();} ///<清除所有数据 - virtual void ClearData(){data_array.Clear();} ///<清除所有数据,但不清空缓冲区 + virtual void Free(){data_array.Free();} ///<清除所有数据,并释放内存 + virtual void Clear(){data_array.Clear();} ///<清除所有数据,但不清空缓冲区 virtual int Find(const T &data)const{return data_array.Find(data);} ///<查找指定数据的索引 virtual bool IsExist(const T &flag)const{return Find(flag)>=0;} ///<确认数据项是否存在 diff --git a/inc/hgl/type/Map.cpp b/inc/hgl/type/Map.cpp index 851513c..08c13fe 100644 --- a/inc/hgl/type/Map.cpp +++ b/inc/hgl/type/Map.cpp @@ -477,7 +477,7 @@ namespace hgl * 清除所有数据 */ template - void _Map::Clear() + void _Map::Free() { data_pool.Clear(); data_list.Free(); @@ -487,19 +487,19 @@ namespace hgl * 清除所有数据,但不释放内存 */ template - void _Map::ClearData() + void _Map::Clear() { data_pool.ReleaseActive(); - data_list.ClearData(); + data_list.Clear(); } template void _Map::operator=(const ThisClass &ftd) { - Clear(); + Free(); data_pool.Clear(); - data_list.ClearData(); + data_list.Clear(); const int count=ftd.data_list.GetCount(); @@ -602,7 +602,7 @@ namespace hgl template void _Map::WithList(_Map::KVDataList &with_list,const List &in_list) { - with_list.ClearData(); + with_list.Clear(); const int count=this->GetCount(); if(count<=0)return; @@ -626,7 +626,7 @@ namespace hgl template void _Map::WithoutList(_Map::KVDataList &without_list,const List &in_list) { - without_list.ClearData(); + without_list.Clear(); const int count=this->GetCount(); if(count<=0)return; diff --git a/inc/hgl/type/Map.h b/inc/hgl/type/Map.h index dec528d..76fa9e0 100644 --- a/inc/hgl/type/Map.h +++ b/inc/hgl/type/Map.h @@ -61,8 +61,8 @@ namespace hgl virtual bool DeleteAt(int,int); ///<根据序号将指定数据从列表中移除 virtual bool ChangeOrAdd(const K &,const V &); ///<更改一个数据的内容(如不存在则添加) virtual bool Change(const K &,const V &); ///<更改一个数据的内容(如不存在则更改失效) - virtual void Clear(); ///<清除所有数据 - virtual void ClearData(); ///<清除所有数据,但不释放内存 + virtual void Free(); ///<清除所有数据,并释放内存 + virtual void Clear(); ///<清除所有数据,但不释放内存 KVDataList & GetList(){return data_list;} ///<取得线性列表 KVData ** GetDataList()const{return data_list.GetData();} ///<取得纯数据线性列表 @@ -239,7 +239,7 @@ namespace hgl */ void UnlinkAll() { - SuperClass::Clear(); + SuperClass::Free(); } /** @@ -287,7 +287,7 @@ namespace hgl while(n--) DeleteObject(n); - SuperClass::Clear(); + SuperClass::Free(); } /** diff --git a/inc/hgl/type/ObjectList.h b/inc/hgl/type/ObjectList.h index f5ff2fc..8e65b69 100644 --- a/inc/hgl/type/ObjectList.h +++ b/inc/hgl/type/ObjectList.h @@ -32,16 +32,16 @@ namespace hgl virtual void Free() override ///<清除所有数据 { - ClearData(); + Clear(); List::Free(); } - virtual void ClearData() override ///<清除所有数据,但不清空缓冲区 + virtual void Clear() override ///<清除所有数据,但不清空缓冲区 { for(auto *obj:data_array) DeleteObject(obj); - List::ClearData(); + List::Clear(); } virtual bool IsExist(const ItemPointer &flag)const override ///<确认数据项是否存在 @@ -54,7 +54,7 @@ namespace hgl virtual bool Unlink(int start,int number){return List::Delete(start,number);} ///<将指定索引处的数据与列表断开 virtual bool UnlinkByValue(const ItemPointer &ip){return List::DeleteByValue(ip);} ///<将一个指定数据与列表断开 virtual void UnlinkByValue(const ItemPointer *ip,int n){List::DeleteByValue(ip,n);} ///<将一批指定数据与列表断开 - virtual void UnlinkAll(){List::ClearData();} ///<断开所有数据 + virtual void UnlinkAll(){List::Clear();} ///<断开所有数据 private: @@ -157,7 +157,7 @@ namespace hgl if(new_count<=0) { - ClearData(); + Clear(); return(true); } @@ -194,6 +194,6 @@ namespace hgl } };//template class ObjectList - #define OBJECT_LIST_ARRAY_CLEAR(object_list) for(auto &obj:object_list)obj.Clear(); - #define OBJECT_LIST_ARRAY_CLEAR_DATA(object_list) for(auto &obj:object_list)obj.ClearData(); + #define OBJECT_LIST_ARRAY_FREE(object_list) for(auto &obj:object_list)obj.Free(); + #define OBJECT_LIST_ARRAY_CLEAR(object_list) for(auto &obj:object_list)obj.Clear(); }//namespace hgl diff --git a/inc/hgl/type/ObjectManage.h b/inc/hgl/type/ObjectManage.h index dae4773..6ed34bf 100644 --- a/inc/hgl/type/ObjectManage.h +++ b/inc/hgl/type/ObjectManage.h @@ -51,7 +51,7 @@ namespace hgl Clear(obj->value); } - items.Clear(); + items.Free(); } virtual void ClearFree() ///<清除所有引用计数为0的对象 diff --git a/inc/hgl/type/Pool.h b/inc/hgl/type/Pool.h index 96ab483..14b8b7e 100644 --- a/inc/hgl/type/Pool.h +++ b/inc/hgl/type/Pool.h @@ -175,14 +175,14 @@ namespace hgl dlc->OnIdle(Active.GetData(),Active.GetCount()); Idle.Push(Active.GetData(),Active.GetCount()); - Active.ClearData(); + Active.Clear(); } virtual void ClearActive() { dlc->Clear(Active.GetData(),Active.GetCount()); - Active.ClearData(); + Active.Clear(); } virtual void ClearIdle() ///<清除所有非活跃数据 diff --git a/inc/hgl/type/SortedSets.h b/inc/hgl/type/SortedSets.h index 128236e..48f946f 100644 --- a/inc/hgl/type/SortedSets.h +++ b/inc/hgl/type/SortedSets.h @@ -121,8 +121,8 @@ namespace hgl return total; } - void Clear (){data_list.Clear();} ///<清除数据 - void ClearData (){data_list.ClearData();} ///<清除数据,但不释放内存 + void Free (){data_list.Free();} ///<清除数据,并释放内存 + void Clear (){data_list.Clear();} ///<清除数据,但不释放内存 bool Get (const int index,T &data) ///<根据序列号取得指定数据 { diff --git a/inc/hgl/type/StringList.h b/inc/hgl/type/StringList.h index 101417b..7ff3478 100644 --- a/inc/hgl/type/StringList.h +++ b/inc/hgl/type/StringList.h @@ -138,7 +138,7 @@ namespace hgl /** * 清除所有字符串 */ - void Clear(){Items.ClearData();} ///<删除列表中的所有字符串 + void Clear(){Items.Clear();} ///<删除列表中的所有字符串 /** * 删除指定的字符串