Photon Fusion 2.1.1

IElementReaderWriter< T > Interface Template Reference

Defines the interface for reading and writing elements in a byte array. More...

Inherited by ElementReaderWriterBoolean, ElementReaderWriterString< TCapacity >, ElementReaderWriterUnmanaged< T, TWordCount >, NetworkBehaviour, and NetworkBehaviour.

Public Member Functions

int GetElementHashCode (T element)
 Calculate the hash code of an element.
int GetElementWordCount ()
 Gets the word count of an element.
Read (byte *data, int index)
 Reads an element from the specified index in the byte array.
ref T ReadRef (byte *data, int index)
 Reads a reference to an element from the specified index in the byte array.
void Write (byte *data, int index, T element)
 Writes an element to the specified index in the byte array.

Detailed Description

Defines the interface for reading and writing elements in a byte array.

Template Parameters
TThe type of the elements.

Member Function Documentation

◆ GetElementHashCode()

int GetElementHashCode ( T element)

Calculate the hash code of an element.

Parameters
element
Returns

Implemented in ElementReaderWriterUnmanaged< T, TWordCount >.

◆ GetElementWordCount()

int GetElementWordCount ( )

Gets the word count of an element.

Returns
The word count of an element.

Implemented in ElementReaderWriterBoolean, ElementReaderWriterString< TCapacity >, and ElementReaderWriterUnmanaged< T, TWordCount >.

◆ Read()

T Read ( byte * data,
int index )

Reads an element from the specified index in the byte array.

Parameters
dataThe byte array.
indexThe index of the element.
Returns
The element at the specified index.

Implemented in ElementReaderWriterBoolean, ElementReaderWriterString< TCapacity >, and ElementReaderWriterUnmanaged< T, TWordCount >.

◆ ReadRef()

ref T ReadRef ( byte * data,
int index )

Reads a reference to an element from the specified index in the byte array.

Parameters
dataThe byte array.
indexThe index of the element.
Returns
A reference to the element at the specified index.

Implemented in ElementReaderWriterBoolean, ElementReaderWriterString< TCapacity >, and ElementReaderWriterUnmanaged< T, TWordCount >.

◆ Write()

void Write ( byte * data,
int index,
T element )

Writes an element to the specified index in the byte array.

Parameters
dataThe byte array.
indexThe index at which to write the element.
elementThe element to write.

Implemented in ElementReaderWriterUnmanaged< T, TWordCount >.