Base Datatypes

OcaBaseDataType

enum OcaBaseDataType : uint8_t

Enum that describes all available base datatypes.

enumerator None = 0

Undefined

enumerator OcaBoolean = 1

Generic boolean

enumerator OcaInt8 = 2

Generic UINT8

enumerator OcaInt16 = 3

Generic UINT16

enumerator OcaInt32 = 4

Generic UINT32

enumerator OcaInt64 = 5

Generic UINT64

enumerator OcaUint8 = 6

Generic UINT8

enumerator OcaUint16 = 7

Generic UINT16

enumerator OcaUint32 = 8

Generic UINT32

enumerator OcaUint64 = 9

Generic UINT64

enumerator OcaFloat32 = 10

Generic 32 bit float

enumerator OcaFloat64 = 11

Generic 64 bit float

enumerator OcaString = 12

Character count + character array (UTF8)

enumerator OcaBitstring = 13

Bit count + bit array

enumerator OcaBlob = 14

Byte count + byte array

enumerator OcaBlobFixedLen = 15

Byte array

enumerator OcaBit = 16

One bit

OcaBit

using OcaBit = bit

A single bit.

OcaBoolean

type OcaBoolean

True or false

OcaInt8

type OcaInt8

Generic 8 bit integer parameter

OcaInt16

type OcaInt16

Generic integer parameter

OcaInt32

type OcaInt32

Generic long integer parameter

OcaInt64

type OcaInt64

Generic long integer parameter

OcaUint8

type OcaUint8

General-purpose short index

OcaUint16

type OcaUint16

General-purpose short index

OcaUint32

type OcaUint32

OcaUint64

type OcaUint64

Generic unsigned 64-bit integer parameter

OcaFloat32

type OcaFloat32

Generic 64-bit IEEE floating-point parameter

OcaFloat64

type OcaFloat64

Generic 64-bit IEEE floating-point parameter

OcaString

struct OcaString

General character string, UTF-8 encoded.

OcaUint16 Len

Number of UTF-8 characters in the string.

string Value

Unicode string. Encoding is UTF-8.

OCP.1 Encoding

Field

Basic type

Byte length

Len

OcaUint16

2

Value

string

variable

OcaBitstring

struct OcaBitstring

Representation of a bitmask that is used on the network to send bitmask data.

OcaUint16 NrBits

The size of the bitmask in bits.

OcaUint8[] Bitstring

The bitstring data as an array of bytes with the most significant bit of the first byte being bit number 0.

OCP.1 Encoding

Field

Basic type

Byte length

NrBits

OcaUint16

2

Bitstring

OcaUint8

1 * Count

OcaBlob

struct OcaBlob

Representation of a binary large object that is used on the network to send large chunks of binary data.

OcaUint16 DataSize

The size of the BLOB data in bytes.

OcaUint8[] Data

The BLOB data.

OCP.1 Encoding

Field

Basic type

Byte length

DataSize

OcaUint16

2

Data

OcaUint8

1 * Count

OcaBlobFixedLen

template<>
struct OcaBlobFixedLen<typename Len>

Template class for fixed-length blob.

OcaUint8[Len] Value

The value is an array of bytes with the most significant bit of the first byte being bit number 0. Size of the array is determined by the template parameter <`Len:raw:html:`>.

OCP.1 Encoding

Basic type

Byte length

OcaBlobFixedLen

(0 + 1 * variable)

OcaList

template<>
struct OcaList<typename datatype>

Template class representing a list of items.

OcaUint16 Count

Number of entries in the list.

datatype[Count] Items

The array of items of the list, i.e. each entry placed after each other.

OCP.1 Encoding

Basic type

Byte length

OcaList

(2 + Count * variable)

OcaList2D

template<>
struct OcaList2D<typename datatype>

Template class representing a two-dimensional list of items. This class describes only the data, not how it will be marshalled for transport via the various OCA protocol implementations.

OcaUint16 nX

Number of columns in the list.

OcaUint16 nY

Number of rows in the list.

datatype[nX, nY] Items

The array of items of the list, i.e. each entry placed after each other.

OCP.1 Encoding

Field

Basic type

Byte length

nX

OcaUint16

2

nY

OcaUint16

2

Items

datatype

variable * nX * nY

OcaMapItem

template<>
struct OcaMapItem<typename KeyDataType, typename ValueDataType>

One element of an OcaMap or OcaMultiMap

KeyDataType Key
ValueDataType Value

OCP.1 Encoding

Field

Basic type

Byte length

Key

KeyDataType

variable

Value

ValueDataType

variable

OcaMap

template<>
struct OcaMap<typename KeyDataType, typename ValueDataType>

Template class representing a map of keys to values.

OcaUint16 Count

Number of entries (key value pairs) in the map.

OcaMapItem<KeyDataType, ValueDataType>[Count] Items

The array of items of the map, i.e. each key value pair (value after key) placed after each other.

OCP.1 Encoding

Basic type

Byte length

OcaMap

(2 + Count * variable)

OcaMultiMap

template<>
struct OcaMultiMap<typename KeyDataType, typename ValueDataType>

Template _class_ representing a map of keys to values where keys do not have to be unique (e.g. can be present multiple times).

OcaUint16 Count

Number of entries (key value pairs) in the multimap.

OcaMapItem<KeyDataType, ValueDataType>[Count] Items

The array of items of the map, i.e. each key value pair (value after key) placed after each other. Note that the keys do not have to be unique, i.e. the same key may be present multiple times in the map.

OCP.1 Encoding

Basic type

Byte length

OcaMultiMap

(2 + Count * variable)