Photon Fusion 2.1.1

NetworkTransformTrace.BufferedDataReader< T > Struct Template Reference

Helpful for reading from a BufferedData<T>. More...

Public Member Functions

 BufferedDataReader (BufferedData< T > bufferedData)
 Creates new BufferedDataReader<T> that reads from the passed in BufferedData<T>.
bool Read (out T value)
 Reads the next value from the underlying circular buffer.

Properties

readonly T Recent [get]
 Gets the most recent value written to the buffer or default(T) if no data has been written yet.

Detailed Description

Helpful for reading from a BufferedData<T>.

keeps track of where in the circular buffer we have read to and reading can be resumed using BufferedDataReader<T>.Read(out T)

Template Parameters
T
Type Constraints
T :struct 

Member Function Documentation

◆ BufferedDataReader()

BufferedDataReader ( BufferedData< T > bufferedData)

Creates new BufferedDataReader<T> that reads from the passed in BufferedData<T>.

Parameters
bufferedData

◆ Read()

bool Read ( out T value)

Reads the next value from the underlying circular buffer.

Increments the index and returns true if an item was found.

Can be called from a while loop that exits when this returns false

Parameters
valueThe read value
Returns