Data serializer plugin v1.0.2
DataSerializer
Loading...
Searching...
No Matches
UDeSerializerObject Class Reference

A class responsible for deserializing data from a memory buffer. More...

#include <DeSerializerObject.h>

Public Member Functions

 UDeSerializerObject ()
 
virtual void Clear ()
 
virtual void Start (const TArray< uint8 > &InBytes)
 
template<typename T >
bool TryReadT (T &OutValue)
 
virtual bool TryReadInt (int32 &OutInt)
 
virtual bool TryReadInt64 (int64 &OutInt64)
 
virtual bool TryReadFloat (float &OutFloat)
 
virtual bool TryReadDouble (double &OutDouble)
 
virtual bool TryReadBool (bool &OutBool)
 
virtual bool TryReadUInt8 (uint8 &OutUInt8)
 
virtual bool TryReadVector (FVector &OutVector)
 
virtual bool TryReadIntVector (FIntVector &OutIntVector)
 
virtual bool TryReadVector2D (FVector2D &OutVector2D)
 
virtual bool TryReadIntPoint (FIntPoint &OutIntPoint)
 
virtual bool TryReadRotator (FRotator &OutRotator)
 
virtual bool TryReadTransform (FTransform &OutTransform)
 
virtual bool TryReadString (FString &OutString)
 
virtual bool TryReadObject (UObject *InObjectOuter, UObject *&OutObject)
 
virtual bool TryReadObjects (UObject *InObjectOuter, TArray< UObject * > &OutObjects)
 

Protected Member Functions

FMemoryReader & GetMemoryReaderRef () const
 

Protected Attributes

TSharedPtr< FMemoryReader > MemoryReader
 

Detailed Description

A class responsible for deserializing data from a memory buffer.

This class provides various functions to read different data types from a memory buffer.

Constructor & Destructor Documentation

◆ UDeSerializerObject()

UDeSerializerObject::UDeSerializerObject ( )

Default constructor.

Member Function Documentation

◆ Clear()

virtual void UDeSerializerObject::Clear ( )
virtual

Clears the current deserialization state.

Note
This function resets the memory reader and any deserialized data.

◆ GetMemoryReaderRef()

FMemoryReader & UDeSerializerObject::GetMemoryReaderRef ( ) const
protected

Gets a reference to the memory reader.

Returns
A reference to the FMemoryReader instance.

◆ Start()

virtual void UDeSerializerObject::Start ( const TArray< uint8 > & InBytes)
virtual

Starts the deserialization process with the provided byte array.

Parameters
InBytesThe array of bytes to deserialize.

◆ TryReadBool()

virtual bool UDeSerializerObject::TryReadBool ( bool & OutBool)
virtual

Tries to read a boolean value from the buffer.

Parameters
OutBoolReference to the boolean variable where the read value will be stored.
Returns
true if the boolean value was successfully read; false otherwise.

◆ TryReadDouble()

virtual bool UDeSerializerObject::TryReadDouble ( double & OutDouble)
virtual

Tries to read a double value from the buffer.

Parameters
OutDoubleReference to the double variable where the read value will be stored.
Returns
true if the double value was successfully read; false otherwise.

◆ TryReadFloat()

virtual bool UDeSerializerObject::TryReadFloat ( float & OutFloat)
virtual

Tries to read a float value from the buffer.

Parameters
OutFloatReference to the float variable where the read value will be stored.
Returns
true if the float value was successfully read; false otherwise.

◆ TryReadInt()

virtual bool UDeSerializerObject::TryReadInt ( int32 & OutInt)
virtual

Tries to read an int32 value from the buffer.

Parameters
OutIntReference to the int32 variable where the read value will be stored.
Returns
true if the int32 value was successfully read; false otherwise.

◆ TryReadInt64()

virtual bool UDeSerializerObject::TryReadInt64 ( int64 & OutInt64)
virtual

Tries to read an int64 value from the buffer.

