42 result.SetError(
"Failed to create instance of type");
47 Ref<Type> object =
reinterpret_cast<Type *
>(
rtti->CreateObject());
51 result.SetError(
"Failed to restore object");
126template <
class ArrayType,
class ValueType>
135template <
class ArrayType,
class ValueType>
150 for (
size_t i = 0;
i <
len; ++
i)
153 if (
value.HasError())
#define JPH_NAMESPACE_END
Definition Core.h:367
std::uint32_t uint32
Definition Core.h:442
#define JPH_NAMESPACE_BEGIN
Definition Core.h:361
#define JPH_ASSERT(...)
Definition IssueReporting.h:33
AllocateFunction Allocate
Definition Memory.cpp:59
std::vector< T, STLAllocator< T > > Array
Definition STLAllocator.h:81
std::unordered_map< Key, T, Hash, KeyEqual, STLAllocator< pair< const Key, T > > > UnorderedMap
Definition UnorderedMap.h:13
const RTTI * Find(const char *inName)
Find type info for a specific class by name.
Definition Factory.cpp:19
static Factory * sInstance
Singleton factory instance.
Definition Factory.h:40
Definition Reference.h:101
Helper class that either contains a valid result or an error.
Definition Result.h:15
void SetError(const char *inError)
Set an error value.
Definition Result.h:155
Simple binary input stream.
Definition StreamIn.h:13
Simple binary output stream.
Definition StreamOut.h:13
Definition StreamUtils.h:15
UnorderedMap< const Type *, uint32 > ObjectToIDMap
Definition StreamUtils.h:18
Result< ArrayType > RestoreObjectArray(StreamIn &inStream, IDToObjectMap< ValueType > &ioIDToObjectMap)
Definition StreamUtils.h:136
Array< Ref< Type > > IDToObjectMap
Definition StreamUtils.h:21
Result< Ref< Type > > RestoreObject(StreamIn &inStream, void(Type::*inRestoreBinaryStateFunction)(StreamIn &))
Definition StreamUtils.h:25
Result< Ref< Type > > RestoreObjectReference(StreamIn &inStream, IDToObjectMap< Type > &ioIDToObjectMap)
Restore an object reference from stream.
Definition StreamUtils.h:91
void SaveObjectArray(StreamOut &inStream, const ArrayType &inArray, ObjectToIDMap< ValueType > *ioObjectToIDMap)
Definition StreamUtils.h:127
void SaveObjectReference(StreamOut &inStream, const Type *inObject, ObjectToIDMap< Type > *ioObjectToIDMap)
Save an object reference to a stream. Uses a map to map objects to IDs which is also used to prevent ...
Definition StreamUtils.h:61