ztype

package
v0.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package ztype provides (de)serialization functions for zserio primitive types.

Zserio defines a set of primitive types such as integer in various sizes, strings, floats and arrays. This package provides functions to read and write those types.

Normally you will never need to use this package directly. It is used by code that generated from zserio schemas.

Index

Constants

View Source
const (
	MaxInt8  = (1 << 7) - 1
	MinInt8  = -1 << 7
	MaxInt16 = (1 << 15) - 1
	MinInt16 = -1 << 15
	MaxInt32 = (1 << 31) - 1
	MinInt32 = -1 << 31
	MaxInt64 = (1 << 63) - 1
	MinInt64 = -1 << 63

	MaxUint8  = (1 << 8) - 1
	MinUint8  = 0
	MaxUint16 = (1 << 16) - 1
	MinUint16 = 0
	MaxUint32 = (1 << 32) - 1
	MinUint32 = 0
	MaxUint64 = (1 << 64) - 1
	MinUint64 = 0

	MaxVarint16 = (1 << (6 + 8)) - 1
	MinVarint16 = -MaxVarint16
	MaxVarint32 = (1 << (6 + 7 + 7 + 8)) - 1
	MinVarint32 = -MaxVarint32
	MaxVarint64 = (1 << (6 + 7 + 7 + 7 + 7 + 7 + 7 + 8)) - 1
	MinVarint64 = -MaxVarint64
	MaxVarint   = MaxInt64
	MinVarint   = MinInt64

	MaxVaruint16 = (1 << (7 + 8)) - 1
	MinVaruint16 = 0
	MaxVaruint32 = (1 << (7 + 7 + 7 + 8)) - 1
	MinVaruint32 = 0
	MaxVaruint64 = (1 << (7 + 7 + 7 + 7 + 7 + 7 + 7 + 8)) - 1
	MinVaruint64 = 0
	MaxVaruint   = MaxUint64
	MinVaruint   = 0
	MaxVarsize   = (1 << (2 + 7 + 7 + 7 + 8)) - 1
	MinVarsize   = 0
)

These constants define the minimum and maximum allowed values of the zserio numeric types.

Variables

View Source
var ErrOutOfBounds = errors.New("value too large or too small for type")

ErrOutOfBounds is an error that is returned when you try to write a value that is too large for the zserio (integer) type.

View Source
var ErrValueOutOfBitRange = errors.New("value is out of range for the given number of bits")

ErrValueOutOfBitRange is returned when you try to write a bit field type with a value that is larger than the number of bits allows for.

Functions

func BitSizeOfString

func BitSizeOfString(v string) (int, error)

BitSizeOfString returns the zserio bit size of a string.

func CountAlignBits

func CountAlignBits(bitPosition int, boundary uint8) int

CountAlignBits calculates how many bits would need to be spend to align the current bitPosition to the next boundary.

func CreatePackingContextNode

func CreatePackingContextNode[T any]() *zserio.PackingContextNode

CreatePackingContextNode creates a new PackingContextNode using a delta context.

func NumBits added in v0.2.3

func NumBits(v uint64) int

NumBits returns the exact number of bits needed to represent an unsigned integer in zserio, considering the fact that 0 is not counted, due to the zserio encoding.

func ReadBool

func ReadBool(r zserio.Reader) (bool, error)

ReadBool reads a boolean value from the bitstream

func ReadFloat16

func ReadFloat16(r zserio.Reader) (float32, error)

ReadFloat16 reads a 16-bit floating point number.

func ReadFloat32

func ReadFloat32(r zserio.Reader) (float32, error)

ReadFloat32 reads a 32-bit floating point number.

func ReadFloat64

func ReadFloat64(r zserio.Reader) (float64, error)

ReadFloat64 reads a 64-bit floating point number.

func ReadInt16

func ReadInt16(r zserio.Reader) (int16, error)

ReadInt16 reads a signed 16-bit integer.

func ReadInt32

func ReadInt32(r zserio.Reader) (int32, error)

ReadInt32 reads a signed 32-bit integer.

func ReadInt64

func ReadInt64(r zserio.Reader) (int64, error)

ReadInt64 reads a signed 64-bit integer.

func ReadInt8

func ReadInt8(r zserio.Reader) (int8, error)

ReadInt8 reads a signed 8-bit integer.

func ReadSignedBits

func ReadSignedBits(r zserio.Reader, bits uint8) (int64, error)

ReadSignedBits reads an signed number with a given number of bits

func ReadString

func ReadString(r zserio.Reader) (string, error)

ReadString reads a string from the bitstream.

func ReadUint16

func ReadUint16(r zserio.Reader) (uint16, error)

ReadUint16 reads an unsigned 16-bit integer.

func ReadUint32

func ReadUint32(r zserio.Reader) (uint32, error)

ReadUint32 reads an unsigned 32-bit integer.

func ReadUint64

func ReadUint64(r zserio.Reader) (uint64, error)

ReadUint64 reads an unsigned 64-bit integer.

func ReadUint8

func ReadUint8(r zserio.Reader) (uint8, error)

ReadUint8 reads an unsigned 8-bit integer.

func ReadUnsignedBits

func ReadUnsignedBits(r zserio.Reader, bits uint8) (uint64, error)

ReadUnsignedBits reads an unsigned number with a given number of bits

func ReadVarint

func ReadVarint(r zserio.Reader) (int64, error)

ReadVarint reads a zserio varint value from the bitstream.

func ReadVarint16

func ReadVarint16(r zserio.Reader) (int16, error)

ReadVarint16 reads a zserio varint16 value from the bitstream.

func ReadVarint32

func ReadVarint32(r zserio.Reader) (int32, error)

ReadVarint32 reads a zserio varint32 value from the bitstream.

func ReadVarint64

func ReadVarint64(r zserio.Reader) (int64, error)

ReadVarint64 reads a zserio varint64 value from the bitstream.

func ReadVarsize

func ReadVarsize(r zserio.Reader) (uint64, error)

ReadVarsize reads a zserio varsize value from the bitstream

func ReadVaruint

func ReadVaruint(r zserio.Reader) (uint64, error)

ReadVaruint reads a zserio varuint value from the bitstream

func ReadVaruint16

func ReadVaruint16(r zserio.Reader) (uint16, error)

ReadVaruint16 reads a zserio varuint16 value from the bitstream

func ReadVaruint32

func ReadVaruint32(r zserio.Reader) (uint32, error)

ReadVaruint32 reads a zserio varuint32 value from the bitstream

func ReadVaruint64

func ReadVaruint64(r zserio.Reader) (uint64, error)

ReadVaruint64 reads a zserio varuint64 value from the bitstream

func SignedBitSize

