17#ifdef JPH_OBJECT_STREAM
21template <
class T>
using Queue = std::queue<T, std::deque<T, STLAllocator<T>>>;
41 result = stream->
Write((
void *)&inObject, GetRTTI(&inObject));
53 stream.open(inFileName, std::ofstream::out | std::ofstream::trunc | std::ofstream::binary);
54 if (!stream.is_open())
56 return sWriteObject(stream, inType, inObject);
64 bool Write(
const void *inObject,
const RTTI *inRTTI);
65 void WriteObject(
const void *inObject);
66 void QueueRTTI(
const RTTI *inRTTI);
67 void WriteRTTI(
const RTTI *inRTTI);
83 ObjectInfo() : mIdentifier(0), mRTTI(
nullptr) { }
84 ObjectInfo(
Identifier inIdentifier,
const RTTI *inRTTI) : mIdentifier(inIdentifier), mRTTI(inRTTI) { }
95 Identifier mNextIdentifier = sNullIdentifier + 1;
96 IdentifierMap mIdentifierMap;
97 ObjectQueue mObjectQueue;
99 ClassQueue mClassQueue;
#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
std::queue< T, std::deque< T, STLAllocator< T > > > Queue
Definition: ObjectStreamOut.h:21
std::unordered_map< Key, T, Hash, KeyEqual, STLAllocator< pair< const Key, T > > > UnorderedMap
Definition: UnorderedMap.h:13
std::unordered_set< Key, Hash, KeyEqual, STLAllocator< Key > > UnorderedSet
Definition: UnorderedSet.h:13
Interface class for writing to an object stream.
Definition: ObjectStream.h:76
virtual void WritePointerData(const RTTI *inRTTI, const void *inPointer)=0
virtual void WriteClassData(const RTTI *inRTTI, const void *inInstance)=0
uint32 Identifier
Identifier for objects.
Definition: ObjectStream.h:33
EStreamType
Stream type.
Definition: ObjectStream.h:23
Definition: ObjectStreamOut.h:26
bool Write(const void *inObject, const RTTI *inRTTI)
Definition: ObjectStreamOut.cpp:35
static bool sWriteObject(const char *inFileName, ObjectStream::EStreamType inType, const T &inObject)
Main function to write an object to a file.
Definition: ObjectStreamOut.h:50
static bool sWriteObject(ostream &inStream, ObjectStream::EStreamType inType, const T &inObject)
Main function to write an object to a stream.
Definition: ObjectStreamOut.h:33
static ObjectStreamOut * Open(EStreamType inType, ostream &inStream)
Static constructor.
Definition: ObjectStreamOut.cpp:24
ostream & mStream
Definition: ObjectStreamOut.h:78