Photon Quantum 3.0.0

Public Member Functions | Properties | List of all members
Quantum.FrameChecksumerBitStream Class Reference

Represents a bit stream used for frame checksum calculation. Implements the IBitStream interface. More...

Inherits Photon.Deterministic.IBitStream.

Public Member Functions

 FrameChecksumerBitStream ()
 Constructor. More...
 
 FrameChecksumerBitStream (ulong crc)
 Constructor with an initial checksum. More...
 
bool Condition (bool condition)
 Evaluates a condition and updates the checksum accordingly. More...
 
void CopyFromArray (byte[] data)
 Not supported. More...
 
void CopyFromBuffer (byte *data, int length)
 Not supported. More...
 
bool ReadBool ()
 Not supported. More...
 
bool ReadBoolean ()
 Not supported. More...
 
byte ReadByte ()
 Not supported. More...
 
FP ReadFP ()
 Not supported. More...
 
FPVector2 ReadFPVector2 ()
 Not supported. More...
 
FPVector3 ReadFPVector3 ()
 Not supported. More...
 
int ReadInt ()
 Not supported. More...
 
long ReadLong ()
 Not supported. More...
 
uint ReadUInt ()
 Not supported. More...
 
ulong ReadULong ()
 
void Reset ()
 Resets the checksum to 0. More...
 
void Reset (ulong crc)
 Resets the checksum to the specified value. More...
 
void Serialize (byte *v)
 Update the checksum with a byte. More...
 
void Serialize (int *v)
 Update the checksum with an int. More...
 
void Serialize (int *v, int bits)
 Updates the checksum with and int. More...
 
void Serialize (long *v)
 Update the checksum with a long. More...
 
void Serialize (ref bool value)
 Update the checksum with a boolean value. More...
 
void Serialize (ref byte value)
 Update the checksum with a byte value. More...
 
void Serialize (ref byte[] array, ref int length)
 Not supported. More...
 
void Serialize (ref byte[] array, ref int length, int fixedSize)
 Not supported. More...
 
void Serialize (ref byte[] value)
 Not supported. More...
 
void Serialize (ref byte[] value, int fixedSize)
 Not supported. More...
 
void Serialize (ref double value)
 Update the checksum with a double value. More...
 
void Serialize (ref float value)
 Update the checksum with a float value. More...
 
void Serialize (ref FP value)
 Update the checksum with a FP value. More...
 
void Serialize (ref FPQuaternion value)
 Update the checksum with a FPQuaternion. More...
 
void Serialize (ref FPVector2 value)
 Update the checksum with a FPVector2. More...
 
void Serialize (ref FPVector3 value)
 Update the checksum with a FPVector3. More...
 
void Serialize (ref int value)
 Update the checksum with an int value. More...
 
void Serialize (ref int value, int bits)
 Update the checksum with an int value. More...
 
void Serialize (ref int[] value)
 Updates the checksum with a byte array. Not supported, will throw an exception. More...
 
void Serialize (ref long value)
 Update the checksum with a long value. More...
 
void Serialize (ref string value)
 Not supported, will throw an exception. More...
 
void Serialize (ref uint value)
 Update the checksum with a uint value. More...
 
void Serialize (ref uint value, int bits)
 Update the checksum with a uint value. More...
 
void Serialize (ref ulong value)
 Update the checksum with a ulong value. More...
 
void Serialize (ref ulong value, int bits)
 Update the checkusm with a ulong value. More...
 
void Serialize (sbyte *v)
 Updates the the checksum with a sbyte. More...
 
void Serialize (short *v)
 Update the checksum with a short. More...
 
void Serialize (uint *v)
 Update the checksum with a uint. More...
 
void Serialize (uint *v, int bits)
 Update the checksum with an uint. More...
 
void Serialize (ulong *v)
 Update the checksum with a ulong. More...
 
void Serialize (ushort *v)
 Update the checksum with a ushort. More...
 
void SerializeArray< T > (ref T[] array, BitStream.ArrayElementSerializer< T > serializer, int maxLength=int.MaxValue)
 Updates the checksum with an array ans a custom serializer. More...
 
