Contents

logicalValue(asTypeTruncatingIfNeeded:)

The raw value of the data cast as an integer type and bound by the Hidelement’s logical minimum and logical maximum values.

Declaration

func logicalValue<IntegerType>(asTypeTruncatingIfNeeded: IntegerType.Type) -> IntegerType? where IntegerType : FixedWidthInteger

Parameters

  • asTypeTruncatingIfNeeded:

    The type to which to cast the underlying bytes before applying bounds, truncating or extending the bytes as necessary.

Return Value

The data cast as the requested type, or nil if out of bounds.

Discussion

If the raw value is out of bounds, this returns nil. For example, if the logical minimum and logical maximum are specified as 1 and 127 respectively, and the raw value is 0, the logical value is undefined.

See Also

Get element data and values