IOLink  IOL_v1.2.0_release
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 signed integer 8 bits. More...
 
static int16_t toInt16 (std::shared_ptr< VariantDataValue > value)
 Return converted metadata value into signed integer 16 bits. More...
 
static int32_t toInt32 (std::shared_ptr< VariantDataValue > value)
 Return converted metadata value into signed integer 32 bits. More...
 
static int64_t toInt64 (std::shared_ptr< VariantDataValue > value)
 Return converted metadata value into signed integer 64 bits. More...
 
static uint8_t toUint8 (std::shared_ptr< VariantDataValue > value)
 Return converted metadata value into unsigned integer 8 bits. More...
 
static uint16_t toUint16 (std::shared_ptr< VariantDataValue > value)
 Return converted metadata value into unsigned integer 16 bits. More...
 
static uint32_t toUint32 (std::shared_ptr< VariantDataValue > value)
 Return converted metadata value into unsigned integer 32 bits. More...
 
static uint64_t toUint64 (std::shared_ptr< VariantDataValue > value)
 Return converted metadata value into signed integer 32 bits. More...
 
static float toFloat (std::shared_ptr< VariantDataValue > value)
 Return converted metadata value into float. More...
 
static double toDouble (std::shared_ptr< VariantDataValue > value)
 Return converted metadata value into double. More...
 
static std::string toString (std::shared_ptr< VariantDataValue > value)
 Return converted metadata value into string. More...
 

Detailed Description

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

Member Function Documentation

◆ toDouble()

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

Return converted metadata value into double.

Parameters
valueVariantDataValue to convert
Exceptions
Errorif VariantDataValue original type cannot be converted

◆ toFloat()

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

Return converted metadata value into float.

Parameters
valueVariantDataValue to convert
Exceptions
Errorif VariantDataValue original type cannot be converted

◆ toInt16()

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

Return converted metadata value into signed integer 16 bits.

Parameters
valueVariantDataValue to convert
Exceptions
Errorif VariantDataValue original type cannot be converted

◆ toInt32()

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

Return converted metadata value into signed integer 32 bits.

Parameters
valueVariantDataValue to convert
Exceptions
Errorif VariantDataValue original type cannot be converted

◆ toInt64()

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

Return converted metadata value into signed integer 64 bits.

Parameters
valueVariantDataValue to convert
Exceptions
Errorif VariantDataValue original type cannot be converted

◆ toInt8()

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

Return converted metadata value into signed integer 8 bits.

Parameters
valueVariantDataValue to convert
Exceptions
Errorif VariantDataValue original type cannot be converted

◆ toString()

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

Return converted metadata value into string.

Parameters
valueVariantDataValue to convert
Exceptions
Errorif VariantDataValue original type cannot be converted

◆ toUint16()

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

Return converted metadata value into unsigned integer 16 bits.

Parameters
valueVariantDataValue to convert
Exceptions
Errorif VariantDataValue original type cannot be converted

◆ toUint32()

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

Return converted metadata value into unsigned integer 32 bits.

Parameters
valueVariantDataValue to convert
Exceptions
Errorif VariantDataValue original type cannot be converted

◆ toUint64()

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

Return converted metadata value into signed integer 32 bits.

Parameters
valueVariantDataValue to convert
Exceptions
Errorif VariantDataValue original type cannot be converted

◆ toUint8()

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

Return converted metadata value into unsigned integer 8 bits.

Parameters
valueVariantDataValue to convert
Exceptions
Errorif VariantDataValue original type cannot be converted

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