int SerializeArrayLength< T > (ref T[] array, int maxLength=int.MaxValue)
 Updates the checksum with an array. More...
 
void SerializeBuffer (byte *buffer, int length)
 Updates the checksum with a buffer of bytes. More...
 
void SerializeBuffer (int *buffer, int length)
 Updates the checksum with a buffer of ints. More...
 
void SerializeBuffer (long *buffer, int length)
 Updates the checksum with a buffer of longs. More...
 
void SerializeBuffer (sbyte *buffer, int length)
 Updates the checksum with a buffer of sbytes. More...
 
void SerializeBuffer (short *buffer, int length)
 Updates the checksum with a buffer of shorts. More...
 
void SerializeBuffer (uint *buffer, int length)
 Updates the checksum with a buffer of uints. More...
 
void SerializeBuffer (ulong *buffer, int length)
 Updates the checksum with a buffer of ulongs. More...
 
void SerializeBuffer (ushort *buffer, int length)
 Updates the checksum with a buffer of ushorts. More...
 
byte[] ToArray ()
 Not supported. More...
 
bool WriteBool (bool v)
 Updates the checksum with a bool. More...
 
bool WriteBoolean (bool v)
 Updates the checksum with a bool. More...
 
void WriteByte (byte v)
 Updates the checksum with a byte. More...
 
void WriteFP (FP v)
 Updates the checksum with a FP. More...
 
void WriteFPVector2 (FPVector2 v)
 Updates the checksum with a FPVector2. More...
 
void WriteFPVector3 (FPVector3 v)
 Updates the checksum with a FPVector3. More...
 
void WriteInt (int v)
 Updates the checksum with an int. More...
 
void WriteLong (long v)
 Updates the checksum with a long. More...
 
void WriteUInt (uint v)
 Updates the checksum with a uint. More...
 
void WriteULong (ulong v)
 Updates the checksum with a ulong. More...
 

Properties

int BytesRequired [get]
 Get the number of bytes required to store the checksum. More...
 
ulong Checksum [get, set]
 Get or set the current checksum. More...
 
byte[] Data [get]
 Convert the checksum into a byte array. More...
 
bool Reading [get, set]
 Indicating whether the bit stream is currently reading. More...
 
bool Writing [get, set]
 Indicating whether the bit stream is currently writing.
More...
 

Detailed Description

Represents a bit stream used for frame checksum calculation. Implements the IBitStream interface.

Constructor & Destructor Documentation

◆ FrameChecksumerBitStream() [1/2]

Quantum.FrameChecksumerBitStream.FrameChecksumerBitStream ( )
inline

Constructor.

◆ FrameChecksumerBitStream() [2/2]

Quantum.FrameChecksumerBitStream.FrameChecksumerBitStream ( ulong  crc)
inline

Constructor with an initial checksum.

Parameters
crcInitial checksum

Member Function Documentation

◆ Condition()

bool Quantum.FrameChecksumerBitStream.Condition ( bool  condition)
inline

Evaluates a condition and updates the checksum accordingly.

Parameters
conditionThe condition to evaluate.
Returns
The evaluated condition.

◆ Reset() [1/2]

void Quantum.FrameChecksumerBitStream.Reset ( ulong  crc)
inline

Resets the checksum to the specified value.

Parameters
crcThe value to reset the checksum to.

◆ Serialize() [1/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref string  value)
inline

Not supported, will throw an exception.

Parameters
valueString value
Exceptions
System.NotImplementedExceptionNot supported-

◆ Serialize() [2/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref bool  value)
inline

Update the checksum with a boolean value.

Parameters
valueBoolean value

◆ Serialize() [3/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref float  value)
inline

Update the checksum with a float value.

Parameters
valueFloat value

◆ Serialize() [4/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref double  value)
inline

Update the checksum with a double value.

Parameters
valueDouble value

◆ Serialize() [5/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref long  value)
inline

Update the checksum with a long value.

Parameters
valueLong value

◆ Serialize() [6/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref ulong  value)
inline

Update the checksum with a ulong value.

Parameters
valueUlong value

◆ Serialize() [7/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref FP  value)
inline

