Struct MessageTypeId
Identifies a ROS message type by name and an optional disambiguator.
Inherited Members
Namespace: Unity.SimulationPro.Foundation
Assembly: Unity.SimulationPro.Foundation.dll
Syntax
public struct MessageTypeId
Remarks
Some ROS packages define message types with the same base name. The MessageDisambiguator distinguishes between them when registering publishers or subscribers.
Constructors
MessageTypeId(string, MessageDisambiguator)
Initializes a new MessageTypeId with the specified type name and optional disambiguator.
Declaration
public MessageTypeId(string messageTypeName, MessageDisambiguator disambiguator = MessageDisambiguator.Default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | messageTypeName | The fully-qualified ROS message type name. |
| MessageDisambiguator | disambiguator | An optional disambiguator. Defaults to Default. |
Properties
Disambiguator
Gets the disambiguator that resolves naming collisions between message types.
Declaration
public readonly MessageDisambiguator Disambiguator { get; }
Property Value
| Type | Description |
|---|---|
| MessageDisambiguator |
IsValid
Gets a value indicating whether this instance holds a valid (non-empty) message type name.
Declaration
public bool IsValid { get; }
Property Value
| Type | Description |
|---|---|
| bool |
MessageTypeName
Gets the fully-qualified ROS message type name (for example, geometry_msgs/Point).
Declaration
public readonly string MessageTypeName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Equals(object)
Declaration
public override bool Equals(object other)
Parameters
| Type | Name | Description |
|---|---|---|
| object | other |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
ToString()
Returns the message type name, appending the disambiguator in parentheses when it is not Default.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A human-readable string identifying this message type. |
Overrides
Operators
operator ==(MessageTypeId, MessageTypeId)
Returns true if both instances have the same type name and disambiguator.
Declaration
public static bool operator ==(MessageTypeId a, MessageTypeId b)
Parameters
| Type | Name | Description |
|---|---|---|
| MessageTypeId | a | The left operand. |
| MessageTypeId | b | The right operand. |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(MessageTypeId, MessageTypeId)
Returns true if the instances differ in type name or disambiguator.
Declaration
public static bool operator !=(MessageTypeId a, MessageTypeId b)
Parameters
| Type | Name | Description |
|---|---|---|
| MessageTypeId | a | The left operand. |
| MessageTypeId | b | The right operand. |
Returns
| Type | Description |
|---|---|
| bool |