CustomWarning

public struct CustomWarning : Hashable

struct container for custom warning data.

This structure represents the type-specific payload associated with a custom warning.

Instances of this structure are typically produced by custom warning evaluation logic and may also be retrieved from the WarningRegistry.

Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.

  • id

    Identifier of the warning. The ID is unique only within its specific CustomWarning.customWarningType and can be used to retrieve additional information from a corresponding registry.

    Declaration

    Swift

    public var id: Int32
  • Identifier of the custom warning type.

    Defines the category of the custom warning and determines which warning registry should be used to retrieve additional warning details.

    Declaration

    Swift

    public var customWarningType: Int32
  • Start offset of the warning range along the segment.

    Specifies the distance, in meters, from the beginning of the corresponding ElectronicHorizonSegment at which the warning becomes applicable.

    Declaration

    Swift

    public var startOffsetInMeters: Double
  • End offset of the warning range along the segment.

    Specifies the distance, in meters, from the beginning of the corresponding ElectronicHorizonSegment at which the warning is no longer applicable.

    May be nil. In this case, the value is automatically considered to be equal to startOffsetInMeters.

    Declaration

    Swift

    public var endOffsetInMeters: Double?
  • Custom warning payload.

    Contains warning-specific payload data. A value of nil indicates that no additional data is associated with the warning.

    Declaration

    Swift

    public var payload: Metadata?
  • Creates a new instance.

    • Parameters

      • id: Identifier of the warning. The ID is unique only within its specific CustomWarning.customWarningType and can be used to retrieve additional information from a corresponding registry.
      • customWarningType: Identifier of the custom warning type.

      Defines the category of the custom warning and determines which warning registry should be used to retrieve additional warning details.

      • startOffsetInMeters: Start offset of the warning range along the segment.

      Specifies the distance, in meters, from the beginning of the corresponding ElectronicHorizonSegment at which the warning becomes applicable.

      • endOffsetInMeters: End offset of the warning range along the segment.

      Specifies the distance, in meters, from the beginning of the corresponding ElectronicHorizonSegment at which the warning is no longer applicable.

      May be nil. In this case, the value is automatically considered to be equal to startOffsetInMeters.

      • payload: Custom warning payload.

      Contains warning-specific payload data. A value of nil indicates that no additional data is associated with the warning.

    Declaration

    Swift

    public init(id: Int32 = 0, customWarningType: Int32 = 0, startOffsetInMeters: Double = 0.0, endOffsetInMeters: Double? = nil, payload: Metadata? = nil)