Update the checksum with a FP value.

Parameters
valueFP value

◆ Serialize() [8/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref FPVector2  value)
inline

Update the checksum with a FPVector2.

Parameters
valueVector2

◆ Serialize() [9/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref FPVector3  value)
inline

Update the checksum with a FPVector3.

Parameters
valueVector3

◆ Serialize() [10/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref FPQuaternion  value)
inline

Update the checksum with a FPQuaternion.

Parameters
valueQuaternion

◆ Serialize() [11/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref byte  value)
inline

Update the checksum with a byte value.

Parameters
valueByte

◆ Serialize() [12/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref uint  value)
inline

Update the checksum with a uint value.

Parameters
valueUint

◆ Serialize() [13/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref uint  value,
int  bits 
)
inline

Update the checksum with a uint value.

Parameters
valueUint
bitsUnsused

◆ Serialize() [14/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref ulong  value,
int  bits 
)
inline

Update the checkusm with a ulong value.

Parameters
valueUlong
bitsUnused

◆ Serialize() [15/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref int  value)
inline

Update the checksum with an int value.

Parameters
valueInt

◆ Serialize() [16/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref int  value,
int  bits 
)
inline

Update the checksum with an int value.

Parameters
valueInt
bitsUnused

◆ Serialize() [17/31]

void Quantum.FrameChecksumerBitStream.Serialize ( byte *  v)
inline

Update the checksum with a byte.

Parameters
vPointer to byte

◆ Serialize() [18/31]

void Quantum.FrameChecksumerBitStream.Serialize ( sbyte *  v)
inline

Updates the the checksum with a sbyte.

Parameters
vSbyte

◆ Serialize() [19/31]

void Quantum.FrameChecksumerBitStream.Serialize ( short *  v)
inline

Update the checksum with a short.

Parameters
vShort

◆ Serialize() [20/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ushort *  v)
inline

Update the checksum with a ushort.

Parameters
vUshort

◆ Serialize() [21/31]

void Quantum.FrameChecksumerBitStream.Serialize ( int *  v)
inline

Update the checksum with an int.

Parameters
vInt

◆ Serialize() [22/31]

void Quantum.FrameChecksumerBitStream.Serialize ( uint *  v)
inline

Update the checksum with a uint.

Parameters
vUint

◆ Serialize() [23/31]

void Quantum.FrameChecksumerBitStream.Serialize ( long *  v)
inline

Update the checksum with a long.

Parameters
vLong

◆ Serialize() [24/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ulong *  v)
inline

Update the checksum with a ulong.

Parameters
vUlong

◆ Serialize() [25/31]

void Quantum.FrameChecksumerBitStream.Serialize ( uint *  v,
int  bits 
)
inline

Update the checksum with an uint.

Parameters
vUint
bitsUnused

◆ Serialize() [26/31]

void Quantum.FrameChecksumerBitStream.Serialize ( int *  v,
int  bits 
)
inline

Updates the checksum with and int.

Parameters
vInt
bitsUnused

◆ SerializeBuffer() [1/8]

void Quantum.FrameChecksumerBitStream.SerializeBuffer ( byte *  buffer,
int  length 
)
inline

Updates the checksum with a buffer of bytes.

Parameters
bufferByte array
lengthArray length

◆ SerializeBuffer() [2/8]

void Quantum.FrameChecksumerBitStream.SerializeBuffer ( sbyte *  buffer,
int  length 
)
inline

Updates the checksum with a buffer of sbytes.

Parameters
bufferSbyte array
lengthArray length

◆ SerializeBuffer() [3/8]

void Quantum.FrameChecksumerBitStream.SerializeBuffer ( short *  buffer,
int  length 
)
inline

Updates the checksum with a buffer of shorts.

Parameters
bufferArray of shorts
lengthArray length

◆ SerializeBuffer() [4/8]

void Quantum.FrameChecksumerBitStream.SerializeBuffer ( ushort *  buffer,
int  length 
)
inline

Updates the checksum with a buffer of ushorts.

Parameters
bufferArray of ushort
lengthArray length

◆ SerializeBuffer() [5/8]

