Skip to content

Commit 99fe41c

Browse files
committed
feat: make constructors working
1 parent 1956978 commit 99fe41c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

engine/foundation/core/private/rtti/object.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
//[ Rtti interface ]
3030
//[-------------------------------------------------------]
3131
be_begin_class(Object, core)
32+
be_default_constructor()
3233
be_end_class()
3334

3435

engine/foundation/core/public/core/rtti/rtti_macros.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,26 @@ struct Register_##NAMESPACE_##CLASS { \
102102
}; \
103103
static Register_##NAMESPACE_##CLASS NAMESPACE_##CLASS_declare_class_register; \
104104
void NAMESPACE::CLASS::register_reflection() { \
105+
typedef NAMESPACE::CLASS _CLASS; \
105106
core::Class::declare<NAMESPACE::CLASS>(#NAMESPACE"::"#CLASS) \
106107

107108

108109
#define be_end_class() \
109110
;}
110111

111112

113+
#define be_base_class(NAME) \
114+
.base(#NAME)
115+
116+
117+
#define be_default_constructor() \
118+
.constructor(new core::Constructor<_CLASS>())
119+
120+
121+
#define be_constructor(...) \
122+
.constructor(new core::Constructor<_CLASS, __VA_ARGS__>())
123+
124+
112125
#define __be_declare_enum(ENUM) \
113126
template<> struct core::StaticTypeInfo<ENUM> { \
114127
static core::TypeInfo* get() { \

0 commit comments

Comments
 (0)