Go to the documentation of this file.
22 #ifndef _XN_DATA_TYPES_H_
23 #define _XN_DATA_TYPES_H_
42 #define XN_DECLARE_DEFAULT_VALUE_TRANSLATOR_DECL(decl, Type, ClassName) \
43 class decl ClassName \
46 static XnValue CreateValueCopy(Type const& orig) \
48 if (sizeof(Type) > sizeof(XnValue)) \
50 Type* pNew = XN_NEW(Type, orig); \
51 return (XnValue)pNew; \
56 xnOSMemCopy(&result, &orig, sizeof(Type)); \
60 static void FreeValue(XnValue& Value) \
62 if (sizeof(Type) > sizeof(XnValue)) \
64 Type* p = (Type*)Value; \
68 static XnValue GetAsValue(Type const& orig) \
70 if (sizeof(Type) > sizeof(XnValue)) \
72 return (XnValue)&orig; \
77 xnOSMemCopy(&result, &orig, sizeof(Type)); \
81 static Type const& GetFromValue(const XnValue& Value) \
83 if (sizeof(Type) > sizeof(XnValue)) \
85 Type const* p = (Type const*)Value; \
90 Type const* p = (Type const*)&Value; \
94 static Type& GetFromValue(XnValue& Value) \
96 if (sizeof(Type) > sizeof(XnValue)) \
98 Type* p = (Type*)Value; \
103 Type* p = (Type*)&Value; \
112 #define XN_DECLARE_DEFAULT_VALUE_TRANSLATOR(Type, ClassName) \
113 XN_DECLARE_DEFAULT_VALUE_TRANSLATOR_DECL(, Type, ClassName)
115 #define XN_DEFAULT_TRANSLATOR_NAME(ClassName) ClassName ## Translator
117 #endif // _XN_DATA_TYPES_H_