Photon Fusion 2.0.4

Public Member Functions | Properties | List of all members
UnityValueSurrogate< T, TReaderWriter > Class Template Reference

Represents a base class for Unity value surrogates. This class is serializable and provides methods for reading, writing, and initializing data. More...

Inherits UnitySurrogateBase, and IUnityValueSurrogate< T >.

Public Member Functions

override void Init (int capacity)
 Initializes the UnityValueSurrogate with a specified capacity. More...
 
override void Read (int *data, int capacity)
 Reads data into the UnityValueSurrogate from a specified memory location. More...
 
override void Write (int *data, int capacity)
 Writes data from the UnityValueSurrogate to a specified memory location. More...
 

Properties

abstract T DataProperty [get, set]
 Gets or sets the data for the UnityValueSurrogate. More...
 
- Properties inherited from IUnityValueSurrogate< T >
DataProperty [get, set]
 Gets or sets the data for the Unity value surrogate. More...
 

Detailed Description

Represents a base class for Unity value surrogates. This class is serializable and provides methods for reading, writing, and initializing data.

Template Parameters
TThe type of the data.
TReaderWriterThe type of the reader/writer for the data. Must be unmanaged and implement IElementReaderWriter{T}.
Type Constraints
TReaderWriter :unmanaged 
TReaderWriter :IElementReaderWriter<T> 

Member Function Documentation

◆ Init()

override void Init ( int  capacity)
virtual

Initializes the UnityValueSurrogate with a specified capacity.

Parameters
capacityThe capacity to initialize the UnityValueSurrogate with.

Implements UnitySurrogateBase.

◆ Read()

override void Read ( int *  data,
int  capacity 
)
virtual

Reads data into the UnityValueSurrogate from a specified memory location.

Parameters
dataThe memory location to read from.
capacityThe number of elements to read.

Implements UnitySurrogateBase.

◆ Write()

override void Write ( int *  data,
int  capacity 
)
virtual

Writes data from the UnityValueSurrogate to a specified memory location.

Parameters
dataThe memory location to write to.
capacityThe number of elements to write.

Implements UnitySurrogateBase.

Property Documentation

◆ DataProperty

abstract T DataProperty
getset

Gets or sets the data for the UnityValueSurrogate.