func SignedBitSize(v int64, maxBytes int) (int, error)

SignedBitSize returns the size in bits of the zserio encoding of a signed value.

func UnsignedBitSize

func UnsignedBitSize(v uint64, maxBytes int) (int, error)

UnsignedBitSize returns the size in bits of the zserio encoding of an unsigned value.

func WriteBool

func WriteBool(w zserio.Writer, v bool) error

WriteBool reads a boolean value from the bitstream

func WriteBytes added in v0.7.0

func WriteBytes(w zserio.Writer, b *BytesType) error

WriteBytes writes an zserio bytes type (variable size byte buffer) from a reader.

func WriteExtern

func WriteExtern(w zserio.Writer, e *ExternType) error

WriteExtern writes an zserio extern type (variable size bitbuffer) from a reader.

func WriteFloat16

func WriteFloat16(w zserio.Writer, v float32) error

WriteFloat16 writes a float value in half precision (FP16) format.

func WriteFloat32

func WriteFloat32(w zserio.Writer, v float32) error

WriteFloat32 writes a float32 to the bitstream.

func WriteFloat64

func WriteFloat64(w zserio.Writer, v float64) error

WriteFloat64 writes a float64 to the bitstream.

func WriteInt16

func WriteInt16(w zserio.Writer, value int16) error

WriteInt16 writes a signed 16-bit integer.

func WriteInt32

func WriteInt32(w zserio.Writer, value int32) error

WriteInt32 writes a signed 32-bit integer.

func WriteInt64

func WriteInt64(w zserio.Writer, value int64) error

WriteInt64 writes a signed 64-bit integer.

func WriteInt8

func WriteInt8(w zserio.Writer, value int8) error

WriteInt8 writes a signed 8-bit integer.

func WriteSignedBits

func WriteSignedBits(w zserio.Writer, value int64, bits uint8) error

WriteSignedBits writes an signed number with a given number of bits

func WriteString

func WriteString(w zserio.Writer, v string) error

WriteString writes a string value to the bitstream.

func WriteUint16

func WriteUint16(w zserio.Writer, value uint16) error

WriteUint16 writes an unsigned 16-bit integer.

func WriteUint32

func WriteUint32(w zserio.Writer, value uint32) error

WriteUint32 writes an unsigned 32-bit integer.

func WriteUint64

func WriteUint64(w zserio.Writer, value uint64) error

WriteUint64 writes an unsigned 64-bit integer.

func WriteUint8

func WriteUint8(w zserio.Writer, value uint8) error

WriteUint8 writes an unsigned 8-bit integer.

func WriteUnsignedBits

func WriteUnsignedBits(w zserio.Writer, value uint64, bits uint8) error

WriteUnsignedBits writes an unsigned number with a given number of bits

func WriteVarint

func WriteVarint(w zserio.Writer, v int64) error

WriteVarint writes a zserio varint value to the bitstream. If you pass in a value that is outside to allowed range of (MinVarint, MaxVarint) ErrOutOfBounds will be returned.

func WriteVarint16

func WriteVarint16(w zserio.Writer, v int16) error

WriteVarint16 writes a zserio varint16 value to the bitstream. If you pass in a value that is outside to allowed range of (MinVarint16, MaxVarint16) ErrOutOfBounds will be returned.

func WriteVarint32

func WriteVarint32(w zserio.Writer, v int32) error

WriteVarint32 writes a zserio varint32 value to the bitstream. If you pass in a value that is outside to allowed range of (MinVarint32, MaxVarint32) ErrOutOfBounds will be returned.

func WriteVarint64

func WriteVarint64(w zserio.Writer, v int64) error

WriteVarint64 writes a zserio varint64 value to the bitstream. If you pass in a value that is outside to allowed range of (MinVarint64, MaxVarint64) ErrOutOfBounds will be returned.

func WriteVarsize

func WriteVarsize(w zserio.Writer, v uint64) error

WriteVarsize writes a zserio varsize value to the bitstream. If you pass in a value that is outside to allowed range of (MinVarsize, MaxVarsize) ErrOutOfBounds will be returned.

func WriteVaruint

func WriteVaruint(w zserio.Writer, v uint64) error

WriteVaruint writes a zserio varuint value to the bitstream. If you pass in a value that is outside to allowed range of (MinVaruint, MaxVaruint) ErrOutOfBounds will be returned.

func WriteVaruint16

func WriteVaruint16(w zserio.Writer, v uint16) error

WriteVaruint16 writes a zserio varuint16 value to the bitstream. If you pass in a value that is outside to allowed range of (MinVaruint16, MaxVaruint16) ErrOutOfBounds will be returned.

func WriteVaruint32

func WriteVaruint32(w zserio.Writer, v uint32) error

WriteVaruint32 writes a zserio varuint32 value to the bitstream. If you pass in a value that is outside to allowed range of (MinVaruint32, MaxVaruint32) ErrOutOfBounds will be returned.

func WriteVaruint64

func WriteVaruint64(w zserio.Writer, v uint64) error

WriteVaruint64 writes a zserio varuint64 value to the bitstream. If you pass in a value that is outside to allowed range of (MinVaruint64, MaxVaruint64) ErrOutOfBounds will be returned.

Types

type Array

type Array[T any, Y IArrayTraits[T]] struct {
	// ArrayTraits are the array traits used.
	ArrayTraits Y

	// RawArray is a reference to the raw array.
	RawArray []T

	// IsAuto specifies if the array size is automatically calculated.
	IsAuto bool

	// IsPacked specifies if the array is packed.
	IsPacked bool

	// FixedSize is the size of the array, if the array is of fixed size
	FixedSize int

	// The node used by this array for packing
	PackedContext *zserio.PackingContextNode
	// contains filtered or unexported fields
}

Array allows representing arrays of any type and serialize them to the zserio format.

func ArrayFromReader

func ArrayFromReader[T any, Y IArrayTraits[T]](reader zserio.Reader, arrayTraits Y, size int, isPacked, isAuto bool, options ...ArrayOption[T, Y]) (*Array[T, Y], error)

ArrayFromReader is a helper function to read an array as a one-liner.

func (*Array[T, Y]) Clone

func (array *Array[T, Y]) Clone() zserio.ZserioType

Clone does a deep copy of the array.

func (*Array[T, Y]) MarshalZserio

func (array *Array[T, Y]) MarshalZserio(writer zserio.Writer) error

MarshalZserio writes an array to a bit writer.

func (*Array[T, Y]) Size

func (array *Array[T, Y]) Size() int

Size returns the number of elements in an array.

func (*Array[T, Y]) UnmarshalZserio

func (array *Array[T, Y]) UnmarshalZserio(reader zserio.Reader) error