Parameters
OutInt64Reference to the int64 variable where the read value will be stored.
Returns
true if the int64 value was successfully read; false otherwise.

◆ TryReadIntPoint()

virtual bool UDeSerializerObject::TryReadIntPoint ( FIntPoint & OutIntPoint)
virtual

Tries to read an FIntPoint value from the buffer.

Parameters
OutIntPointReference to the FIntPoint variable where the read value will be stored.
Returns
true if the FIntPoint value was successfully read; false otherwise.

◆ TryReadIntVector()

virtual bool UDeSerializerObject::TryReadIntVector ( FIntVector & OutIntVector)
virtual

Tries to read an FIntVector value from the buffer.

Parameters
OutIntVectorReference to the FIntVector variable where the read value will be stored.
Returns
true if the FIntVector value was successfully read; false otherwise.

◆ TryReadObject()

virtual bool UDeSerializerObject::TryReadObject ( UObject * InObjectOuter,
UObject *& OutObject )
virtual

Tries to read an UObject value from the buffer.

Parameters
InObjectOuterObject owner (must be valid)
OutObjectUObject* variable where the read value will be stored.
Returns
true if the UObject* value was successfully read; false otherwise.

◆ TryReadObjects()

virtual bool UDeSerializerObject::TryReadObjects ( UObject * InObjectOuter,
TArray< UObject * > & OutObjects )
virtual

Tries to read an array of UObjects from the buffer.

Parameters
InObjectOuterObject owner (must be valid)
OutObjectsArray variable where the read value will be stored.
Returns
true if the TArray<UObject*> value was successfully read; false otherwise.

◆ TryReadRotator()

virtual bool UDeSerializerObject::TryReadRotator ( FRotator & OutRotator)
virtual

Tries to read an FRotator value from the buffer.

Parameters
OutRotatorReference to the FRotator variable where the read value will be stored.
Returns
true if the FRotator value was successfully read; false otherwise.

◆ TryReadString()

virtual bool UDeSerializerObject::TryReadString ( FString & OutString)
virtual

Tries to read an FString value from the buffer.

Parameters
OutStringReference to the FString variable where the read value will be stored.
Returns
true if the FString value was successfully read; false otherwise.

◆ TryReadT()

template<typename T >
bool UDeSerializerObject::TryReadT ( T & OutValue)
inline

Attempts to read a value of type T from the memory buffer.

Template Parameters
TThe type of the value to read.
Parameters
OutValueReference to the variable where the read value will be stored.
Returns
true if the value was successfully read; false otherwise.

◆ TryReadTransform()

virtual bool UDeSerializerObject::TryReadTransform ( FTransform & OutTransform)
virtual

Tries to read an FTransform value from the buffer.

Parameters
OutTransformReference to the FTransform variable where the read value will be stored.
Returns
true if the FTransform value was successfully read; false otherwise.

◆ TryReadUInt8()

virtual bool UDeSerializerObject::TryReadUInt8 ( uint8 & OutUInt8)
virtual

Tries to read a uint8 value from the buffer.

Parameters
OutUInt8Reference to the uint8 variable where the read value will be stored.
Returns
true if the uint8 value was successfully read; false otherwise.

◆ TryReadVector()

virtual bool UDeSerializerObject::TryReadVector ( FVector & OutVector)
virtual

Tries to read an FVector value from the buffer.

Parameters
OutVectorReference to the FVector variable where the read value will be stored.
Returns
true if the FVector value was successfully read; false otherwise.

◆ TryReadVector2D()

virtual bool UDeSerializerObject::TryReadVector2D ( FVector2D & OutVector2D)
virtual

Tries to read an FVector2D value from the buffer.

Parameters
OutVector2DReference to the FVector2D variable where the read value will be stored.
Returns
true if the FVector2D value was successfully read; false otherwise.

Member Data Documentation

◆ MemoryReader

TSharedPtr<FMemoryReader> UDeSerializerObject::MemoryReader
protected

Memory reader used to deserialize data from a buffer.


The documentation for this class was generated from the following file: