Telemetry record class, allows to store different data using a common interface.
More...
#include <Telemetry.h>
|
| | Telemetry () |
| | Creates an empty Telemetry record containg neither a key nor value. More...
|
| |
| template<typename T , typename std::enable_if< std::is_integral< T >::value >::type * = nullptr> |
| | Telemetry (char const *key, T const &value) |
| | Constructs a telemetry record from integral value. More...
|
| |
| template<typename T , typename std::enable_if< std::is_floating_point< T >::value >::type * = nullptr> |
| | Telemetry (char const *key, T const &value) |
| | Constructs a telemetry record from floating point value. More...
|
| |
| | Telemetry (char const *key, bool value) |
| | Constructs a telemetry record from boolean value. More...
|
| |
| | Telemetry (char const *key, char const *value) |
| | Constructs a telemetry record from string value. More...
|
| |
| bool | IsEmpty () const |
| | Whether this record is empty or not. More...
|
| |
| template<typename TSource > |
| bool | SerializeKeyValue (TSource &source) const |
| | Serializes a key-value pair or only a value, depending on the constructor used. More...
|
| |
Telemetry record class, allows to store different data using a common interface.
- Note
- Is used to allow to easily create a key-value pair of multiple different types that can then be deserialized into a json message
◆ Telemetry() [1/5]
Creates an empty Telemetry record containg neither a key nor value.
◆ Telemetry() [2/5]
template<typename T , typename std::enable_if< std::is_integral< T >::value >::type * = nullptr>
| Telemetry::Telemetry |
( |
char const * |
key, |
|
|
T const & |
value |
|
) |
| |
|
inline |
Constructs a telemetry record from integral value.
- Template Parameters
-
| T | Type of the passed value, is required to be integral, to ensure this constructor isn't used instead of the float one by mistake |
- Parameters
-
| key | Key of the key-value pair we want to create |
| value | Value of the key-value pair we want to create |
◆ Telemetry() [3/5]
template<typename T , typename std::enable_if< std::is_floating_point< T >::value >::type * = nullptr>
| Telemetry::Telemetry |
( |
char const * |
key, |
|
|
T const & |
value |
|
) |
| |
|
inline |
Constructs a telemetry record from floating point value.
- Template Parameters
-
| T | Type of the passed value, is required to be a floating point, to ensure this constructor isn't used instead of the boolean one by mistake |
- Parameters
-
| key | Key of the key-value pair we want to create |
| value | Value of the key-value pair we want to create |
◆ Telemetry() [4/5]
| Telemetry::Telemetry |
( |
char const * |
key, |
|
|
bool |
value |
|
) |
| |
Constructs a telemetry record from boolean value.
- Parameters
-
| key | Key of the key-value pair we want to create |
| value | Value of the key-value pair we want to create |
◆ Telemetry() [5/5]
| Telemetry::Telemetry |
( |
char const * |
key, |
|
|
char const * |
value |
|
) |
| |
Constructs a telemetry record from string value.
- Parameters
-
| key | Key of the key-value pair we want to create |
| value | Value of the key-value pair we want to create |
◆ IsEmpty()
| bool Telemetry::IsEmpty |
( |
| ) |
const |
Whether this record is empty or not.
- Returns
- Whether there is any data in this record or not
◆ SerializeKeyValue()
template<typename TSource >
| bool Telemetry::SerializeKeyValue |
( |
TSource & |
source | ) |
const |
|
inline |
Serializes a key-value pair or only a value, depending on the constructor used.
- Template Parameters
-
| TSource | Source class that the given key-value pair or only a value, should be copied into |
- Parameters
-
| source | Data source that should contain the key-value pair or a value |
- Returns
- Whether serializing was successful or not
The documentation for this class was generated from the following files: