- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
#define DECLARE_TYPE(Name, Type) \
using TYPE = Type; \
ObjectInterface s_##Type##ObjectInterface (Name, []()->ObjectType* { return new Type;
#define DECLARE_METHODS \
}, {
#define DECLARE_PROPERTIES \
}, {
#define DECLARE_METHOD(Method) \
{ #Method, reinterpret_cast <_ObjectMethodProc> (&TYPE::Method) },
#define DECLARE_CUSTOM_NAME_METHOD(Name, Method) \
{ Name, reinterpret_cast <_ObjectMethodProc> (&TYPE::Method) },
#define DECLARE_METHOD_MAPPER(_1,_2,DECLARE_METHOD,...) DECLARE_METHOD
#define METHOD(...) DECLARE_METHOD_MAPPER(__VA_ARGS__, DECLARE_CUSTOM_NAME_METHOD, DECLARE_METHOD)(__VA_ARGS__)
#define PROPERTY(Name, Get, Set) \
{ Name, { reinterpret_cast <_PropertyGettingProc> (&TYPE::Get), reinterpret_cast <_PropertySettingProc> (&TYPE::Set) } },
#define END_DECLARE_TYPE \
});
когда мощности шаблонов недостаточно