| IOLink 1.11.0

Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
iolink::VariantDataValueConverter Class Reference

Converter contains a set of method allowing to interpret a VariantDataValue as a determined type. More...

`#include <iolink/VariantDataValueConverter.h>`

## Static Public Member Functions
static int8_t | toInt8 (std::shared_ptr< VariantDataValue > value)
| Return converted metadata value into 8-bit signed integers.
static int16_t | toInt16 (std::shared_ptr< VariantDataValue > value)
| Return converted metadata value into 16-bit signed integers.
static int32_t | toInt32 (std::shared_ptr< VariantDataValue > value)
| Return converted metadata value into 32-bit signed integers.
static int64_t | toInt64 (std::shared_ptr< VariantDataValue > value)
| Return converted metadata value into 64-bit signed integers.
static uint8_t | toUint8 (std::shared_ptr< VariantDataValue > value)
| Return converted metadata value into 8-bit unsigned integers.
static uint16_t | toUint16 (std::shared_ptr< VariantDataValue > value)
| Return converted metadata value into 16-bit unsigned integers.
static uint32_t | toUint32 (std::shared_ptr< VariantDataValue > value)
| Return converted metadata value into 32-bit unsigned integers.
static uint64_t | toUint64 (std::shared_ptr< VariantDataValue > value)
| Return converted metadata value into 32-bit signed integers.
static float | toFloat (std::shared_ptr< VariantDataValue > value)
| Return converted metadata value into 32-bit floating-point.
static double | toDouble (std::shared_ptr< VariantDataValue > value)
| Return converted metadata value into 64-bit floats.
static std::string | toString (std::shared_ptr< VariantDataValue > value)
| Return converted metadata value into string.
static size_t | toInt8Array (std::shared_ptr< VariantDataValue > variant, int8_t *values, size_t count)
| Convert VariantDataValues into 8-bit signed integers.
static size_t | toInt16Array (std::shared_ptr< VariantDataValue > variant, int16_t *values, size_t count)
| Convert VariantDataValues into 16-bit signed integers.
static size_t | toInt32Array (std::shared_ptr< VariantDataValue > variant, int32_t *values, size_t count)
| Convert VariantDataValues into 32-bit signed integers.
static size_t | toInt64Array (std::shared_ptr< VariantDataValue > variant, int64_t *values, size_t count)
| Convert VariantDataValues into 64-bit signed integers.
static size_t | toUint8Array (std::shared_ptr< VariantDataValue > variant, uint8_t *values, size_t count)
| Convert VariantDataValues into 8-bit unsigned integers.
static size_t | toUint16Array (std::shared_ptr< VariantDataValue > variant, uint16_t *values, size_t count)
| Convert VariantDataValues into 16-bit unsigned integers.
static size_t | toUint32Array (std::shared_ptr< VariantDataValue > variant, uint32_t *values, size_t count)
| Convert VariantDataValues into 32-bit unsigned integers.
static size_t | toUint64Array (std::shared_ptr< VariantDataValue > variant, uint64_t *values, size_t count)
| Convert VariantDataValues into 64-bit signed integers.
static size_t | toFloatArray (std::shared_ptr< VariantDataValue > variant, float *values, size_t count)
| Convert VariantDataValues into 32-bit floating-point.
static size_t | toDoubleArray (std::shared_ptr< VariantDataValue > variant, double *values, size_t count)
| Convert VariantDataValues into 64-bit floats.
static size_t | toStringArray (std::shared_ptr< VariantDataValue > variant, std::string *values, size_t count)
| Convert VariantDataValues into string.
static int8_t | toInt8 (std::shared_ptr< VariantDataValue > variant, size_t index)
| Convert VariantDataValue at given index into 8-bit signed integers.
static int16_t | toInt16 (std::shared_ptr< VariantDataValue > variant, size_t index)
| Convert VariantDataValue at given index into 16-bit signed integers.
static int32_t | toInt32 (std::shared_ptr< VariantDataValue > variant, size_t index)
| Convert VariantDataValue at given index into 32-bit signed integers.
static int64_t | toInt64 (std::shared_ptr< VariantDataValue > variant, size_t index)
| Convert VariantDataValue at given index into 64-bit signed integers.
static uint8_t | toUint8 (std::shared_ptr< VariantDataValue > variant, size_t index)
| Convert VariantDataValue at given index into 8-bit unsigned integers.
static uint16_t | toUint16 (std::shared_ptr< VariantDataValue > variant, size_t index)
| Convert VariantDataValue at given index into 16-bit unsigned integers.
static uint32_t | toUint32 (std::shared_ptr< VariantDataValue > variant, size_t index)
| Convert VariantDataValue at given index into 32-bit unsigned integers.
static uint64_t | toUint64 (std::shared_ptr< VariantDataValue > variant, size_t index)
| Convert VariantDataValue at given index into 64-bit unsigned integers.
static float | toFloat (std::shared_ptr< VariantDataValue > variant, size_t index)
| Convert VariantDataValue at given index into 32-bit floating-point.
static double | toDouble (std::shared_ptr< VariantDataValue > variant, size_t index)
| Convert VariantDataValue at given index into 64-bit floats.
static std::string | toString (std::shared_ptr< VariantDataValue > variant, size_t index)
| Convert VariantDataValue at given index into string.