void Quantum.FrameChecksumerBitStream.SerializeBuffer ( int *  buffer,
int  length 
)
inline

Updates the checksum with a buffer of ints.

Parameters
bufferArray of ints
lengthArray length

◆ SerializeBuffer() [6/8]

void Quantum.FrameChecksumerBitStream.SerializeBuffer ( uint *  buffer,
int  length 
)
inline

Updates the checksum with a buffer of uints.

Parameters
bufferArray of uint
lengthArray length

◆ SerializeBuffer() [7/8]

void Quantum.FrameChecksumerBitStream.SerializeBuffer ( long *  buffer,
int  length 
)
inline

Updates the checksum with a buffer of longs.

Parameters
bufferArray of longs
lengthArray length

◆ SerializeBuffer() [8/8]

void Quantum.FrameChecksumerBitStream.SerializeBuffer ( ulong *  buffer,
int  length 
)
inline

Updates the checksum with a buffer of ulongs.

Parameters
bufferArray of ulong
lengthArray length

◆ WriteBool()

bool Quantum.FrameChecksumerBitStream.WriteBool ( bool  v)
inline

Updates the checksum with a bool.

Parameters
vBool
Returns
Returns the input value

◆ WriteBoolean()

bool Quantum.FrameChecksumerBitStream.WriteBoolean ( bool  v)
inline

Updates the checksum with a bool.

Parameters
vBool
Returns
Returns the input value

◆ WriteInt()

void Quantum.FrameChecksumerBitStream.WriteInt ( int  v)
inline

Updates the checksum with an int.

Parameters
vInt

◆ WriteUInt()

void Quantum.FrameChecksumerBitStream.WriteUInt ( uint  v)
inline

Updates the checksum with a uint.

Parameters
vUint

◆ WriteFP()

void Quantum.FrameChecksumerBitStream.WriteFP ( FP  v)
inline

Updates the checksum with a FP.

Parameters
vFP

◆ WriteFPVector2()

void Quantum.FrameChecksumerBitStream.WriteFPVector2 ( FPVector2  v)
inline

Updates the checksum with a FPVector2.

Parameters
vVector2

◆ WriteFPVector3()

void Quantum.FrameChecksumerBitStream.WriteFPVector3 ( FPVector3  v)
inline

Updates the checksum with a FPVector3.

Parameters
vVector3

◆ WriteLong()

void Quantum.FrameChecksumerBitStream.WriteLong ( long  v)
inline

Updates the checksum with a long.

Parameters
vLong

◆ WriteULong()

void Quantum.FrameChecksumerBitStream.WriteULong ( ulong  v)
inline

Updates the checksum with a ulong.

Parameters
vUlong

◆ WriteByte()

void Quantum.FrameChecksumerBitStream.WriteByte ( byte  v)
inline

Updates the checksum with a byte.

Parameters
vByte value

◆ Serialize() [27/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref int[]  value)
inline

Updates the checksum with a byte array. Not supported, will throw an exception.

Parameters
valueByte array reference
Exceptions
InvalidOperationExceptionNot supported

◆ Serialize() [28/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref byte[]  value)
inline

Not supported.

Parameters
valueValue
Exceptions
InvalidOperationExceptionNot supported

◆ Serialize() [29/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref byte[]  array,
ref int  length 
)
inline

Not supported.

Parameters
arrayArray
lengthArray length
Exceptions
InvalidOperationExceptionNot supported.

◆ Serialize() [30/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref byte[]  value,
int  fixedSize 
)
inline

Not supported.

Parameters
valueArray
fixedSizeArray fixes size
Exceptions
InvalidOperationExceptionNot supported.

◆ Serialize() [31/31]

void Quantum.FrameChecksumerBitStream.Serialize ( ref byte[]  array,
ref int  length,
int  fixedSize 
)
inline

Not supported.

Parameters
arrayArray
lengthArray length
fixedSizeArray fixed size
Exceptions
InvalidOperationExceptionNot supported.

◆ SerializeArrayLength< T >()

int Quantum.FrameChecksumerBitStream.SerializeArrayLength< T > ( ref T[]  array,
int  maxLength = int.MaxValue 
)
inline

