docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IMessageBuilder

    Interface for a message builder class. A message builder is used to convert data inherited from IMessageProducer and convert it to a message.

    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
    Type Name Description
    string key

    The key to add

    bool value

    The value to add

    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
    Type Name Description
    string key

    The key to add

    byte value

    The value to add

    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 AddEncodedImage(string, string, byte[]) instead

    AddChar(string, char)

    Add a key/value pair to the message.

    Declaration
    void AddChar(string key, char value)
    Parameters
    Type Name Description
    string key

    The key to add

    char value

    The value to add

    AddDouble(string, double)

    Add a key/value pair to the message.

    Declaration
    void AddDouble(string key, double value)
    Parameters
    Type Name Description
    string key

    The key to add

    double value

    The value to add

    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
    Type Name Description
    string key

    The key to add

    float value

    The value to add

    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
    Type Name Description
    string key

    The key to add

    int value

    The value to add

    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
    Type Name Description
    string key

    The key to add

    long value

    The value to add

    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
    IMessageBuilder

    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
    IMessageBuilder

    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
    Type Name Description
    string key

    The key to add

    string value

    The value to add

    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
    Type Name Description
    string key

    The key to add

    Tensor tensor

    The tensor value to add

    AddUInt(string, uint)

    Add a key/value pair to the message.

    Declaration
    void AddUInt(string key, uint value)
    Parameters
    Type Name Description
    string key

    The key to add

    uint value

    The value to add

    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

    In This Article
    • Methods
      • AddBool(string, bool)
      • AddBoolArray(string, IEnumerable<bool>)
      • AddByte(string, byte)
      • AddByteArray(string, IEnumerable<byte>)
      • AddChar(string, char)
      • AddDouble(string, double)
      • AddDoubleArray(string, IEnumerable<double>)
      • AddEncodedImage(string, string, byte[])
      • AddFloat(string, float)
      • AddFloatArray(string, IEnumerable<float>)
      • AddInt(string, int)
      • AddIntArray(string, IEnumerable<int>)
      • AddLong(string, long)
      • AddLongArray(string, IEnumerable<long>)
      • AddNestedMessage(string)
      • AddNestedMessageToVector(string)
      • AddString(string, string)
      • AddStringArray(string, IEnumerable<string>)
      • AddTensor(string, Tensor)
      • AddUInt(string, uint)
      • AddUIntArray(string, IEnumerable<uint>)
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)