2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
42#ifndef IOT_MQTT_TYPES_TYPEBASE_H
43#define IOT_MQTT_TYPES_TYPEBASE_H
49#ifndef DOXYGEN_SHOULD_SKIP_THIS
56namespace iot::mqtt::
types {
58 template <
typename ValueTypeT>
61 using ValueType = ValueTypeT;
64 explicit TypeBase(std::size_t size =
sizeof(ValueType));
74 virtual std::vector<
char>
serialize()
const;
82 virtual void reset(std::size_t size =
sizeof(ValueType));
std::size_t deserialize(iot::mqtt::MqttContext *mqttContext)
virtual ~ControlPacketDeserializer()
std::size_t getConsumed() const
virtual std::size_t deserializeVP(iot::mqtt::MqttContext *mqttContext)=0
uint32_t getRemainingLength() const
ControlPacketDeserializer()=default
ControlPacketDeserializer & operator=(const ControlPacketDeserializer &)=default
ControlPacketDeserializer(uint32_t remainingLength, uint8_t flags, uint8_t mustFlags)
std::vector< char > serialize() const
const std::string & getName() const
ControlPacket & operator=(const ControlPacket &)=default
virtual std::vector< char > serializeVP() const =0
ControlPacket(const ControlPacket &)=default
ControlPacket(ControlPacket &&)=default
ControlPacket(uint8_t type, const std::string &name)
ControlPacket & operator=(ControlPacket &&)=default
void printVP(const iot::mqtt::ControlPacket &packet) const
virtual void deliverPacket(iot::mqtt::client::Mqtt *mqtt)=0
~ControlPacketDeserializer() override
void _onConnack(const iot::mqtt::client::packets::Connack &connack)
std::size_t deserializeVP(iot::mqtt::MqttContext *mqttContext) override
Connack(uint32_t remainingLength, uint8_t flags)
void deliverPacket(iot::mqtt::client::Mqtt *mqtt) override
uint8_t getReturnCode() const
std::vector< char > serializeVP() const override
Connack(uint8_t returncode, uint8_t acknowledgeFlags)
iot::mqtt::types::UInt8 acknowledgeFlags
bool getSessionPresent() const
uint8_t getAcknowledgeFlags() const
iot::mqtt::types::UInt8 returnCode
std::vector< char > value
TypeBase(const TypeBase &)=default
void setSize(std::size_t size)
virtual std::vector< char > serialize() const
virtual std::size_t deserialize(iot::mqtt::MqttContext *mqttContext)
TypeBase & operator=(TypeBase &&) noexcept=default
TypeBase(std::size_t size=sizeof(ValueType))
virtual ~TypeBase()=default
TypeBase(TypeBase &&) noexcept=default
virtual void reset(std::size_t size=sizeof(ValueType))
TypeBase & operator=(const TypeBase &)=default
UInt8 & operator=(const uint8_t &newValue)
UInt8(UInt8 &&) noexcept=default
UInt8 & operator=(UInt8 &&) noexcept=default
UInt8 & operator=(const UInt8 &)=default
UInt8(const UInt8 &)=default
#define MQTT_CONNACK_FLAGS
const std::vector< std::string > mqttPackageName