16#ifdef JPH_OBJECT_STREAM
25 struct ClassDescription;
39 result = (outObject !=
nullptr);
50 bool result = sReadObject(inStream,
object);
57 static bool sReadObject(
const char *inFileName, T *&outObject)
60 stream.open(inFileName, std::ifstream::in | std::ifstream::binary);
61 if (!stream.is_open())
63 return sReadObject(stream, outObject);
71 bool result = sReadObject(inFileName,
object);
81 void * Read(
const RTTI *inRTTI);
82 void * ReadObject(
const RTTI *& outRTTI);
84 virtual bool ReadClassData(
const char *inClassName,
void *inInstance)
override;
85 bool ReadClassData(
const ClassDescription &inClassDesc,
void *inInstance);
86 virtual bool ReadPointerData(
const RTTI *inRTTI,
void **inPointer,
int inRefCountOffset = -1)
override;
87 bool SkipAttributeData(
int inArrayDepth,
EOSDataType inDataType,
const char *inClassName);
94 static bool GetInfo(istream &inStream, EStreamType &outType,
int &outVersion,
int &outRevision);
103 struct AttributeDescription
107 EOSDataType mDestinationType = EOSDataType::Invalid;
112 struct ClassDescription
114 ClassDescription() =
default;
115 explicit ClassDescription(
const RTTI *inRTTI) : mRTTI(inRTTI) { }
117 const RTTI * mRTTI =
nullptr;
123 ObjectInfo() =
default;
124 ObjectInfo(
void *inInstance,
const RTTI *inRTTI) : mInstance(inInstance), mRTTI(inRTTI) { }
126 void * mInstance =
nullptr;
127 const RTTI * mRTTI =
nullptr;
134 Identifier mIdentifier;
141 ClassDescriptionMap mClassDescriptionMap;
142 IdentifierMap mIdentifierMap;
#define JPH_EXPORT
Definition: Core.h:236
#define JPH_SUPPRESS_WARNINGS_STD_BEGIN
Definition: Core.h:383
#define JPH_SUPPRESS_WARNINGS_STD_END
Definition: Core.h:395
#define JPH_NAMESPACE_END
Definition: Core.h:378
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:372
#define JPH_RTTI(class_name)
Definition: RTTI.h:319
std::basic_string< char, std::char_traits< char >, STLAllocator< char > > String
Definition: STLAllocator.h:107
EOSDataType
Data type.
Definition: SerializableAttribute.h:17
std::unordered_map< Key, T, Hash, KeyEqual, STLAllocator< pair< const Key, T > > > UnorderedMap
Definition: UnorderedMap.h:13
Interface class for reading from an object stream.
Definition: ObjectStream.h:42
virtual bool ReadPointerData(const RTTI *inRTTI, void **inPointer, int inRefCountOffset=-1)=0
virtual bool ReadClassData(const char *inClassName, void *inInstance)=0
Definition: ObjectStreamIn.h:23
static ObjectStreamIn * Open(istream &inStream)
Static constructor.
Definition: ObjectStreamIn.cpp:53
void * Read(const RTTI *inRTTI)
Definition: ObjectStreamIn.cpp:80
static bool sReadObject(const char *inFileName, T *&outObject)
Main function to read an object from a file.
Definition: ObjectStreamIn.h:57
static bool sReadObject(istream &inStream, Ref< T > &outObject)
Main function to read an object from a stream (reference counting pointer version)
Definition: ObjectStreamIn.h:47
static bool sReadObject(istream &inStream, T *&outObject)
Main function to read an object from a stream.
Definition: ObjectStreamIn.h:30
static bool sReadObject(const char *inFileName, Ref< T > &outObject)
Main function to read an object from a file (reference counting pointer version)
Definition: ObjectStreamIn.h:68
istream & mStream
Definition: ObjectStreamIn.h:99
Definition: Reference.h:101