## Detailed Description

Converter contains a set of method allowing to interpret a VariantDataValue as a determined type.

## Member Function Documentation

## ◆ toDouble() [1/2]

static double iolink::VariantDataValueConverter::toDouble | ( | std::shared_ptr< VariantDataValue > | value | ) |
| static

Return converted metadata value into 64-bit floats.

Parameters

  value | VariantDataValue to convert

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toDouble() [2/2]

static double iolink::VariantDataValueConverter::toDouble | ( | std::shared_ptr< VariantDataValue > | variant,
|  | size_t | index
| ) |  |
| static

Convert VariantDataValue at given index into 64-bit floats.

Parameters

  variant | VariantDataValue to convert
  index | Index of the value to convert and return from VariantDataValue

Exceptions

  Error | if VariantDataValue original type cannot be converted
  Error | if given index is out of range

Returns
  the converted value of VariantDataValue at given index

## ◆ toDoubleArray()

static size_t iolink::VariantDataValueConverter::toDoubleArray | ( | std::shared_ptr< VariantDataValue > | variant,
|  | double * | values,
|  | size_t | count
| ) |  |
| static

Convert VariantDataValues into 64-bit floats.

Parameters

  variant | VariantDataValue to convert
  values | Pre-allocated array which will be filled with converted values extracted from VariantDataValue
  count | Size of pre-allocated array (should be at least equal to VariantDataValue count)

Returns
  effective count of values converted into values

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toFloat() [1/2]

static float iolink::VariantDataValueConverter::toFloat | ( | std::shared_ptr< VariantDataValue > | value | ) |
| static

Return converted metadata value into 32-bit floating-point.

Parameters

  value | VariantDataValue to convert

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toFloat() [2/2]

static float iolink::VariantDataValueConverter::toFloat | ( | std::shared_ptr< VariantDataValue > | variant,
|  | size_t | index
| ) |  |
| static

Convert VariantDataValue at given index into 32-bit floating-point.

Parameters

  variant | VariantDataValue to convert
  index | Index of the value to convert and return from VariantDataValue

Exceptions

  Error | if VariantDataValue original type cannot be converted
  Error | if given index is out of range

Returns
  the converted value of VariantDataValue at given index

## ◆ toFloatArray()

static size_t iolink::VariantDataValueConverter::toFloatArray | ( | std::shared_ptr< VariantDataValue > | variant,
|  | float * | values,
|  | size_t | count
| ) |  |
| static

Convert VariantDataValues into 32-bit floating-point.

Parameters

  variant | VariantDataValue to convert
  values | Pre-allocated array which will be filled with converted values extracted from VariantDataValue
  count | Size of pre-allocated array (should be at least equal to VariantDataValue count)

Returns
  effective count of values converted into values

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toInt16() [1/2]

