diff --git a/inc/hgl/type/Inherit.h b/inc/hgl/type/Inherit.h new file mode 100644 index 0000000..4c9bcc2 --- /dev/null +++ b/inc/hgl/type/Inherit.h @@ -0,0 +1,30 @@ +#pragma once +#include +#include + +namespace hgl +{ + template class Inherit:public ParentClass + { + public: + + template Inherit(ARGS...args):ParentClass(args...) {} + + virtual ~Inherit()=default; + + template static SharedPtr CreateObject(ARGS &&...args) + { + SubClass *sc=new SubClass(args...); + + return SharedPtr(sc); + } + + const size_t sizeofObject()const noexcept override { return sizeof(SubClass); } + const char * className ()const noexcept override { return typeid(SubClass).name(); } + const size_t classHash ()const noexcept override { return typeid(SubClass).hash_code(); } + };//template class Inherit + + template class Inherit<_Object,SubClass>:public _Object + { + }; +}//namespace hgl