Cubios::NetworkMessage
Constructors
NetworkMessage
Summary
Constructs network message object
Arguments
- data - (optional) pointer to unsigned byte array that hold initial data payload
- length - (optional) size of the data array
Synopsis
Public Methods
WriteInt
Summary
Writes integer value to the object's data bitstream
Arguments
- value - integer value
- bits - number of bits allocated for the value
Synopsis
WriteSignedInt
Summary
Writes signed integer value to the object's data bitstream
Arguments
- value - integer value
- bits - number of bits allocated for the value
Synopsis
WriteBool
Summary
Writes boolean value to the object's data bitstream
Arguments
- value - boolean value
Synopsis
WriteFloat
Summary
Writes floating point value to the object's data bitstream
Arguments
- value - floating point value
Synopsis
ReadInt
Summary
Reads integer value of known length in bits from the object's data bitstream
Arguments
- bits - value length in bits
Output
Returns integer value read from the bitstream
Synopsis
ReadSignedInt
Summary
Reads signed integer value of known length in bits from the object's data bitstream
Arguments
- bits - value length in bits
Output
Returns integer value read from the bitstream
Synopsis
ReadBool
Summary
Reads boolean value from the object's data bitstream
Output
Returns boolean value read from the bitstream
Synopsis
ReadFloat
Summary
Reads floating point value from the object's data bitstream
Output
Returns floating point value read from the bitstream
Synopsis
GetData
Summary
Gets raw data payload
Arguments
- length - integer variable that receives the length of the resulting data array
Output
Returns a pointer to data payload byte array
Synopsis
SetData
Summary
Sets raw data payload
Arguments
- data - byte array of raw data payload
- length - length of the data array
Synopsis
Reset
Summary
Resets object's bitstream read/write cursor to the beginning
Arguments
- zero - (optional) if set, payload data will be zeroed
Synopsis
Summary
Prints out object's data payload to the console
Synopsis