2 #ifndef UGDK_SCRIPT_VIRTUALPRIMITIVE_H_
3 #define UGDK_SCRIPT_VIRTUALPRIMITIVE_H_
11 #define TYPENAME_MAP(definition) \
12 definition(const char*, String); \
13 definition(bool, Boolean); \
14 definition(int, Integer); \
15 definition(long, Integer); \
16 definition(short, Integer); \
17 definition(float, Number); \
18 definition(double, Number);
27 return static_cast <T*> (
38 #define DEFINE_SCRIPT_PRIMITIVE_VALUE(type, name, arg) \
40 class VirtualPrimitive<type> { \
42 static type value(const VirtualData::Ptr data, bool disown) { \
43 return static_cast<type>(data->Unwrap##name()); \
45 static void set_value(const VirtualData::Ptr data, type value) { \
46 data->Wrap##name(arg); \
49 VirtualPrimitive() {} \
52 #define DEFINE_SCRIPT_SIMPLE_PRIMITIVE_VALUE(type, name) \
53 DEFINE_SCRIPT_PRIMITIVE_VALUE(type, name, value)