static int16_t iolink::VariantDataValueConverter::toInt16 | ( | std::shared_ptr< VariantDataValue > | value | ) |
| static

Return converted metadata value into 16-bit signed integers.

Parameters

  value | VariantDataValue to convert

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toInt16() [2/2]

static int16_t iolink::VariantDataValueConverter::toInt16 | ( | std::shared_ptr< VariantDataValue > | variant,
|  | size_t | index
| ) |  |
| static

Convert VariantDataValue at given index into 16-bit signed integers.

Parameters

  variant | VariantDataValue to convert
  index | Index of the value to convert and return from VariantDataValue

Exceptions

  Error | if VariantDataValue original type cannot be converted
  Error | if given index is out of range

Returns
  the converted value of VariantDataValue at given index

## ◆ toInt16Array()

static size_t iolink::VariantDataValueConverter::toInt16Array | ( | std::shared_ptr< VariantDataValue > | variant,
|  | int16_t * | values,
|  | size_t | count
| ) |  |
| static

Convert VariantDataValues into 16-bit signed integers.

Parameters

  variant | VariantDataValue to convert
  values | Pre-allocated array which will be filled with converted values extracted from VariantDataValue
  count | Size of pre-allocated array (should be at least equal to VariantDataValue count)

Returns
  effective count of values converted into values

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toInt32() [1/2]

static int32_t iolink::VariantDataValueConverter::toInt32 | ( | std::shared_ptr< VariantDataValue > | value | ) |
| static

Return converted metadata value into 32-bit signed integers.

Parameters

  value | VariantDataValue to convert

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toInt32() [2/2]

static int32_t iolink::VariantDataValueConverter::toInt32 | ( | std::shared_ptr< VariantDataValue > | variant,
|  | size_t | index
| ) |  |
| static

Convert VariantDataValue at given index into 32-bit signed integers.

Parameters

  variant | VariantDataValue to convert
  index | Index of the value to convert and return from VariantDataValue

Exceptions

  Error | if VariantDataValue original type cannot be converted
  Error | if given index is out of range

Returns
  the converted value of VariantDataValue at given index

## ◆ toInt32Array()

static size_t iolink::VariantDataValueConverter::toInt32Array | ( | std::shared_ptr< VariantDataValue > | variant,
|  | int32_t * | values,
|  | size_t | count
| ) |  |
| static

Convert VariantDataValues into 32-bit signed integers.

Parameters

  variant | VariantDataValue to convert
  values | Pre-allocated array which will be filled with converted values extracted from VariantDataValue
  count | Size of pre-allocated array (should be at least equal to VariantDataValue count)

Returns
  effective count of values converted into values

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toInt64() [1/2]

static int64_t iolink::VariantDataValueConverter::toInt64 | ( | std::shared_ptr< VariantDataValue > | value | ) |
| static

Return converted metadata value into 64-bit signed integers.

Parameters

  value | VariantDataValue to convert

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toInt64() [2/2]

static int64_t iolink::VariantDataValueConverter::toInt64 | ( | std::shared_ptr< VariantDataValue > | variant,
|  | size_t | index
| ) |  |
| static

Convert VariantDataValue at given index into 64-bit signed integers.

Parameters

  variant | VariantDataValue to convert
  index | Index of the value to convert and return from VariantDataValue

Exceptions

  Error | if VariantDataValue original type cannot be converted
  Error | if given index is out of range

Returns
  the converted value of VariantDataValue at given index

## ◆ toInt64Array()

static size_t iolink::VariantDataValueConverter::toInt64Array | ( | std::shared_ptr< VariantDataValue > | variant,
|  | int64_t * | values,
|  | size_t | count
| ) |  |
| static

Convert VariantDataValues into 64-bit signed integers.

Parameters

  variant | VariantDataValue to convert
  values | Pre-allocated array which will be filled with converted values extracted from VariantDataValue
  count | Size of pre-allocated array (should be at least equal to VariantDataValue count)

Returns
  effective count of values converted into values

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toInt8() [1/2]

static int8_t iolink::VariantDataValueConverter::toInt8 | ( | std::shared_ptr< VariantDataValue > | value | ) |
| static

