Photon Fusion 2.0.4

Public Member Functions | List of all members
IElementReaderWriter< T > Interface Template Reference

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

Public Member Functions

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

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 ( element)

Calculate the hash code of an element.

Parameters
element
Returns

◆ GetElementWordCount()

int GetElementWordCount ( )

Gets the word count of an element.

Returns
The word count of an element.

◆ 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.

◆ 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.

◆ Write()

void Write ( byte *  data,
int  index,
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.