UnmarshalZserio reads an array from a bit reader, in either packed or unpacked configuration.

func (*Array[T, Y]) ZserioBitSize

func (array *Array[T, Y]) ZserioBitSize(bitPosition int) (int, error)

ZserioBitSize returns the total size of the unpacked array in bits.

func (*Array[T, Y]) ZserioBitSizePacked

func (array *Array[T, Y]) ZserioBitSizePacked(bitPosition int) (int, error)

BitSizeOfPacked returns the total size of the packed array in bits.

type ArrayOption

type ArrayOption[T any, Y IArrayTraits[T]] interface {
	// contains filtered or unexported methods
}

ArrayOption allows to customize array creation.

func WithCheckOffsetMethod

func WithCheckOffsetMethod[T any, Y IArrayTraits[T]](fn OffsetMethod) ArrayOption[T, Y]

func WithSetOffsetMethod

func WithSetOffsetMethod[T any, Y IArrayTraits[T]](fn OffsetMethod) ArrayOption[T, Y]

type BitBufferArrayTraits added in v0.7.0

type BitBufferArrayTraits struct{}

func (BitBufferArrayTraits) AsUint64 added in v0.7.0

func (trait BitBufferArrayTraits) AsUint64(value *ExternType) uint64

func (BitBufferArrayTraits) BitSizeOf added in v0.7.0

func (trait BitBufferArrayTraits) BitSizeOf(element *ExternType, endBitPosition int) int

func (BitBufferArrayTraits) BitSizeOfIsConstant added in v0.7.0

func (trait BitBufferArrayTraits) BitSizeOfIsConstant() bool

func (BitBufferArrayTraits) FromUint64 added in v0.7.0

func (trait BitBufferArrayTraits) FromUint64(value uint64) *ExternType

func (BitBufferArrayTraits) InitializeOffsets added in v0.7.0

func (trait BitBufferArrayTraits) InitializeOffsets(bitPosition int, value *ExternType) int

func (BitBufferArrayTraits) NeedsBitsizeOfPosition added in v0.7.0

func (trait BitBufferArrayTraits) NeedsBitsizeOfPosition() bool

func (BitBufferArrayTraits) NeedsReadIndex added in v0.7.0

func (trait BitBufferArrayTraits) NeedsReadIndex() bool

func (BitBufferArrayTraits) PackedTraits added in v0.7.0

func (trait BitBufferArrayTraits) PackedTraits() IPackedArrayTraits[*ExternType]

func (BitBufferArrayTraits) Read added in v0.7.0

func (trait BitBufferArrayTraits) Read(reader zserio.Reader, endBitPosition int) (*ExternType, error)

func (BitBufferArrayTraits) Write added in v0.7.0

func (trait BitBufferArrayTraits) Write(writer zserio.Writer, value *ExternType) error

type BitFieldArrayTraits

type BitFieldArrayTraits[T constraints.Integer] struct {
	NumBits uint8
}

func (BitFieldArrayTraits[T]) AsUint64

func (trait BitFieldArrayTraits[T]) AsUint64(value T) uint64

func (BitFieldArrayTraits[T]) BitSizeOf

func (trait BitFieldArrayTraits[T]) BitSizeOf(element T, endBitPosition int) int

func (BitFieldArrayTraits[T]) BitSizeOfIsConstant

func (trait BitFieldArrayTraits[T]) BitSizeOfIsConstant() bool

func (BitFieldArrayTraits[T]) FromUint64

func (trait BitFieldArrayTraits[T]) FromUint64(value uint64) T

func (BitFieldArrayTraits[T]) InitializeOffsets

func (trait BitFieldArrayTraits[T]) InitializeOffsets(bitPosition int, value T) int

func (BitFieldArrayTraits[T]) NeedsBitsizeOfPosition

func (trait BitFieldArrayTraits[T]) NeedsBitsizeOfPosition() bool

func (BitFieldArrayTraits[T]) NeedsReadIndex

func (trait BitFieldArrayTraits[T]) NeedsReadIndex() bool

func (BitFieldArrayTraits[T]) PackedTraits

func (trait BitFieldArrayTraits[T]) PackedTraits() IPackedArrayTraits[T]

func (BitFieldArrayTraits[T]) Read

func (trait BitFieldArrayTraits[T]) Read(reader zserio.Reader, index int) (T, error)

func (BitFieldArrayTraits[T]) Write

func (trait BitFieldArrayTraits[T]) Write(writer zserio.Writer, value T) error

type BooleanArrayTraits added in v0.5.1

type BooleanArrayTraits struct{}

func (BooleanArrayTraits) AsUint64 added in v0.5.1

func (trait BooleanArrayTraits) AsUint64(value bool) uint64

func (BooleanArrayTraits) BitSizeOf added in v0.5.1

func (trait BooleanArrayTraits) BitSizeOf(element bool, endBitPosition int) int

func (BooleanArrayTraits) BitSizeOfIsConstant added in v0.5.1

func (trait BooleanArrayTraits) BitSizeOfIsConstant() bool

func (BooleanArrayTraits) FromUint64 added in v0.5.1

func (trait BooleanArrayTraits) FromUint64(value uint64) bool

func (BooleanArrayTraits) InitializeOffsets added in v0.5.1

func (trait BooleanArrayTraits) InitializeOffsets(bitPosition int, value bool) int

func (BooleanArrayTraits) NeedsBitsizeOfPosition added in v0.5.1

func (trait BooleanArrayTraits) NeedsBitsizeOfPosition() bool

func (BooleanArrayTraits) NeedsReadIndex added in v0.5.1

func (trait BooleanArrayTraits) NeedsReadIndex() bool

func (BooleanArrayTraits) PackedTraits added in v0.5.1

func (trait BooleanArrayTraits) PackedTraits() IPackedArrayTraits[bool]

func (BooleanArrayTraits) Read added in v0.5.1

func (trait BooleanArrayTraits) Read(reader zserio.Reader, index int) (bool, error)

func (BooleanArrayTraits) Write added in v0.5.1

func (trait BooleanArrayTraits) Write(writer zserio.Writer, value bool) error

type BytesArrayTraits added in v0.7.0

type BytesArrayTraits struct{}

func (BytesArrayTraits) AsUint64 added in v0.7.0

func (trait BytesArrayTraits) AsUint64(value *BytesType) uint64

func (BytesArrayTraits) BitSizeOf added in v0.7.0

func (trait BytesArrayTraits) BitSizeOf(element *BytesType, endBitPosition int) int

func (BytesArrayTraits) BitSizeOfIsConstant added in v0.7.0

func (trait BytesArrayTraits) BitSizeOfIsConstant() bool

func (BytesArrayTraits) FromUint64 added in v0.7.0

