29 [[nodiscard]]
static std::string
type() {
return "DynamicData"; }
52 std::vector<std::string> descriptors;
53 descriptors.reserve(
data.size());
55 for (
const auto& d :
data)
57 descriptors.push_back(d.description);
65 [[nodiscard]] std::optional<double>
getDynamicDataAt(
const std::string& descriptor)
const override
67 for (
const auto& d :
data)
69 if (descriptor == d.description) {
return d.value; }
75 [[nodiscard]] std::vector<std::pair<std::string, double>>
getDynamicData()
const override
77 std::vector<std::pair<std::string, double>> dynData;
78 dynData.reserve(
data.size());
80 for (
const auto& d :
data)
82 dynData.emplace_back(d.description, d.value);
Dynamic Data container.
Definition DynamicData.hpp:25
std::optional< double > getDynamicDataAt(const std::string &descriptor) const override
Get the value for the descriptor.
Definition DynamicData.hpp:65
std::vector< std::pair< std::string, double > > getDynamicData() const override
Returns a vector of data descriptors and values for the dynamic data.
Definition DynamicData.hpp:75
static std::string type()
Returns the type of the data class.
Definition DynamicData.hpp:29
std::vector< std::string > dynamicDataDescriptors() const override
Returns a vector of data descriptors for the dynamic data.
Definition DynamicData.hpp:50
std::vector< Data > data
Data storage.
Definition DynamicData.hpp:47
static std::vector< std::string > parentTypes()
Returns the parent types of the data class.
Definition DynamicData.hpp:33
Parent class for all data transmitted over Flow pins.
Definition NodeData.hpp:27
static std::string type()
Returns the type of the data class.
Definition NodeData.hpp:44
Data struct.
Definition DynamicData.hpp:40
std::string description
Description.
Definition DynamicData.hpp:41
std::vector< std::string > events
List of events.
Definition DynamicData.hpp:43
double value
Value.
Definition DynamicData.hpp:42