#include <ReflectableUtil.h>
|
template<typename ALLOC = std::allocator<uint8_t>> |
static bool | equal (const IBasicReflectableConstPtr< ALLOC > &lhs, const IBasicReflectableConstPtr< ALLOC > &rhs) |
|
template<typename T , typename ALLOC = std::allocator<uint8_t>, typename std::enable_if< detail::gets_value_by_value< T >::value, int >::type = 0> |
static T | getValue (const IBasicReflectableConstPtr< ALLOC > &reflectable, const ALLOC &allocator=ALLOC()) |
|
template<typename T , typename ALLOC = std::allocator<uint8_t>, typename std::enable_if<!detail::gets_value_by_value< T >::value, int >::type = 0> |
static const T & | getValue (const IBasicReflectableConstPtr< ALLOC > &reflectable, const ALLOC &allocator=ALLOC()) |
|
template<typename T , typename ALLOC = std::allocator<uint8_t>, typename std::enable_if<!detail::gets_value_by_value< T >::value &&!std::is_same< BasicBitBuffer< ALLOC >, T >::value, int >::type = 0> |
static T & | getValue (const IBasicReflectablePtr< ALLOC > &reflectable, const ALLOC &allocator=ALLOC()) |
|
template<typename T , typename ALLOC = std::allocator<uint8_t>, typename std::enable_if< std::is_same< BasicBitBuffer< ALLOC >, T >::value, int >::type = 0> |
static const T & | getValue (const IBasicReflectablePtr< ALLOC > &reflectable, const ALLOC &allocator=ALLOC()) |
|
Utilities on zserio reflectable interface.
Definition at line 34 of file ReflectableUtil.h.
◆ equal()
template<typename ALLOC >
Makes "deep" comparison of given reflectables.
- Note
- Floating point values are compared using "almost equal" strategy.
- Parameters
-
lhs | Left-hand side reflectable. |
rhs | Right-hand side reflectable. |
- Returns
- True when the reflectables are equal, false otherwise.
Definition at line 146 of file ReflectableUtil.h.
◆ getValue() [1/4]
template<typename T , typename ALLOC = std::allocator<uint8_t>, typename std::enable_if< detail::gets_value_by_value< T >::value, int >::type = 0>
static T zserio::ReflectableUtil::getValue |
( |
const IBasicReflectableConstPtr< ALLOC > & |
reflectable, |
|
|
const ALLOC & |
allocator = ALLOC() |
|
) |
| |
|
inlinestatic |
Gets native value from the given reflectable.
Overload for types where the value is returned by value:
- arithmetic types, enums, bitmasks and strings (via string view).
- Parameters
-
reflectable | Reflectable to use for value extraction. |
- Returns
- Value of the type T.
Definition at line 63 of file ReflectableUtil.h.
◆ getValue() [2/4]
template<typename T , typename ALLOC = std::allocator<uint8_t>, typename std::enable_if<!detail::gets_value_by_value< T >::value, int >::type = 0>
static const T& zserio::ReflectableUtil::getValue |
( |
const IBasicReflectableConstPtr< ALLOC > & |
reflectable, |
|
|
const ALLOC & |
allocator = ALLOC() |
|
) |
| |
|
inlinestatic |
Gets constant reference to the native value from the given constant reflectable.
Overload for types where the value is returned by const reference:
- compound, bit buffers and arrays.
- Parameters
-
reflectable | Constant reflectable to use for value extraction. |
- Returns
- Constant reference to the value of the type T.
- Exceptions
-
Definition at line 83 of file ReflectableUtil.h.
◆ getValue() [3/4]
template<typename T , typename ALLOC = std::allocator<uint8_t>, typename std::enable_if<!detail::gets_value_by_value< T >::value &&!std::is_same< BasicBitBuffer< ALLOC >, T >::value, int >::type = 0>
static T& zserio::ReflectableUtil::getValue |
( |
const IBasicReflectablePtr< ALLOC > & |
reflectable, |
|
|
const ALLOC & |
allocator = ALLOC() |
|
) |
| |
|
inlinestatic |
Gets reference to the native value from the given reflectable.
Overload for types where the value is returned by reference:
- Parameters
-
reflectable | Reflectable to use for value extraction. |
- Returns
- Reference to the value of the type T.
- Exceptions
-
Definition at line 106 of file ReflectableUtil.h.
◆ getValue() [4/4]
template<typename T , typename ALLOC = std::allocator<uint8_t>, typename std::enable_if< std::is_same< BasicBitBuffer< ALLOC >, T >::value, int >::type = 0>
static const T& zserio::ReflectableUtil::getValue |
( |
const IBasicReflectablePtr< ALLOC > & |
reflectable, |
|
|
const ALLOC & |
allocator = ALLOC() |
|
) |
| |
|
inlinestatic |
Gets constant reference to the native value from the given reflectable.
Overload for bit buffers which are currently returned only by constant reference.
- Parameters
-
reflectable | Reflectable to use for value extraction. |
- Returns
- Constant reference to the bit buffer value.
- Exceptions
-
Definition at line 124 of file ReflectableUtil.h.
The documentation for this class was generated from the following file: