Table of Contents

Class FieldValue

Namespace
Typhon.Protocol
Assembly
Typhon.Protocol.dll

A value to encode. Numbers carry the components of a numeric field, or the flattened elements of a list; Integers the components of a 64-bit integer field; Text and Bytes carry the rest.

public sealed class FieldValue
Inheritance
FieldValue
Inherited Members

Constructors

FieldValue()

public FieldValue()

Properties

Bytes

Bytes, for a bytes or blob field.

public byte[] Bytes { get; init; }

Property Value

byte[]

Elements

A collection's elements (W34), each the values of its element fields in wire order (Ordinal); they are the ones sent.

public FieldValue[][] Elements { get; init; }

Property Value

FieldValue[][]

Integers

A 64-bit integer field's components as bit patterns (W32): a signed value's two's complement. A 64-bit field given Numbers instead encodes them when each is an integer in the codec's range — exactly representable, so nothing is rounded.

public ulong[] Integers { get; init; }

Property Value

ulong[]

Numbers

Numeric components, or a list's flattened element components.

public double[] Numbers { get; init; }

Property Value

double[]

Text

Text, for a str field.

public string Text { get; init; }

Property Value

string

Total

A collection's total: how many elements the entity holds, at least Elements' count; 0 means exactly those.

public int Total { get; init; }

Property Value

int

Methods

Of(byte[])

Raw bytes.

public static FieldValue Of(byte[] bytes)

Parameters

bytes byte[]

The bytes.

Returns

FieldValue

The field value.

Of(double)

A scalar.

public static FieldValue Of(double value)

Parameters

value double

The value.

Returns

FieldValue

The field value.

Of(params double[])

A vector or quaternion.

public static FieldValue Of(params double[] components)

Parameters

components double[]

The components.

Returns

FieldValue

The field value.

Of(string)

A string.

public static FieldValue Of(string text)

Parameters

text string

The text.

Returns

FieldValue

The field value.

OfElements(params FieldValue[][])

A collection of elements, every one of them sent.

public static FieldValue OfElements(params FieldValue[][] elements)

Parameters

elements FieldValue[][]

Each element's field values, in wire order.

Returns

FieldValue

The field value.

OfInt64(params long[])

Signed 64-bit components, for an i64 or vari64 field.

public static FieldValue OfInt64(params long[] components)

Parameters

components long[]

The components.

Returns

FieldValue

The field value.

OfUInt64(params ulong[])

Unsigned 64-bit components, for a u64 or varu64 field.

public static FieldValue OfUInt64(params ulong[] components)

Parameters

components ulong[]

The components.

Returns

FieldValue

The field value.