added IDObject

This commit is contained in:
hyzboy 2024-08-23 01:56:13 +08:00
parent 268f0530b6
commit 8fd3b3912d

View File

@ -41,4 +41,30 @@ namespace hgl
//此代码取自AngelScript感谢 //此代码取自AngelScript感谢
#define GetMemberFuncPointer(c,m) MethodPtr<sizeof(void (c::*)())>::Convert((void (c::*)())(&c::m)) #define GetMemberFuncPointer(c,m) MethodPtr<sizeof(void (c::*)())>::Convert((void (c::*)())(&c::m))
/**
*
*/
template<typename T> inline constexpr const size_t GetTypeHash()
{
return typeid(T).hash_code();
}
class IDObject :public _Object
{
private:
size_t object_type_hash; ///<最终类的类型哈希值
public:
IDObject(const size_t &oth)
{
object_type_hash=oth;
}
virtual ~IDObject()=default;
const size_t GetObjectTypeHash()const { return object_type_hash; }
};//class IDObject
}//namespace hgl }//namespace hgl