Return converted metadata value into 8-bit signed integers.

Parameters

  value | VariantDataValue to convert

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toInt8() [2/2]

static int8_t iolink::VariantDataValueConverter::toInt8 | ( | std::shared_ptr< VariantDataValue > | variant,
|  | size_t | index
| ) |  |
| static

Convert VariantDataValue at given index into 8-bit signed integers.

Parameters

  variant | VariantDataValue to convert
  index | Index of the value to convert and return from VariantDataValue

Exceptions

  Error | if VariantDataValue original type cannot be converted
  Error | if given index is out of range

Returns
  the converted value of VariantDataValue at given index

## ◆ toInt8Array()

static size_t iolink::VariantDataValueConverter::toInt8Array | ( | std::shared_ptr< VariantDataValue > | variant,
|  | int8_t * | values,
|  | size_t | count
| ) |  |
| static

Convert VariantDataValues into 8-bit signed integers.

Parameters

  variant | VariantDataValue to convert
  values | Pre-allocated array which will be filled with converted values extracted from VariantDataValue
  count | Size of pre-allocated array (should be at least equal to VariantDataValue count)

Returns
  effective count of values converted into values

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toString() [1/2]

static std::string iolink::VariantDataValueConverter::toString | ( | std::shared_ptr< VariantDataValue > | value | ) |
| static

Return converted metadata value into string.

Parameters

  value | VariantDataValue to convert

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toString() [2/2]

static std::string iolink::VariantDataValueConverter::toString | ( | std::shared_ptr< VariantDataValue > | variant,
|  | size_t | index
| ) |  |
| static

Convert VariantDataValue at given index into string.

Parameters

  variant | VariantDataValue to convert
  index | Index of the value to convert and return from VariantDataValue

Exceptions

  Error | if VariantDataValue original type cannot be converted
  Error | if given index is out of range

Returns
  the converted value of VariantDataValue at given index

## ◆ toStringArray()

static size_t iolink::VariantDataValueConverter::toStringArray | ( | std::shared_ptr< VariantDataValue > | variant,
|  | std::string * | values,
|  | size_t | count
| ) |  |
| static

Convert VariantDataValues into string.

Parameters

  variant | VariantDataValue to convert
  values | Pre-allocated array which will be filled with converted values extracted from VariantDataValue
  count | Size of pre-allocated array (should be at least equal to VariantDataValue count)

Returns
  effective count of values converted into values

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toUint16() [1/2]

static uint16_t iolink::VariantDataValueConverter::toUint16 | ( | std::shared_ptr< VariantDataValue > | value | ) |
| static

Return converted metadata value into 16-bit unsigned integers.

Parameters

  value | VariantDataValue to convert

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toUint16() [2/2]

static uint16_t iolink::VariantDataValueConverter::toUint16 | ( | std::shared_ptr< VariantDataValue > | variant,
|  | size_t | index
| ) |  |
| static

Convert VariantDataValue at given index into 16-bit unsigned integers.

Parameters

  variant | VariantDataValue to convert
  index | Index of the value to convert and return from VariantDataValue

Exceptions

  Error | if VariantDataValue original type cannot be converted
  Error | if given index is out of range

Returns
  the converted value of VariantDataValue at given index

## ◆ toUint16Array()

static size_t iolink::VariantDataValueConverter::toUint16Array | ( | std::shared_ptr< VariantDataValue > | variant,
|  | uint16_t * | values,
|  | size_t | count
| ) |  |
| static

Convert VariantDataValues into 16-bit unsigned integers.

Parameters

  variant | VariantDataValue to convert
  values | Pre-allocated array which will be filled with converted values extracted from VariantDataValue
  count | Size of pre-allocated array (should be at least equal to VariantDataValue count)

Returns
  effective count of values converted into values

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toUint32() [1/2]

static uint32_t iolink::VariantDataValueConverter::toUint32 | ( | std::shared_ptr< VariantDataValue > | value | ) |
| static

Return converted metadata value into 32-bit unsigned integers.

