5 #ifndef HERALD_EXTENDED_DATA_H
6 #define HERALD_EXTENDED_DATA_H
8 #include "../../datatype/data.h"
9 #include "../../datatype/payload_data.h"
10 #include "../../datatype/payload_timestamp.h"
21 using ExtendedDataSegmentCode = uint8_t;
29 virtual bool hasData()
const = 0;
30 virtual void addSection(ExtendedDataSegmentCode code, uint8_t value) = 0;
31 virtual void addSection(ExtendedDataSegmentCode code, uint16_t value) = 0;
32 virtual void addSection(ExtendedDataSegmentCode code,
float value) = 0;
33 virtual void addSection(ExtendedDataSegmentCode code,
const std::string value) = 0;
34 virtual void addSection(ExtendedDataSegmentCode code,
const Data& value) = 0;
54 constexpr
operator uint8_t()
const {
return value; }
60 ExtendedDataSegmentCodesV1::TextPremises(0x10),
61 ExtendedDataSegmentCodesV1::TextLocation(0x11),
62 ExtendedDataSegmentCodesV1::TextArea(0x12),
63 ExtendedDataSegmentCodesV1::LocationUrl(0x13)
74 : code(code), length(length), data(data)
80 : code(code), length(from.size()), data(from)
86 : code(other.code), length(other.length), data(std::move(other.data))
92 : code(other.code), length(other.length), data(other.data)
110 bool hasData()
const override;
111 void addSection(ExtendedDataSegmentCode code, uint8_t value)
override;
112 void addSection(ExtendedDataSegmentCode code, uint16_t value)
override;
113 void addSection(ExtendedDataSegmentCode code,
float value)
override;
114 void addSection(ExtendedDataSegmentCode code,
const std::string value)
override;
115 void addSection(ExtendedDataSegmentCode code,
const Data& value)
override;
119 const std::size_t getSectionCount()
const;
124 std::array<ConcreteExtendedDataSectionV1,8> sections;
The main data workhorse class of the Herald API.
Definition: data.h:33
Definition: payload_data.h:13
Definition: extended_data.h:100
Definition: extended_data.h:24
Contains all low-level Herald datatype implementations.
Definition: base64_string.h:14
Acts as a non-global memory arena for arbitrary classes.
Definition: aggregates.h:15
Definition: extended_data.h:66
Definition: extended_data.h:50