PutPaddingMode

public enum PutPaddingMode : UInt16

Defines a padding mode for putting data bytes. Depending on how that data is created, this mode may optimize data handling by avoiding copying memory. Internal background: data buffers used by put operations are required to have a size divisible by 4 for an efficient data layout.

  • T

    Undocumented

    Declaration

    Swift

    public typealias T = UInt16
  • Undocumented

    Declaration

    Swift

    public static var byteSize: Int { get }
  • Undocumented

    Declaration

    Swift

    public var value: UInt16 { get }
  • Not a real type, just best practice (e.g. forward compatibility)

    Declaration

    Swift

    case unknown = 0
  • Adds a padding when needed (requiring to copy memory): this is the safe option and also the default. The extra memory copy may impact performance, however this is usually not noticeable.

    Declaration

    Swift

    case paddingautomatic = 1
  • Indicates that data buffers are safe to be extended for padding (adding up to 3 bytes to size is OK). Typically, it depends on the used FlatBuffers builder; e.g. the official C++ seems to ensure it, but flatcc (3rd party implementation for plain C) does not.

    Declaration

    Swift

    case paddingallowedbybuffer = 2
  • The caller ensures that all data bytes are already padded. ObjectBox will verify this and throws an exception if this is violated.

    Declaration

    Swift

    case paddingbycaller = 3
  • max

    Undocumented

    Declaration

    Swift

    public static var max: PutPaddingMode { get }
  • min

    Undocumented

    Declaration

    Swift

    public static var min: PutPaddingMode { get }