func (trait BytesArrayTraits) FromUint64(value uint64) *BytesType

func (BytesArrayTraits) InitializeOffsets added in v0.7.0

func (trait BytesArrayTraits) InitializeOffsets(bitPosition int, value *BytesType) int

func (BytesArrayTraits) NeedsBitsizeOfPosition added in v0.7.0

func (trait BytesArrayTraits) NeedsBitsizeOfPosition() bool

func (BytesArrayTraits) NeedsReadIndex added in v0.7.0

func (trait BytesArrayTraits) NeedsReadIndex() bool

func (BytesArrayTraits) PackedTraits added in v0.7.0

func (trait BytesArrayTraits) PackedTraits() IPackedArrayTraits[*BytesType]

func (BytesArrayTraits) Read added in v0.7.0

func (trait BytesArrayTraits) Read(reader zserio.Reader, endBitPosition int) (*BytesType, error)

func (BytesArrayTraits) Write added in v0.7.0

func (trait BytesArrayTraits) Write(writer zserio.Writer, value *BytesType) error

type BytesType added in v0.7.0

type BytesType struct {
	// BitSize is the size of the buffer in bytes
	ByteSize uint64

	// Buffer is the content of the zserio byte type
	Buffer []byte
}

BytesType is a helper struct to store byte blobs in zserio

func ReadBytes added in v0.7.0

func ReadBytes(r zserio.Reader) (*BytesType, error)

ReadBytes reads an zserio bytes type (variable size byte buffer) from a reader.

type DeltaContext

type DeltaContext[T any] struct {
	// contains filtered or unexported fields
}

DeltaContext is a packing context used when writing data using delta packing, i.e. instead of storing all values, only stores the deltas.

func (*DeltaContext[T]) BitSizeOf

func (context *DeltaContext[T]) BitSizeOf(arrayTraits IArrayTraits[T], bitPosition int, element T) (int, error)

BitSizeOf returns the size of the delta context array in bits.

func (*DeltaContext[T]) BitSizeOfDescriptor

func (context *DeltaContext[T]) BitSizeOfDescriptor() int

BitSizeOfDescriptor returns the bit size of a delta context array descriptor.

func (*DeltaContext[T]) Init

func (context *DeltaContext[T]) Init(arrayTraits IArrayTraits[T], element T)

Init initializes a delta context array, and calculates the needed space per element in the final array.

func (*DeltaContext[T]) Read

func (context *DeltaContext[T]) Read(arrayTraits IArrayTraits[T], reader zserio.Reader) (T, error)

Read reads the next element of an array encoded using delta contexts.

func (*DeltaContext[T]) ReadDescriptor

func (context *DeltaContext[T]) ReadDescriptor(reader zserio.Reader) error

ReadDescriptor reads the descriptor of a delta packed context.

func (*DeltaContext[T]) Write

func (context *DeltaContext[T]) Write(arrayTraits IArrayTraits[T], writer zserio.Writer, element T) error

Write writes an element of an delta context array.

func (*DeltaContext[T]) WriteDescriptor

func (context *DeltaContext[T]) WriteDescriptor(writer zserio.Writer) error

WriteDescriptor writes the descriptor of a delta packed context.

type ExternType

type ExternType struct {
	// BitSize is the size of the buffer in bits
	BitSize uint64

	// Buffer is the content of the zserio extern type
	Buffer []byte
}

ExternType is a helper struct to store zserio extern types

func ReadExtern

func ReadExtern(r zserio.Reader) (*ExternType, error)

ReadExtern reads an zserio extern type (variable size bitbuffer) from a reader.

type Float16ArrayTraits

type Float16ArrayTraits struct{}

Float16ArrayTraits is an array trait implementation for float16 arrays.

func (Float16ArrayTraits) AsUint64

func (trait Float16ArrayTraits) AsUint64(value float32) uint64

func (Float16ArrayTraits) BitSizeOf

func (trait Float16ArrayTraits) BitSizeOf(element float32, endBitPosition int) int

func (Float16ArrayTraits) BitSizeOfIsConstant

func (trait Float16ArrayTraits) BitSizeOfIsConstant() bool

func (Float16ArrayTraits) FromUint64

func (trait Float16ArrayTraits) FromUint64(value uint64) float32

func (Float16ArrayTraits) InitializeOffsets

func (trait Float16ArrayTraits) InitializeOffsets(bitPosition int, value float32) int

func (Float16ArrayTraits) NeedsBitsizeOfPosition

func (trait Float16ArrayTraits) NeedsBitsizeOfPosition() bool

func (Float16ArrayTraits) NeedsReadIndex

func (trait Float16ArrayTraits) NeedsReadIndex() bool

func (Float16ArrayTraits) PackedTraits

func (trait Float16ArrayTraits) PackedTraits() IPackedArrayTraits[float32]

func (Float16ArrayTraits) Read

func (trait Float16ArrayTraits) Read(reader zserio.Reader, index int) (float32, error)

func (Float16ArrayTraits) Write

func (trait Float16ArrayTraits) Write(writer zserio.Writer, value float32) error

type Float32ArrayTraits

type Float32ArrayTraits struct{}

Float32ArrayTraits is an array trait implementation for float32 arrays.

func (Float32ArrayTraits) AsUint64

func (trait Float32ArrayTraits) AsUint64(value float32) uint64

func (Float32ArrayTraits) BitSizeOf

func (trait Float32ArrayTraits) BitSizeOf(element float32, endBitPosition int) int

func (Float32ArrayTraits) BitSizeOfIsConstant

func (trait Float32ArrayTraits) BitSizeOfIsConstant() bool

func (Float32ArrayTraits) FromUint64

func (trait Float32ArrayTraits) FromUint64(value uint64) float32

func (Float32ArrayTraits) InitializeOffsets

func (trait Float32ArrayTraits) InitializeOffsets(bitPosition int, value float32) int

func (Float32ArrayTraits) NeedsBitsizeOfPosition

func (trait Float32ArrayTraits) NeedsBitsizeOfPosition() bool

func (Float32ArrayTraits) NeedsReadIndex

func (trait Float32ArrayTraits) NeedsReadIndex() bool

func (Float32ArrayTraits) PackedTraits

func (trait Float32ArrayTraits) PackedTraits() IPackedArrayTraits[float32]

func (Float32ArrayTraits) Read

func (trait Float32ArrayTraits) Read(reader zserio.Reader, index int) (float32, error)

func (Float32ArrayTraits) Write

func (trait Float32ArrayTraits) Write(writer zserio.Writer, value float32) error

type Float64ArrayTraits

type Float64ArrayTraits struct{}

Float64ArrayTraits is an array trait implementation for float64 arrays.

