From 71a6695ab86a729b3ad88f16088d9659bd8615b9 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Thu, 31 Oct 2024 01:32:58 +0800 Subject: [PATCH] renamed to "At" instead of "GetPointer" --- inc/hgl/type/AccumMemoryManager.h | 2 +- inc/hgl/type/ActiveDataManager.h | 2 +- inc/hgl/type/ConstStringSet.h | 2 +- inc/hgl/type/DataArray.h | 2 +- inc/hgl/type/List.h | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/inc/hgl/type/AccumMemoryManager.h b/inc/hgl/type/AccumMemoryManager.h index addaf06..dc66e5b 100644 --- a/inc/hgl/type/AccumMemoryManager.h +++ b/inc/hgl/type/AccumMemoryManager.h @@ -48,7 +48,7 @@ namespace hgl void *Access(const Block *b) ///<访问一块内存 { - return b?data_array.GetPointer(b->offset):nullptr; + return b?data_array.At(b->offset):nullptr; } void Clear() diff --git a/inc/hgl/type/ActiveDataManager.h b/inc/hgl/type/ActiveDataManager.h index a1d3eaf..b56cde8 100644 --- a/inc/hgl/type/ActiveDataManager.h +++ b/inc/hgl/type/ActiveDataManager.h @@ -83,7 +83,7 @@ namespace hgl for(int i=0;i *GetStringView(const int id)const ///<根据ID取得字符串视图 { - return str_list.GetPointer(id); + return str_list.At(id); } public: diff --git a/inc/hgl/type/DataArray.h b/inc/hgl/type/DataArray.h index c51d48a..f5b9f66 100644 --- a/inc/hgl/type/DataArray.h +++ b/inc/hgl/type/DataArray.h @@ -159,7 +159,7 @@ namespace hgl return items[n]; } - T *GetPointer(int64 n)const + T *At(int64 n)const { return (n<0||n>=count)?nullptr:items+n; } diff --git a/inc/hgl/type/List.h b/inc/hgl/type/List.h index 6576e4c..c053c57 100644 --- a/inc/hgl/type/List.h +++ b/inc/hgl/type/List.h @@ -192,8 +192,8 @@ namespace hgl virtual void operator << (const T &obj){Add(obj);} ///<操作符重载添加一个数据 virtual void operator -= (const T &obj){DeleteByValue(obj);} ///<操作符重载删除一个数据 - T * GetPointer(const int index) {return data_array.GetPointer(index);} ///<取得指定序列号数据的索引 - const T * GetPointer(const int index)const{return data_array.GetPointer(index);} ///<取得指定序列号数据的索引 + T * At(const int index) {return data_array.At(index);} ///<取得指定序列号数据的索引 + const T * At(const int index)const{return data_array.At(index);} ///<取得指定序列号数据的索引 bool Get(int index, T &data)const {return data_array.ReadAt (data,index);} ///<取得指定索引处的数据 virtual bool Set(int index,const T &data) {return data_array.WriteAt(data,index);} ///<设置指定索引处的数据