Parameters

  value | VariantDataValue to convert

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toUint32() [2/2]

static uint32_t iolink::VariantDataValueConverter::toUint32 | ( | std::shared_ptr< VariantDataValue > | variant,
|  | size_t | index
| ) |  |
| static

Convert VariantDataValue at given index into 32-bit unsigned integers.

Parameters

  variant | VariantDataValue to convert
  index | Index of the value to convert and return from VariantDataValue

Exceptions

  Error | if VariantDataValue original type cannot be converted
  Error | if given index is out of range

Returns
  the converted value of VariantDataValue at given index

## ◆ toUint32Array()

static size_t iolink::VariantDataValueConverter::toUint32Array | ( | std::shared_ptr< VariantDataValue > | variant,
|  | uint32_t * | values,
|  | size_t | count
| ) |  |
| static

Convert VariantDataValues into 32-bit unsigned integers.

Parameters

  variant | VariantDataValue to convert
  values | Pre-allocated array which will be filled with converted values extracted from VariantDataValue
  count | Size of pre-allocated array (should be at least equal to VariantDataValue count)

Returns
  effective count of values converted into values

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toUint64() [1/2]

static uint64_t iolink::VariantDataValueConverter::toUint64 | ( | std::shared_ptr< VariantDataValue > | value | ) |
| static

Return converted metadata value into 32-bit signed integers.

Parameters

  value | VariantDataValue to convert

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toUint64() [2/2]

static uint64_t iolink::VariantDataValueConverter::toUint64 | ( | std::shared_ptr< VariantDataValue > | variant,
|  | size_t | index
| ) |  |
| static

Convert VariantDataValue at given index into 64-bit unsigned integers.

Parameters

  variant | VariantDataValue to convert
  index | Index of the value to convert and return from VariantDataValue

Exceptions

  Error | if VariantDataValue original type cannot be converted
  Error | if given index is out of range

Returns
  the converted value of VariantDataValue at given index

## ◆ toUint64Array()

static size_t iolink::VariantDataValueConverter::toUint64Array | ( | std::shared_ptr< VariantDataValue > | variant,
|  | uint64_t * | values,
|  | size_t | count
| ) |  |
| static

Convert VariantDataValues into 64-bit signed integers.

Parameters

  variant | VariantDataValue to convert
  values | Pre-allocated array which will be filled with converted values extracted from VariantDataValue
  count | Size of pre-allocated array (should be at least equal to VariantDataValue count)

Returns
  effective count of values converted into values

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toUint8() [1/2]

static uint8_t iolink::VariantDataValueConverter::toUint8 | ( | std::shared_ptr< VariantDataValue > | value | ) |
| static

Return converted metadata value into 8-bit unsigned integers.

Parameters

  value | VariantDataValue to convert

Exceptions

  Error | if VariantDataValue original type cannot be converted

## ◆ toUint8() [2/2]

static uint8_t iolink::VariantDataValueConverter::toUint8 | ( | std::shared_ptr< VariantDataValue > | variant,
|  | size_t | index
| ) |  |
| static

Convert VariantDataValue at given index into 8-bit unsigned integers.

Parameters

  variant | VariantDataValue to convert
  index | Index of the value to convert and return from VariantDataValue

Exceptions

  Error | if VariantDataValue original type cannot be converted
  Error | if given index is out of range

Returns
  the converted value of VariantDataValue at given index

## ◆ toUint8Array()

static size_t iolink::VariantDataValueConverter::toUint8Array | ( | std::shared_ptr< VariantDataValue > | variant,
|  | uint8_t * | values,
|  | size_t | count
| ) |  |
| static

Convert VariantDataValues into 8-bit unsigned integers.

Parameters

  variant | VariantDataValue to convert
  values | Pre-allocated array which will be filled with converted values extracted from VariantDataValue
  count | Size of pre-allocated array (should be at least equal to VariantDataValue count)

Returns
  effective count of values converted into values

Exceptions

  Error | if VariantDataValue original type cannot be converted

The documentation for this class was generated from the following file:

- iolink/public/include/iolink/VariantDataValueConverter.h