GetObject改名为GetListObject,以避免和Window的GetObject宏冲突

This commit is contained in:
hyzboy 2019-06-12 16:13:35 +08:00
parent e18ffbd6f4
commit f1ab184896
7 changed files with 31 additions and 15 deletions

View File

@ -149,7 +149,6 @@ private:
return(true); return(true);
} }
public: public:
bool Init() bool Init()

View File

@ -50,6 +50,7 @@ namespace hgl
{ {
SetLocalMatrix(mat); SetLocalMatrix(mat);
} }
virtual ~SceneNode() virtual ~SceneNode()
{ {
ClearSubNode(); ClearSubNode();

View File

@ -86,7 +86,7 @@ namespace hgl
} }
};//template <typename T> class List };//template <typename T> class List
template<typename T> T *GetObject(const List<T *> &list,const int index) template<typename T> T *GetListObject(const List<T *> &list,const int index)
{ {
T *obj; T *obj;

View File

@ -208,7 +208,7 @@ namespace hgl
{ {
int index=Find(flag); int index=Find(flag);
DataPair *obj=GetObject(data_list,index); DataPair *obj=GetListObject(data_list,index);
if(!obj) if(!obj)
return(false); return(false);
@ -223,7 +223,7 @@ namespace hgl
{ {
int index=Find(key); int index=Find(key);
DataPair *obj=GetObject(data_list,index); DataPair *obj=GetListObject(data_list,index);
if(!obj) if(!obj)
return(false); return(false);
@ -315,7 +315,7 @@ namespace hgl
{ {
int index=Find(flag); int index=Find(flag);
DataPair *dp=GetObject(data_list,index); DataPair *dp=GetListObject(data_list,index);
if(!dp) if(!dp)
return(false); return(false);
@ -386,7 +386,7 @@ namespace hgl
if(index<0 if(index<0
||index>=data_list.GetCount())return(false); ||index>=data_list.GetCount())return(false);
data_pool.Release(GetObject(data_list,index)); data_pool.Release(GetListObject(data_list,index));
data_list.DeleteMove(index); data_list.DeleteMove(index);
return(true); return(true);
@ -424,7 +424,7 @@ namespace hgl
if(FindPos(flag,result)) if(FindPos(flag,result))
{ {
DataPair *dp=GetObject(data_list,result); DataPair *dp=GetListObject(data_list,result);
if(dp) if(dp)
dp->right=data; dp->right=data;
@ -449,7 +449,7 @@ namespace hgl
template<typename F,typename T,typename DataPair> template<typename F,typename T,typename DataPair>
bool _Map<F,T,DataPair>::Change(const F &flag,const T &data) bool _Map<F,T,DataPair>::Change(const F &flag,const T &data)
{ {
DataPair *dp=GetObject(data_list,Find(flag)); DataPair *dp=GetListObject(data_list,Find(flag));
if(!dp) if(!dp)
return(false); return(false);

View File

@ -93,7 +93,7 @@ namespace hgl
return count; return count;
} }
IDItem *GetItem(int n){return GetObject(data_list,n);} ///<取指定序号的数据 IDItem *GetItem(int n){return GetListObject(data_list,n);} ///<取指定序号的数据
bool Get(int,F &,T &) const; ///<取指定序号的数据 bool Get(int,F &,T &) const; ///<取指定序号的数据
bool GetKey(int,F &); ///<取指定序号的索引 bool GetKey(int,F &); ///<取指定序号的索引
bool GetValue(int,T &); ///<取指定序号的数据 bool GetValue(int,T &); ///<取指定序号的数据
@ -116,7 +116,7 @@ namespace hgl
virtual ~Map()=default; virtual ~Map()=default;
};//class Map };//class Map
template<typename T_ID,typename T_U> T_U *GetObject(Map<T_ID,T_U *> &list,const T_ID &id) template<typename T_ID,typename T_U> T_U *GetListObject(Map<T_ID,T_U *> &list,const T_ID &id)
{ {
T_U *result; T_U *result;
@ -141,7 +141,7 @@ namespace hgl
void DeleteObject(int index) void DeleteObject(int index)
{ {
DeleteObject(GetObject(this->data_list,index)); DeleteObject(GetListObject(this->data_list,index));
} }
public: public:
@ -259,7 +259,7 @@ namespace hgl
{ {
DeleteObject(index); DeleteObject(index);
DataPair *dp=GetObject(this->data_list,index); DataPair *dp=GetListObject(this->data_list,index);
if(dp) if(dp)
dp->right=data; dp->right=data;
@ -284,7 +284,7 @@ namespace hgl
{ {
DeleteObject(index); DeleteObject(index);
DataPair *dp=GetObject(this->data_list,index); DataPair *dp=GetListObject(this->data_list,index);
if(!dp) if(!dp)
return(false); return(false);
@ -327,7 +327,7 @@ namespace hgl
T *operator[](const F &index)const T *operator[](const F &index)const
{ {
auto *obj=GetObject(this->data_list,this->Find(index)); auto *obj=GetListObject(this->data_list,this->Find(index));
if(obj) if(obj)
return obj->right; return obj->right;

View File

@ -7,7 +7,8 @@ SET(BASE_TYPE_SOURCE
DataType/Color3f.cpp DataType/Color3f.cpp
DataType/Color4f.cpp DataType/Color4f.cpp
# DataType/FontInfo.cpp # DataType/FontInfo.cpp
DataType/StringList.cpp) DataType/StringList.cpp
DataType/Endian.cpp)
SOURCE_GROUP("DataType" FILES ${BASE_TYPE_SOURCE}) SOURCE_GROUP("DataType" FILES ${BASE_TYPE_SOURCE})

View File

@ -0,0 +1,15 @@
#include<hgl/type/DataType.h>
namespace hgl
{
bool CheckSystemEndian()
{
constexpr uint16 db=0xABCD;
#if HGL_ENDIAN == HGL_BIG_ENDIAN
return(*(uint8 *)&db==0xAB);
#else
return(*(uint8 *)&db==0xCD);
#endif//HGL_BIG_ENDIAN
}
}//namespace hgl