func (Float64ArrayTraits) AsUint64

func (trait Float64ArrayTraits) AsUint64(value float64) uint64

func (Float64ArrayTraits) BitSizeOf

func (trait Float64ArrayTraits) BitSizeOf(element float64, endBitPosition int) int

func (Float64ArrayTraits) BitSizeOfIsConstant

func (trait Float64ArrayTraits) BitSizeOfIsConstant() bool

func (Float64ArrayTraits) FromUint64

func (trait Float64ArrayTraits) FromUint64(value uint64) float64

func (Float64ArrayTraits) InitializeOffsets

func (trait Float64ArrayTraits) InitializeOffsets(bitPosition int, value float64) int

func (Float64ArrayTraits) NeedsBitsizeOfPosition

func (trait Float64ArrayTraits) NeedsBitsizeOfPosition() bool

func (Float64ArrayTraits) NeedsReadIndex

func (trait Float64ArrayTraits) NeedsReadIndex() bool

func (Float64ArrayTraits) PackedTraits

func (trait Float64ArrayTraits) PackedTraits() IPackedArrayTraits[float64]

func (Float64ArrayTraits) Read

func (trait Float64ArrayTraits) Read(reader zserio.Reader, index int) (float64, error)

func (Float64ArrayTraits) Write

func (trait Float64ArrayTraits) Write(writer zserio.Writer, value float64) error

type IArrayTraits

type IArrayTraits[T any] interface {
	// BitSizeOfIsConstant returns true if the bit size is constant for every
	// array element, for example int32.
	BitSizeOfIsConstant() bool

	// NeedsBitsizeOfPosition is true if the array traits need to know the bit
	// size of an array element.
	NeedsBitsizeOfPosition() bool

	// NeedsReadIndex specifies if the traits need the array index of the element.
	NeedsReadIndex() bool

	// PackedTraits will return the array trait as a packed object.
	PackedTraits() IPackedArrayTraits[T]

	// BitSizeOf returns the bit size of array element. If the sizee depends on
	// the position within the bit stream, the endBitPosition parameter is taken
	// into account.
	BitSizeOf(element T, endBitPosition int) int

	// InitializeOffsets returns the end bit position of an array element within
	// a byte stream.
	InitializeOffsets(bitPosition int, value T) int

	// Read reads an array element from a byte stream.
	Read(reader zserio.Reader, index int) (T, error)

	// Write writes an array element to a byte stream.
	Write(writer zserio.Writer, value T) error

	// AsUint64 returns the array element as a uint64. This is only needed if the
	// underlying data type supports delta encoding, such as int32, etc.
	// Other datatypes, such as string, float, can implement this empty.
	AsUint64(value T) uint64
	// FromUint64 returns an array element from a uint64. This is only needed
	// if the underlying data type supports delta encoding.
	FromUint64(value uint64) T
}

IArrayTraits is the interface used by all array traits.

type IPackedArrayTraits

type IPackedArrayTraits[T any] interface {
	CreateContext() (*zserio.PackingContextNode, error)
	InitContext(contextNode *zserio.PackingContextNode, element T) error
	BitSizeOf(contextNode *zserio.PackingContextNode, bitPosition int, element T) (int, error)
	InitializeOffsets(contextNode *zserio.PackingContextNode, bitPosition int, element T) int
	Read(contextNode *zserio.PackingContextNode, reader zserio.Reader, index int) (T, error)
	Write(contextNode *zserio.PackingContextNode, writer zserio.Writer, value T)
}

IPackedArrayTraits is the interface for array traits that are packed.

type ObjectArrayTraits

type ObjectArrayTraits[T zserio.PackableZserioType] struct {
	ObjectCreator ObjectCreator[T]
}

ObjectArrayTraits is an array traits for zserio structs, choice, union or enum types

func (ObjectArrayTraits[T]) AsUint64

func (trait ObjectArrayTraits[T]) AsUint64(value T) uint64

func (ObjectArrayTraits[T]) BitSizeOf

func (trait ObjectArrayTraits[T]) BitSizeOf(element T, endBitPosition int) int

func (ObjectArrayTraits[T]) BitSizeOfIsConstant

func (trait ObjectArrayTraits[T]) BitSizeOfIsConstant() bool

func (ObjectArrayTraits[T]) FromUint64

func (trait ObjectArrayTraits[T]) FromUint64(value uint64) T

func (ObjectArrayTraits[T]) InitializeOffsets

func (trait ObjectArrayTraits[T]) InitializeOffsets(bitPosition int, value T) int

func (ObjectArrayTraits[T]) NeedsBitsizeOfPosition

func (trait ObjectArrayTraits[T]) NeedsBitsizeOfPosition() bool

func (ObjectArrayTraits[T]) NeedsReadIndex

func (trait ObjectArrayTraits[T]) NeedsReadIndex() bool

func (ObjectArrayTraits[T]) PackedTraits

func (trait ObjectArrayTraits[T]) PackedTraits() IPackedArrayTraits[T]

func (ObjectArrayTraits[T]) Read

func (trait ObjectArrayTraits[T]) Read(reader zserio.Reader, index int) (T, error)

func (ObjectArrayTraits[T]) Write

func (trait ObjectArrayTraits[T]) Write(writer zserio.Writer, value T) error

type ObjectCreator added in v0.7.0

type ObjectCreator[T zserio.PackableZserioType] struct {
	DefaultObject T

	// If the @index operator is used, we need to store multiple default objects.
	DefaultObjects []T

	UsesIndexOperator bool
}

type ObjectPackedArrayTraits

type ObjectPackedArrayTraits[T zserio.PackableZserioType, Y IArrayTraits[T]] struct {
	ArrayTraits   Y
	ObjectCreator ObjectCreator[T]
}

ObjectPackedArrayTraits is a wrapper around array traits for zserio objects.

func (*ObjectPackedArrayTraits[T, Y]) BitSizeOf

func (traits *ObjectPackedArrayTraits[T, Y]) BitSizeOf(contextNode *zserio.PackingContextNode, bitPosition int, element T) (int, error)

BitSizeOf returns the bit size of an element of a packed array traits.

func (*ObjectPackedArrayTraits[T, Y]) CreateContext

func (traits *ObjectPackedArrayTraits[T, Y]) CreateContext() (*zserio.PackingContextNode, error)

func (*ObjectPackedArrayTraits[T, Y]) InitContext

func (traits *ObjectPackedArrayTraits[T, Y]) InitContext(contextNode *zserio.PackingContextNode, element T) error

InitContext initializes a packing context for a packed array traits.

func (*ObjectPackedArrayTraits[T, Y]) InitializeOffsets

