#pragma once #include #include #include #include #include #include using tCellVoltages = std::map; template class DataPoint { template class> friend class DataPointContainer; public: using tValue = std::variant; DataPoint() = delete; DataPoint(DataPoint const& other) : _strLabel(other._strLabel) , _strValue(other._strValue) , _strUnit(other._strUnit) , _value(other._value) , _timestamp(other._timestamp) { } DataPoint(std::string const& strLabel, std::string const& strValue, std::string const& strUnit, tValue value, uint32_t timestamp) : _strLabel(strLabel) , _strValue(strValue) , _strUnit(strUnit) , _value(std::move(value)) , _timestamp(timestamp) { } std::string const& getLabelText() const { return _strLabel; } std::string const& getValueText() const { return _strValue; } std::string const& getUnitText() const { return _strUnit; } uint32_t getTimestamp() const { return _timestamp; } bool operator==(DataPoint const& other) const { return _value == other._value; } private: std::string _strLabel; std::string _strValue; std::string _strUnit; tValue _value; uint32_t _timestamp; }; template std::string dataPointValueToStr(T const& v); template class Traits> class DataPointContainer { public: DataPointContainer() = default; //template