Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PropertySwitchSerializer<Structure, Field>

Type parameters

  • Structure: object

  • Field: keyof Structure

Hierarchy

Index

Constructors

constructor

Methods

arrayBufferToValue

  • arrayBufferToValue(arrayBuffer: ArrayBuffer): Structure

clone

deserialize

  • deserialize(dv: DataView, offset: number): { offset: number; val: Structure }

finalize

  • finalize(): this

getByteSizeFromDataInBuffer

  • getByteSizeFromDataInBuffer(dv: DataView, offset: number): number

getSizeForValue

  • getSizeForValue(val: Structure): number

getStaticSize

  • getStaticSize(): number | undefined

register

  • register<Id, Ser>(id: Id, ser: Ser): this
  • Registers a serializer which will be used to serialize the value when the field (defined in the constructor) has the value equal to the value given as id. If there is already another serializer attached to this id it will be overwritten.

    Type parameters

    • Id: Structure[Field]

    • Ser: OnlyFitting<Structure, Field, Id>

    Parameters

    • id: Id

      the id the field has to be to use this serializer

    • ser: Ser

      the serializer to use

    Returns this

serialize

  • serialize(dv: DataView, offset: number, val: Structure): { offset: number }

typeCheck

  • typeCheck(val: Structure, name?: string): void

valueToArrayBuffer

  • valueToArrayBuffer(val: Structure): ArrayBuffer

Generated using TypeDoc