16#define JPH_DECLARE_SERIALIZATION_FUNCTIONS(linkage, prefix, class_name) \
17 linkage prefix bool OSReadData(IObjectStreamIn &ioStream, class_name &inInstance); \
18 linkage prefix bool OSReadData(IObjectStreamIn &ioStream, class_name *&inPointer); \
19 linkage prefix bool OSIsType(class_name *, int inArrayDepth, EOSDataType inDataType, const char *inClassName); \
20 linkage prefix bool OSIsType(class_name **, int inArrayDepth, EOSDataType inDataType, const char *inClassName); \
21 linkage prefix void OSWriteData(IObjectStreamOut &ioStream, const class_name &inInstance); \
22 linkage prefix void OSWriteData(IObjectStreamOut &ioStream, class_name *const &inPointer); \
23 linkage prefix void OSWriteDataType(IObjectStreamOut &ioStream, class_name *); \
24 linkage prefix void OSWriteDataType(IObjectStreamOut &ioStream, class_name **);
27#define JPH_IMPLEMENT_SERIALIZATION_FUNCTIONS(class_name) \
28 bool OSReadData(IObjectStreamIn &ioStream, class_name &inInstance) \
30 return ioStream.ReadClassData(#class_name, (void *)&inInstance); \
32 bool OSReadData(IObjectStreamIn &ioStream, class_name *&inPointer) \
34 return ioStream.ReadPointerData(JPH_RTTI(class_name), (void **)&inPointer); \
36 bool OSIsType(class_name *, int inArrayDepth, EOSDataType inDataType, const char *inClassName) \
38 return inArrayDepth == 0 && inDataType == EOSDataType::Instance && strcmp(inClassName, #class_name) == 0; \
40 bool OSIsType(class_name **, int inArrayDepth, EOSDataType inDataType, const char *inClassName) \
42 return inArrayDepth == 0 && inDataType == EOSDataType::Pointer && strcmp(inClassName, #class_name) == 0; \
44 void OSWriteData(IObjectStreamOut &ioStream, const class_name &inInstance) \
46 ioStream.WriteClassData(JPH_RTTI(class_name), (void *)&inInstance); \
48 void OSWriteData(IObjectStreamOut &ioStream, class_name *const &inPointer) \
51 ioStream.WritePointerData(GetRTTI(inPointer), (void *)inPointer); \
53 ioStream.WritePointerData(nullptr, nullptr); \
55 void OSWriteDataType(IObjectStreamOut &ioStream, class_name *) \
57 ioStream.WriteDataType(EOSDataType::Instance); \
58 ioStream.WriteName(#class_name); \
60 void OSWriteDataType(IObjectStreamOut &ioStream, class_name **) \
62 ioStream.WriteDataType(EOSDataType::Pointer); \
63 ioStream.WriteName(#class_name); \
71#define JPH_DECLARE_SERIALIZABLE_NON_VIRTUAL(linkage, class_name) \
73 JPH_DECLARE_RTTI_NON_VIRTUAL(linkage, class_name) \
74 JPH_DECLARE_SERIALIZATION_FUNCTIONS(linkage, friend, class_name) \
77#define JPH_IMPLEMENT_SERIALIZABLE_NON_VIRTUAL(class_name) \
78 JPH_IMPLEMENT_SERIALIZATION_FUNCTIONS(class_name) \
79 JPH_IMPLEMENT_RTTI_NON_VIRTUAL(class_name) \
86#define JPH_DECLARE_SERIALIZABLE_OUTSIDE_CLASS(linkage, class_name) \
87 JPH_DECLARE_RTTI_OUTSIDE_CLASS(linkage, class_name) \
88 JPH_DECLARE_SERIALIZATION_FUNCTIONS(linkage, extern, class_name) \
91#define JPH_IMPLEMENT_SERIALIZABLE_OUTSIDE_CLASS(class_name) \
92 JPH_IMPLEMENT_SERIALIZATION_FUNCTIONS(class_name) \
93 JPH_IMPLEMENT_RTTI_OUTSIDE_CLASS(class_name) \
100#define JPH_DECLARE_SERIALIZABLE_VIRTUAL(linkage, class_name) \
102 JPH_DECLARE_RTTI_VIRTUAL(linkage, class_name) \
103 JPH_DECLARE_SERIALIZATION_FUNCTIONS(linkage, friend, class_name) \
106#define JPH_IMPLEMENT_SERIALIZABLE_VIRTUAL(class_name) \
107 JPH_IMPLEMENT_SERIALIZATION_FUNCTIONS(class_name) \
108 JPH_IMPLEMENT_RTTI_VIRTUAL(class_name) \
111#define JPH_DECLARE_SERIALIZABLE_ABSTRACT(linkage, class_name) \
113 JPH_DECLARE_RTTI_ABSTRACT(linkage, class_name) \
114 JPH_DECLARE_SERIALIZATION_FUNCTIONS(linkage, friend, class_name) \
117#define JPH_IMPLEMENT_SERIALIZABLE_ABSTRACT(class_name) \
118 JPH_IMPLEMENT_SERIALIZATION_FUNCTIONS(class_name) \
119 JPH_IMPLEMENT_RTTI_ABSTRACT(class_name) \
122#define JPH_DECLARE_SERIALIZABLE_VIRTUAL_BASE(linkage, class_name) \
124 JPH_DECLARE_RTTI_VIRTUAL_BASE(linkage, class_name) \
125 JPH_DECLARE_SERIALIZATION_FUNCTIONS(linkage, friend, class_name) \
128#define JPH_IMPLEMENT_SERIALIZABLE_VIRTUAL_BASE(class_name) \
129 JPH_IMPLEMENT_SERIALIZATION_FUNCTIONS(class_name) \
130 JPH_IMPLEMENT_RTTI_VIRTUAL_BASE(class_name) \
133#define JPH_DECLARE_SERIALIZABLE_ABSTRACT_BASE(linkage, class_name) \
135 JPH_DECLARE_RTTI_ABSTRACT_BASE(linkage, class_name) \
136 JPH_DECLARE_SERIALIZATION_FUNCTIONS(linkage, friend, class_name) \
139#define JPH_IMPLEMENT_SERIALIZABLE_ABSTRACT_BASE(class_name) \
140 JPH_IMPLEMENT_SERIALIZATION_FUNCTIONS(class_name) \
141 JPH_IMPLEMENT_RTTI_ABSTRACT_BASE(class_name)
#define JPH_EXPORT
Definition: Core.h:227
#define JPH_NAMESPACE_END
Definition: Core.h:367
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:361
#define JPH_DECLARE_SERIALIZABLE_ABSTRACT_BASE(linkage, class_name)
Definition: SerializableObject.h:133
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition: NonCopyable.h:11
Definition: SerializableObject.h:147
virtual ~SerializableObject()=default
Constructor.