Interface IMessageBuilder
Interface for a message builder class. A message builder is used to convert data
inherited from IMessage
Namespace: UnityEngine .Perception.GroundTruth .DataModel
Assembly: Unity.Perception.Runtime.dll
Syntax
public interface IMessageBuilder
Methods
AddBool(string, bool)
Add a key/value pair to the message.
Declaration
void AddBool(string key, bool value)
Parameters
AddBoolArray(string, IEnumerable<bool>)
Add a key/value array pair to the message.
Declaration
void AddBoolArray(string key, IEnumerable<bool> value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key to add |
IEnumerable<bool> | value | The array of values to add |
AddByte(string, byte)
Add a key/value pair to the message.
Declaration
void AddByte(string key, byte value)
Parameters
AddByteArray(string, IEnumerable<byte>)
Add a key/value array pair to the message.
Declaration
[Obsolete("AddByteArray has been deprecated, Use AddEncodedImage instead", true)]
void AddByteArray(string key, IEnumerable<byte> value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key to add |
IEnumerable<byte> | value | The array of values to add |
Remarks
This method is obsolete, using Add
AddChar(string, char)
Add a key/value pair to the message.
Declaration
void AddChar(string key, char value)
Parameters
AddDouble(string, double)
Add a key/value pair to the message.
Declaration
void AddDouble(string key, double value)
Parameters
AddDoubleArray(string, IEnumerable<double>)
Add a key/value array pair to the message.
Declaration
void AddDoubleArray(string key, IEnumerable<double> value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key to add |
IEnumerable<double> | value | The array of values to add |
AddEncodedImage(string, string, byte[])
Add an encoded byte array image to the message as a key/value pair.
Declaration
void AddEncodedImage(string key, string extension, byte[] value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key to add |
string | extension | Image extension for the image type, for example a PNG image would be "png" |
byte[] | value | The array of values to add |
AddFloat(string, float)
Add a key/value pair to the message.
Declaration
void AddFloat(string key, float value)
Parameters
AddFloatArray(string, IEnumerable<float>)
Add a key/value array pair to the message.
Declaration
void AddFloatArray(string key, IEnumerable<float> value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key to add |
IEnumerable<float> | value | The array of values to add |
AddInt(string, int)
Add a key/value pair to the message.
Declaration
void AddInt(string key, int value)
Parameters
AddIntArray(string, IEnumerable<int>)
Add a key/value array pair to the message.
Declaration
void AddIntArray(string key, IEnumerable<int> value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key to add |
IEnumerable<int> | value | The array of values to add |
AddLong(string, long)
Add a key/value pair to the message.
Declaration
void AddLong(string key, long value)
Parameters
AddLongArray(string, IEnumerable<long>)
Add a key/value array pair to the message.
Declaration
void AddLongArray(string key, IEnumerable<long> value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key to add |
IEnumerable<long> | value | The array of values to add |
AddNestedMessage(string)
Adds a nested message to the message. A nested message is a new nested hierarchy inside of the message. This method returns a new builder set to write at the new level.
Declaration
IMessageBuilder AddNestedMessage(string key)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key of the new nested message element |
Returns
Type | Description |
---|---|
IMessage |
The builder used to build the nested messages |
AddNestedMessageToVector(string)
Retrieves the builder for a nested message that takes in more than one value.
Declaration
IMessageBuilder AddNestedMessageToVector(string arrayKey)
Parameters
Type | Name | Description |
---|---|---|
string | arrayKey | The key of the nested element |
Returns
Type | Description |
---|---|
IMessage |
The builder of the nested elment |
AddString(string, string)
Add a key/value pair to the message.
Declaration
void AddString(string key, string value)
Parameters
AddStringArray(string, IEnumerable<string>)
Add a key/value array pair to the message.
Declaration
void AddStringArray(string key, IEnumerable<string> value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key to add |
IEnumerable<string> | value | The array of values to add |
AddTensor(string, Tensor)
Add a key/tensor value pair to the message.
Declaration
void AddTensor(string key, Tensor tensor)
Parameters
AddUInt(string, uint)
Add a key/value pair to the message.
Declaration
void AddUInt(string key, uint value)
Parameters
AddUIntArray(string, IEnumerable<uint>)
Add a key/value array pair to the message.
Declaration
void AddUIntArray(string key, IEnumerable<uint> value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key to add |
IEnumerable<uint> | value | The array of values to add |