IOLink  IOL_v1.6.1_release
VariantDataValueConverter.h
1 #pragma once
2 
3 #include <iolink/IOLinkAPI.h>
4 #include <iolink/VariantDataValue.h>
5 
6 namespace iolink
7 {
11 class IOLINK_API VariantDataValueConverter
12 {
13 public:
18  static int8_t toInt8(std::shared_ptr<VariantDataValue> value);
19 
24  static int16_t toInt16(std::shared_ptr<VariantDataValue> value);
25 
30  static int32_t toInt32(std::shared_ptr<VariantDataValue> value);
31 
36  static int64_t toInt64(std::shared_ptr<VariantDataValue> value);
37 
42  static uint8_t toUint8(std::shared_ptr<VariantDataValue> value);
43 
48  static uint16_t toUint16(std::shared_ptr<VariantDataValue> value);
49 
54  static uint32_t toUint32(std::shared_ptr<VariantDataValue> value);
55 
60  static uint64_t toUint64(std::shared_ptr<VariantDataValue> value);
61 
66  static float toFloat(std::shared_ptr<VariantDataValue> value);
67 
72  static double toDouble(std::shared_ptr<VariantDataValue> value);
73 
78  static std::string toString(std::shared_ptr<VariantDataValue> value);
79 };
80 
81 } // end namespace iolink