Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
StreamUtils Namespace Reference

Typedefs

template<class Type >
using ObjectToIDMap = UnorderedMap< const Type *, uint32 >
 
template<class Type >
using IDToObjectMap = Array< Ref< Type > >
 

Functions

template<class Type >
Result< Ref< Type > > RestoreObject (StreamIn &inStream, void(Type::*inRestoreBinaryStateFunction)(StreamIn &))
 
template<class Type >
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 writing duplicates. More...
 
template<class Type >
Result< Ref< Type > > RestoreObjectReference (StreamIn &inStream, IDToObjectMap< Type > &ioIDToObjectMap)
 Restore an object reference from stream. More...
 
template<class ArrayType , class ValueType >
void SaveObjectArray (StreamOut &inStream, const ArrayType &inArray, ObjectToIDMap< ValueType > *ioObjectToIDMap)
 
template<class ArrayType , class ValueType >
Result< ArrayType > RestoreObjectArray (StreamIn &inStream, IDToObjectMap< ValueType > &ioIDToObjectMap)
 

Typedef Documentation

◆ IDToObjectMap

template<class Type >
using StreamUtils::IDToObjectMap = typedef Array<Ref<Type> >

◆ ObjectToIDMap

template<class Type >
using StreamUtils::ObjectToIDMap = typedef UnorderedMap<const Type *, uint32>

Function Documentation

◆ RestoreObject()

template<class Type >
Result< Ref< Type > > StreamUtils::RestoreObject ( StreamIn inStream,
void(Type::*)(StreamIn &)  inRestoreBinaryStateFunction 
)

◆ RestoreObjectArray()

template<class ArrayType , class ValueType >
Result< ArrayType > StreamUtils::RestoreObjectArray ( StreamIn inStream,
IDToObjectMap< ValueType > &  ioIDToObjectMap 
)

◆ RestoreObjectReference()

template<class Type >
Result< Ref< Type > > StreamUtils::RestoreObjectReference ( StreamIn inStream,
IDToObjectMap< Type > &  ioIDToObjectMap 
)

Restore an object reference from stream.

◆ SaveObjectArray()

template<class ArrayType , class ValueType >
void StreamUtils::SaveObjectArray ( StreamOut inStream,
const ArrayType &  inArray,
ObjectToIDMap< ValueType > *  ioObjectToIDMap 
)

◆ SaveObjectReference()

template<class Type >
void StreamUtils::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 writing duplicates.