Skip to content

OTPPoint

dsmurfin edited this page Aug 28, 2021 · 2 revisions

OTPPoint

OTP Point

public struct OTPPoint: Comparable, Hashable 

The smallest, indivisible component having properties of motion. This may be the center of a complex Object, or merely one of many Points on it.

OTP Points are identified using an OTPAddress, and contain OTPModules containing transform information about the point. They may optionally have a CID identifier and sampled timestamp for a winning OTPProducer.

Inheritance

Comparable, Hashable

Initializers

init(address:priority:name:)

Initializes a new OTP Point.

public init(address: OTPAddress, priority: UInt8, name: String = "") 

Parameters

  • address: The Address of the Point.
  • priority: The Priority for this Point.
  • name: Optional: A human-readable name for this Point.

Properties

address

The OTPAddress identifying the point.

public var address: OTPAddress

priority

The priority of the point, used when arbitrating between multiple points with the same OTPAddress.

public var priority: UInt8

name

A human-readable name for this point.

public var name: String

modules

The modules for this point.

public var modules: [OTPModule]

cid

An optional winning CID for this point (when from a producer).

public var cid: UUID?

sampled

An optional sampled time for this point (when from a producer).

public var sampled: UInt64?

Methods

hash(into:)

OTP Point Hashable

public func hash(into hasher: inout Hasher) 

Parameters

  • hashable: The hasher to use when combining the components of this instance.

Operators

==

OTP Point Equatable

public static func == (lhs: Self, rhs: Self) -> Bool 

Parameters

  • lhs: The first instance to be compared.
  • rhs: The second instance to be compared.

Returns

Whether the instances are considered equal.

<

OTP Point Comparable

public static func < (lhs: Self, rhs: Self) -> Bool 

Parameters

  • lhs: The first instance to be compared.
  • rhs: The second instance to be compared.

Returns

Whether the first instance is considered smaller than the second.

Clone this wiki locally