func (traits *ObjectPackedArrayTraits[T, Y]) InitializeOffsets(contextNode *zserio.PackingContextNode, bitPosition int, element T) int

InitializeOffsets calculates the offsets of the packed array element.

func (*ObjectPackedArrayTraits[T, Y]) Read

func (traits *ObjectPackedArrayTraits[T, Y]) Read(contextNode *zserio.PackingContextNode, reader zserio.Reader, index int) (T, error)

Read reads an array element of a packed array traits.

func (*ObjectPackedArrayTraits[T, Y]) Write

func (traits *ObjectPackedArrayTraits[T, Y]) Write(contextNode *zserio.PackingContextNode, writer zserio.Writer, element T)

Write writes an array element of a packed array traits.

type OffsetMethod

type OffsetMethod func(int, int64)

OffsetMethod is a function used to set/check bit offsets in the buffer.

type PackedArrayTraits

type PackedArrayTraits[T any, Y IArrayTraits[T]] struct {
	ArrayTraits Y
}

PackedArrayTraits is a wrapper around array traits used when the array is written in packed configruation.

func (*PackedArrayTraits[T, Y]) BitSizeOf

func (traits *PackedArrayTraits[T, Y]) BitSizeOf(contextNode *zserio.PackingContextNode, bitPosition int, element T) (int, error)

BitSizeOf returns the bit size of an element of a packed array traits.

func (*PackedArrayTraits[T, Y]) CreateContext

func (traits *PackedArrayTraits[T, Y]) CreateContext() (*zserio.PackingContextNode, error)

func (*PackedArrayTraits[T, Y]) InitContext

func (traits *PackedArrayTraits[T, Y]) InitContext(contextNode *zserio.PackingContextNode, element T) error

InitContext initializes a packing context for a packed array traits.

func (*PackedArrayTraits[T, Y]) InitializeOffsets

func (traits *PackedArrayTraits[T, Y]) InitializeOffsets(contextNode *zserio.PackingContextNode, bitPosition int, element T) int

InitializeOffsets calculates the offsets of the packed array element.

func (*PackedArrayTraits[T, Y]) Read

func (traits *PackedArrayTraits[T, Y]) Read(contextNode *zserio.PackingContextNode, reader zserio.Reader, index int) (T, error)

Read reads an array element of a packed array traits.

func (*PackedArrayTraits[T, Y]) Write

func (traits *PackedArrayTraits[T, Y]) Write(contextNode *zserio.PackingContextNode, writer zserio.Writer, value T)

Write writes an array element of a packed array traits.

type SignedBitFieldArrayTraits added in v0.6.0

type SignedBitFieldArrayTraits[T constraints.Signed] struct {
	NumBits uint8
}

func (SignedBitFieldArrayTraits[T]) AsUint64 added in v0.6.0

func (trait SignedBitFieldArrayTraits[T]) AsUint64(value T) uint64

func (SignedBitFieldArrayTraits[T]) BitSizeOf added in v0.6.0

func (trait SignedBitFieldArrayTraits[T]) BitSizeOf(element T, endBitPosition int) int

func (SignedBitFieldArrayTraits[T]) BitSizeOfIsConstant added in v0.6.0

func (trait SignedBitFieldArrayTraits[T]) BitSizeOfIsConstant() bool

func (SignedBitFieldArrayTraits[T]) FromUint64 added in v0.6.0

func (trait SignedBitFieldArrayTraits[T]) FromUint64(value uint64) T

func (SignedBitFieldArrayTraits[T]) InitializeOffsets added in v0.6.0

func (trait SignedBitFieldArrayTraits[T]) InitializeOffsets(bitPosition int, value T) int

func (SignedBitFieldArrayTraits[T]) NeedsBitsizeOfPosition added in v0.6.0

func (trait SignedBitFieldArrayTraits[T]) NeedsBitsizeOfPosition() bool

func (SignedBitFieldArrayTraits[T]) NeedsReadIndex added in v0.6.0

func (trait SignedBitFieldArrayTraits[T]) NeedsReadIndex() bool

func (SignedBitFieldArrayTraits[T]) PackedTraits added in v0.6.0

func (trait SignedBitFieldArrayTraits[T]) PackedTraits() IPackedArrayTraits[T]

func (SignedBitFieldArrayTraits[T]) Read added in v0.6.0

func (trait SignedBitFieldArrayTraits[T]) Read(reader zserio.Reader, index int) (T, error)

func (SignedBitFieldArrayTraits[T]) Write added in v0.6.0

func (trait SignedBitFieldArrayTraits[T]) Write(writer zserio.Writer, value T) error

type StringArrayTraits

type StringArrayTraits struct{}

func (StringArrayTraits) AsUint64

func (trait StringArrayTraits) AsUint64(value string) uint64

func (StringArrayTraits) BitSizeOf

func (trait StringArrayTraits) BitSizeOf(element string, endBitPosition int) int

func (StringArrayTraits) BitSizeOfIsConstant

func (trait StringArrayTraits) BitSizeOfIsConstant() bool

func (StringArrayTraits) FromUint64

func (trait StringArrayTraits) FromUint64(value uint64) string

func (StringArrayTraits) InitializeOffsets

func (trait StringArrayTraits) InitializeOffsets(bitPosition int, value string) int

func (StringArrayTraits) NeedsBitsizeOfPosition

func (trait StringArrayTraits) NeedsBitsizeOfPosition() bool

func (StringArrayTraits) NeedsReadIndex

func (trait StringArrayTraits) NeedsReadIndex() bool

func (StringArrayTraits) PackedTraits

func (trait StringArrayTraits) PackedTraits() IPackedArrayTraits[string]

func (StringArrayTraits) Read

func (trait StringArrayTraits) Read(reader zserio.Reader, index int) (string, error)

func (StringArrayTraits) Write

func (trait StringArrayTraits) Write(writer zserio.Writer, value string) error

type VarInt16ArrayTraits

type VarInt16ArrayTraits struct {
}

VarInt16ArrayTraits is the implementation of an array traits for a VarInt16.

func (VarInt16ArrayTraits) AsUint64

func (trait VarInt16ArrayTraits) AsUint64(value int16) uint64

func (VarInt16ArrayTraits) BitSizeOf

func (trait VarInt16ArrayTraits) BitSizeOf(element int16, endBitPosition int) int

func (VarInt16ArrayTraits) BitSizeOfIsConstant

func (trait VarInt16ArrayTraits) BitSizeOfIsConstant() bool

func (VarInt16ArrayTraits) FromUint64

func (trait VarInt16ArrayTraits) FromUint64(value uint64) int16

func (VarInt16ArrayTraits) InitializeOffsets

func (trait VarInt16ArrayTraits) InitializeOffsets(bitPosition int, value int16) int