Updates the checksum with an array.

Template Parameters
TArray type
Parameters
arrayArray reference
maxLengthThe max size of the input array.
Returns
The length of the array secured by maxLength.

◆ SerializeArray< T >()

void Quantum.FrameChecksumerBitStream.SerializeArray< T > ( ref T[]  array,
BitStream.ArrayElementSerializer< T >  serializer,
int  maxLength = int.MaxValue 
)
inline

Updates the checksum with an array ans a custom serializer.

Template Parameters
TType of array
Parameters
arrayArray reference
serializerSerializer callback
maxLengthThe max size of the input array.

◆ ReadLong()

long Quantum.FrameChecksumerBitStream.ReadLong ( )
inline

Not supported.

Returns
Throws
Exceptions
InvalidOperationExceptionNot supported.

◆ ReadUInt()

uint Quantum.FrameChecksumerBitStream.ReadUInt ( )
inline

Not supported.

Returns
Throws
Exceptions
InvalidOperationExceptionNot supported.

◆ ReadBool()

bool Quantum.FrameChecksumerBitStream.ReadBool ( )
inline

Not supported.

Returns
Throws
Exceptions
InvalidOperationExceptionNot supported.

◆ ReadBoolean()

bool Quantum.FrameChecksumerBitStream.ReadBoolean ( )
inline

Not supported.

Returns
Throws
Exceptions
InvalidOperationExceptionNot supported.

◆ ReadByte()

byte Quantum.FrameChecksumerBitStream.ReadByte ( )
inline

Not supported.

Returns
Throws
Exceptions
InvalidOperationExceptionNot supported.

◆ ReadULong()

ulong Quantum.FrameChecksumerBitStream.ReadULong ( )
inline

Not supported.

Returns
Throws
Exceptions
InvalidOperationExceptionNot supported.

◆ ReadInt()

int Quantum.FrameChecksumerBitStream.ReadInt ( )
inline

Not supported.

Returns
Throws
Exceptions
InvalidOperationExceptionNot supported.

◆ ReadFP()

FP Quantum.FrameChecksumerBitStream.ReadFP ( )
inline

Not supported.

Returns
Throws
Exceptions
InvalidOperationExceptionNot supported.

◆ ReadFPVector2()

FPVector2 Quantum.FrameChecksumerBitStream.ReadFPVector2 ( )
inline

Not supported.

Returns
Throws
Exceptions
InvalidOperationExceptionNot supported.

◆ ReadFPVector3()

FPVector3 Quantum.FrameChecksumerBitStream.ReadFPVector3 ( )
inline

Not supported.

Returns
Throws
Exceptions
InvalidOperationExceptionNot supported.

◆ CopyFromArray()

void Quantum.FrameChecksumerBitStream.CopyFromArray ( byte[]  data)
inline

Not supported.

Returns
Throws
Exceptions
InvalidOperationExceptionNot supported.

◆ CopyFromBuffer()

void Quantum.FrameChecksumerBitStream.CopyFromBuffer ( byte *  data,
int  length 
)
inline

Not supported.

Returns
Throws
Exceptions
InvalidOperationExceptionNot supported.

◆ ToArray()

byte [] Quantum.FrameChecksumerBitStream.ToArray ( )
inline

Not supported.

Returns
Throws
Exceptions
InvalidOperationExceptionNot supported.

◆ Reset() [2/2]

void Quantum.FrameChecksumerBitStream.Reset ( )
inline

Resets the checksum to 0.

Property Documentation

◆ Writing

bool Quantum.FrameChecksumerBitStream.Writing
getset

Indicating whether the bit stream is currently writing.

◆ Reading

bool Quantum.FrameChecksumerBitStream.Reading
getset

Indicating whether the bit stream is currently reading.

◆ Checksum

ulong Quantum.FrameChecksumerBitStream.Checksum
getset

Get or set the current checksum.

◆ BytesRequired

int Quantum.FrameChecksumerBitStream.BytesRequired
get

Get the number of bytes required to store the checksum.

◆ Data

byte [] Quantum.FrameChecksumerBitStream.Data
get

Convert the checksum into a byte array.