added IDObject
This commit is contained in:
parent
268f0530b6
commit
8fd3b3912d
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user