23 struct ClassDescription;
37 result = (outObject !=
nullptr);
48 bool result = sReadObject(inStream,
object);
55 static bool sReadObject(
const char *inFileName, T *&outObject)
58 stream.open(inFileName, std::ifstream::in | std::ifstream::binary);
59 if (!stream.is_open())
61 return sReadObject(stream, outObject);
69 bool result = sReadObject(inFileName,
object);
79 void * Read(
const RTTI *inRTTI);
80 void * ReadObject(
const RTTI *& outRTTI);
82 virtual bool ReadClassData(
const char *inClassName,
void *inInstance)
override;
83 bool ReadClassData(
const ClassDescription &inClassDesc,
void *inInstance);
84 virtual bool ReadPointerData(
const RTTI *inRTTI,
void **inPointer,
int inRefCountOffset = -1)
override;
85 bool SkipAttributeData(
int inArrayDepth,
EOSDataType inDataType,
const char *inClassName);
92 static bool GetInfo(istream &inStream, EStreamType &outType,
int &outVersion,
int &outRevision);
101 struct AttributeDescription
110 struct ClassDescription
112 ClassDescription() =
default;
113 explicit ClassDescription(
const RTTI *inRTTI) : mRTTI(inRTTI) { }
115 const RTTI * mRTTI =
nullptr;
121 ObjectInfo() =
default;
122 ObjectInfo(
void *inInstance,
const RTTI *inRTTI) : mInstance(inInstance), mRTTI(inRTTI) { }
124 void * mInstance =
nullptr;
125 const RTTI * mRTTI =
nullptr;
132 Identifier mIdentifier;
139 ClassDescriptionMap mClassDescriptionMap;
140 IdentifierMap mIdentifierMap;
#define JPH_EXPORT
Definition Core.h:214
#define JPH_SUPPRESS_WARNINGS_STD_BEGIN
Definition Core.h:359
#define JPH_SUPPRESS_WARNINGS_STD_END
Definition Core.h:371
#define JPH_NAMESPACE_END
Definition Core.h:354
#define JPH_NAMESPACE_BEGIN
Definition Core.h:348
#define JPH_RTTI(class_name)
Definition RTTI.h:315
std::vector< T, STLAllocator< T > > Array
Definition STLAllocator.h:81
std::basic_string< char, std::char_traits< char >, STLAllocator< char > > String
Definition STLAllocator.h:82
EOSDataType
Data type.
Definition SerializableAttribute.h:15
@ Invalid
Next token on the stream was not a valid data type.
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:40
virtual bool ReadPointerData(const RTTI *inRTTI, void **inPointer, int inRefCountOffset=-1)=0
virtual bool ReadClassData(const char *inClassName, void *inInstance)=0
Definition ObjectStreamIn.h:21
static ObjectStreamIn * Open(istream &inStream)
Static constructor.
Definition ObjectStreamIn.cpp:51
void * Read(const RTTI *inRTTI)
Definition ObjectStreamIn.cpp:78
static bool sReadObject(const char *inFileName, T *&outObject)
Main function to read an object from a file.
Definition ObjectStreamIn.h:55
static bool sReadObject(istream &inStream, Ref< T > &outObject)
Main function to read an object from a stream (reference counting pointer version)
Definition ObjectStreamIn.h:45
static bool sReadObject(istream &inStream, T *&outObject)
Main function to read an object from a stream.
Definition ObjectStreamIn.h:28
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:66
istream & mStream
Definition ObjectStreamIn.h:97
Definition Reference.h:101