func (VarInt16ArrayTraits) NeedsBitsizeOfPosition

func (trait VarInt16ArrayTraits) NeedsBitsizeOfPosition() bool

func (VarInt16ArrayTraits) NeedsReadIndex

func (trait VarInt16ArrayTraits) NeedsReadIndex() bool

func (VarInt16ArrayTraits) PackedTraits

func (trait VarInt16ArrayTraits) PackedTraits() IPackedArrayTraits[int16]

func (VarInt16ArrayTraits) Read

func (trait VarInt16ArrayTraits) Read(reader zserio.Reader, index int) (int16, error)

func (VarInt16ArrayTraits) Write

func (trait VarInt16ArrayTraits) Write(writer zserio.Writer, value int16) error

type VarInt32ArrayTraits

type VarInt32ArrayTraits struct {
}

VarInt32ArrayTraits is the implementation of an array traits for a VarInt32.

func (VarInt32ArrayTraits) AsUint64

func (trait VarInt32ArrayTraits) AsUint64(value int32) uint64

func (VarInt32ArrayTraits) BitSizeOf

func (trait VarInt32ArrayTraits) BitSizeOf(element int32, endBitPosition int) int

func (VarInt32ArrayTraits) BitSizeOfIsConstant

func (trait VarInt32ArrayTraits) BitSizeOfIsConstant() bool

func (VarInt32ArrayTraits) FromUint64

func (trait VarInt32ArrayTraits) FromUint64(value uint64) int32

func (VarInt32ArrayTraits) InitializeOffsets

func (trait VarInt32ArrayTraits) InitializeOffsets(bitPosition int, value int32) int

func (VarInt32ArrayTraits) NeedsBitsizeOfPosition

func (trait VarInt32ArrayTraits) NeedsBitsizeOfPosition() bool

func (VarInt32ArrayTraits) NeedsReadIndex

func (trait VarInt32ArrayTraits) NeedsReadIndex() bool

func (VarInt32ArrayTraits) PackedTraits

func (trait VarInt32ArrayTraits) PackedTraits() IPackedArrayTraits[int32]

func (VarInt32ArrayTraits) Read

func (trait VarInt32ArrayTraits) Read(reader zserio.Reader, index int) (int32, error)

func (VarInt32ArrayTraits) Write

func (trait VarInt32ArrayTraits) Write(writer zserio.Writer, value int32) error

type VarInt64ArrayTraits

type VarInt64ArrayTraits struct {
}

VarInt64ArrayTraits is the implementation of an array traits for a VarInt64.

func (VarInt64ArrayTraits) AsUint64

func (trait VarInt64ArrayTraits) AsUint64(value int64) uint64

func (VarInt64ArrayTraits) BitSizeOf

func (trait VarInt64ArrayTraits) BitSizeOf(element int64, endBitPosition int) int

func (VarInt64ArrayTraits) BitSizeOfIsConstant

func (trait VarInt64ArrayTraits) BitSizeOfIsConstant() bool

func (VarInt64ArrayTraits) FromUint64

func (trait VarInt64ArrayTraits) FromUint64(value uint64) int64

func (VarInt64ArrayTraits) InitializeOffsets

func (trait VarInt64ArrayTraits) InitializeOffsets(bitPosition int, value int64) int

func (VarInt64ArrayTraits) NeedsBitsizeOfPosition

func (trait VarInt64ArrayTraits) NeedsBitsizeOfPosition() bool

func (VarInt64ArrayTraits) NeedsReadIndex

func (trait VarInt64ArrayTraits) NeedsReadIndex() bool

func (VarInt64ArrayTraits) PackedTraits

func (trait VarInt64ArrayTraits) PackedTraits() IPackedArrayTraits[int64]

func (VarInt64ArrayTraits) Read

func (trait VarInt64ArrayTraits) Read(reader zserio.Reader, index int) (int64, error)

func (VarInt64ArrayTraits) Write

func (trait VarInt64ArrayTraits) Write(writer zserio.Writer, value int64) error

type VarIntArrayTraits

type VarIntArrayTraits struct {
}

VarIntArrayTraits is an array traits implementation for VarInt.

func (VarIntArrayTraits) AsUint64

func (trait VarIntArrayTraits) AsUint64(value int64) uint64

func (VarIntArrayTraits) BitSizeOf

func (trait VarIntArrayTraits) BitSizeOf(element int64, endBitPosition int) int

func (VarIntArrayTraits) BitSizeOfIsConstant

func (trait VarIntArrayTraits) BitSizeOfIsConstant() bool

func (VarIntArrayTraits) FromUint64

func (trait VarIntArrayTraits) FromUint64(value uint64) int64

func (VarIntArrayTraits) InitializeOffsets

func (trait VarIntArrayTraits) InitializeOffsets(bitPosition int, value int64) int

func (VarIntArrayTraits) NeedsBitsizeOfPosition

func (trait VarIntArrayTraits) NeedsBitsizeOfPosition() bool

func (VarIntArrayTraits) NeedsReadIndex

func (trait VarIntArrayTraits) NeedsReadIndex() bool

func (VarIntArrayTraits) PackedTraits

func (trait VarIntArrayTraits) PackedTraits() IPackedArrayTraits[int64]

func (VarIntArrayTraits) Read

func (trait VarIntArrayTraits) Read(reader zserio.Reader, index int) (int64, error)

func (VarIntArrayTraits) Write

func (trait VarIntArrayTraits) Write(writer zserio.Writer, value int64) error

type VarSizeArrayTraits

type VarSizeArrayTraits struct{}

func (VarSizeArrayTraits) AsUint64

func (trait VarSizeArrayTraits) AsUint64(value uint64) uint64

func (VarSizeArrayTraits) BitSizeOf

func (trait VarSizeArrayTraits) BitSizeOf(element uint64, endBitPosition int) int

func (VarSizeArrayTraits) BitSizeOfIsConstant

func (trait VarSizeArrayTraits) BitSizeOfIsConstant() bool

func (VarSizeArrayTraits) FromUint64

func (trait VarSizeArrayTraits) FromUint64(value uint64) uint64

func (VarSizeArrayTraits) InitializeOffsets

func (trait VarSizeArrayTraits) InitializeOffsets(bitPosition int, value uint64) int

func (VarSizeArrayTraits) NeedsBitsizeOfPosition

func (trait VarSizeArrayTraits) NeedsBitsizeOfPosition() bool

func (VarSizeArrayTraits) NeedsReadIndex

func (trait VarSizeArrayTraits) NeedsReadIndex() bool

func (VarSizeArrayTraits) PackedTraits

func (trait VarSizeArrayTraits) PackedTraits() IPackedArrayTraits[uint64]

