Struct PackedElementField

Struct Documentation

struct PackedElementField

A field present within each element in a byte array of packed elements.

Public Types

enum class NumericType : uint8_t

Numeric type.

Values:

enumerator UNKNOWN

Unknown numeric type.

enumerator UINT8

Unsigned 8-bit integer.

enumerator INT8

Signed 8-bit integer.

enumerator UINT16

Unsigned 16-bit integer.

enumerator INT16

Signed 16-bit integer.

enumerator UINT32

Unsigned 32-bit integer.

enumerator INT32

Signed 32-bit integer.

enumerator FLOAT32

32-bit floating-point number

enumerator FLOAT64

64-bit floating-point number

Public Functions

FoxgloveError encode(uint8_t *ptr, size_t len, size_t *encoded_len)

Encoded the PackedElementField as protobuf to the provided buffer.

On success, writes the serialized length to *encoded_len. If the provided buffer has insufficient capacity, writes the required capacity to *encoded_len and returns FoxgloveError::BufferTooShort. If the message cannot be encoded, writes the reason to stderr and returns FoxgloveError::EncodeError.

Parameters:
  • ptr – the destination buffer. must point to at least len valid bytes.

  • len – the length of the destination buffer.

  • encoded_len – where the serialized length or required capacity will be written to.

Public Members

std::string name

Name of the field.

uint32_t offset = 0

Byte offset from start of data buffer.

NumericType type

Type of data in the field. Integers are stored using little-endian byte order.

Public Static Functions

static Schema schema()

Get the PackedElementField schema.

The schema data returned is statically allocated.