func (VarSizeArrayTraits) Read

func (trait VarSizeArrayTraits) Read(reader zserio.Reader, index int) (uint64, error)

func (VarSizeArrayTraits) Write

func (trait VarSizeArrayTraits) Write(writer zserio.Writer, value uint64) error

type VarUInt16ArrayTraits

type VarUInt16ArrayTraits struct {
}

VarUInt16ArrayTraits is the implementation of an array traits for a VarUint16.

func (VarUInt16ArrayTraits) AsUint64

func (trait VarUInt16ArrayTraits) AsUint64(value uint16) uint64

func (VarUInt16ArrayTraits) BitSizeOf

func (trait VarUInt16ArrayTraits) BitSizeOf(element uint16, endBitPosition int) int

func (VarUInt16ArrayTraits) BitSizeOfIsConstant

func (trait VarUInt16ArrayTraits) BitSizeOfIsConstant() bool

func (VarUInt16ArrayTraits) FromUint64

func (trait VarUInt16ArrayTraits) FromUint64(value uint64) uint16

func (VarUInt16ArrayTraits) InitializeOffsets

func (trait VarUInt16ArrayTraits) InitializeOffsets(bitPosition int, value uint16) int

func (VarUInt16ArrayTraits) NeedsBitsizeOfPosition

func (trait VarUInt16ArrayTraits) NeedsBitsizeOfPosition() bool

func (VarUInt16ArrayTraits) NeedsReadIndex

func (trait VarUInt16ArrayTraits) NeedsReadIndex() bool

func (VarUInt16ArrayTraits) PackedTraits

func (trait VarUInt16ArrayTraits) PackedTraits() IPackedArrayTraits[uint16]

func (VarUInt16ArrayTraits) Read

func (trait VarUInt16ArrayTraits) Read(reader zserio.Reader, index int) (uint16, error)

func (VarUInt16ArrayTraits) Write

func (trait VarUInt16ArrayTraits) Write(writer zserio.Writer, value uint16) error

type VarUInt32ArrayTraits

type VarUInt32ArrayTraits struct {
}

func (VarUInt32ArrayTraits) AsUint64

func (trait VarUInt32ArrayTraits) AsUint64(value uint32) uint64

func (VarUInt32ArrayTraits) BitSizeOf

func (trait VarUInt32ArrayTraits) BitSizeOf(element uint32, endBitPosition int) int

func (VarUInt32ArrayTraits) BitSizeOfIsConstant

func (trait VarUInt32ArrayTraits) BitSizeOfIsConstant() bool

func (VarUInt32ArrayTraits) FromUint64

func (trait VarUInt32ArrayTraits) FromUint64(value uint64) uint32

func (VarUInt32ArrayTraits) InitializeOffsets

func (trait VarUInt32ArrayTraits) InitializeOffsets(bitPosition int, value uint32) int

func (VarUInt32ArrayTraits) NeedsBitsizeOfPosition

func (trait VarUInt32ArrayTraits) NeedsBitsizeOfPosition() bool

func (VarUInt32ArrayTraits) NeedsReadIndex

func (trait VarUInt32ArrayTraits) NeedsReadIndex() bool

func (VarUInt32ArrayTraits) PackedTraits

func (trait VarUInt32ArrayTraits) PackedTraits() IPackedArrayTraits[uint32]

func (VarUInt32ArrayTraits) Read

func (trait VarUInt32ArrayTraits) Read(reader zserio.Reader, index int) (uint32, error)

func (VarUInt32ArrayTraits) Write

func (trait VarUInt32ArrayTraits) Write(writer zserio.Writer, value uint32) error

type VarUInt64ArrayTraits

type VarUInt64ArrayTraits struct {
}

func (VarUInt64ArrayTraits) AsUint64

func (trait VarUInt64ArrayTraits) AsUint64(value uint64) uint64

func (VarUInt64ArrayTraits) BitSizeOf

func (trait VarUInt64ArrayTraits) BitSizeOf(element uint64, endBitPosition int) int

func (VarUInt64ArrayTraits) BitSizeOfIsConstant

func (trait VarUInt64ArrayTraits) BitSizeOfIsConstant() bool

func (VarUInt64ArrayTraits) FromUint64

func (trait VarUInt64ArrayTraits) FromUint64(value uint64) uint64

func (VarUInt64ArrayTraits) InitializeOffsets

func (trait VarUInt64ArrayTraits) InitializeOffsets(bitPosition int, value uint64) int

func (VarUInt64ArrayTraits) NeedsBitsizeOfPosition

func (trait VarUInt64ArrayTraits) NeedsBitsizeOfPosition() bool

func (VarUInt64ArrayTraits) NeedsReadIndex

func (trait VarUInt64ArrayTraits) NeedsReadIndex() bool

func (VarUInt64ArrayTraits) PackedTraits

func (trait VarUInt64ArrayTraits) PackedTraits() IPackedArrayTraits[uint64]

func (VarUInt64ArrayTraits) Read

func (trait VarUInt64ArrayTraits) Read(reader zserio.Reader, index int) (uint64, error)

func (VarUInt64ArrayTraits) Write

func (trait VarUInt64ArrayTraits) Write(writer zserio.Writer, value uint64) error

type VarUIntArrayTraits

type VarUIntArrayTraits struct{}

func (VarUIntArrayTraits) AsUint64

func (trait VarUIntArrayTraits) AsUint64(value uint64) uint64

func (VarUIntArrayTraits) BitSizeOf

func (trait VarUIntArrayTraits) BitSizeOf(element uint64, endBitPosition int) int

func (VarUIntArrayTraits) BitSizeOfIsConstant

func (trait VarUIntArrayTraits) BitSizeOfIsConstant() bool

func (VarUIntArrayTraits) FromUint64

func (trait VarUIntArrayTraits) FromUint64(value uint64) uint64

func (VarUIntArrayTraits) InitializeOffsets

func (trait VarUIntArrayTraits) InitializeOffsets(bitPosition int, value uint64) int

func (VarUIntArrayTraits) NeedsBitsizeOfPosition

func (trait VarUIntArrayTraits) NeedsBitsizeOfPosition() bool

func (VarUIntArrayTraits) NeedsReadIndex

func (trait VarUIntArrayTraits) NeedsReadIndex() bool

func (VarUIntArrayTraits) PackedTraits

func (trait VarUIntArrayTraits) PackedTraits() IPackedArrayTraits[uint64]

func (VarUIntArrayTraits) Read

func (trait VarUIntArrayTraits) Read(reader zserio.Reader, index int) (uint64, error)

func (VarUIntArrayTraits) Write

func (trait VarUIntArrayTraits) Write(writer zserio.Writer, value uint64) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL