SNode.C
Loading...
Searching...
No Matches
iot::mqtt::packets::Unsubscribe Class Reference

#include <Unsubscribe.h>

Inheritance diagram for iot::mqtt::packets::Unsubscribe:
Collaboration diagram for iot::mqtt::packets::Unsubscribe:

Public Member Functions

 Unsubscribe ()
 
 Unsubscribe (uint16_t packetIdentifier, const std::list< std::string > &topics)
 
uint16_t getPacketIdentifier () const
 
const std::list< std::string > & getTopics () const
 
- Public Member Functions inherited from iot::mqtt::ControlPacket
 ControlPacket (uint8_t type, const std::string &name)
 
 ControlPacket (const ControlPacket &)=default
 
 ControlPacket (ControlPacket &&)=default
 
virtual ~ControlPacket ()
 
ControlPacketoperator= (const ControlPacket &)=default
 
ControlPacketoperator= (ControlPacket &&)=default
 
std::vector< char > serialize () const
 
const std::string & getName () const
 
uint8_t getType () const
 
uint8_t getFlags () const
 

Protected Attributes

iot::mqtt::types::UInt16 packetIdentifier
 
std::list< std::string > topics
 
- Protected Attributes inherited from iot::mqtt::ControlPacket
uint8_t flags = 0
 

Private Member Functions

std::vector< char > serializeVP () const override
 

Detailed Description

Definition at line 59 of file Unsubscribe.h.

Constructor & Destructor Documentation

◆ Unsubscribe() [1/2]

iot::mqtt::packets::Unsubscribe::Unsubscribe ( )

Definition at line 52 of file Unsubscribe.cpp.

54 }
#define MQTT_UNSUBSCRIBE
Definition Unsubscribe.h:59

References iot::mqtt::ControlPacket::ControlPacket().

Referenced by Unsubscribe().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Unsubscribe() [2/2]

iot::mqtt::packets::Unsubscribe::Unsubscribe ( uint16_t  packetIdentifier,
const std::list< std::string > &  topics 
)

Definition at line 56 of file Unsubscribe.cpp.

57 : Unsubscribe() {
59 this->topics = topics;
60 }
std::list< std::string > topics
Definition Unsubscribe.h:74
iot::mqtt::types::UInt16 packetIdentifier
Definition Unsubscribe.h:72

References iot::mqtt::types::UInt16::operator=(), packetIdentifier, topics, and Unsubscribe().

Referenced by iot::mqtt::client::Mqtt::sendUnsubscribe().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ getPacketIdentifier()

uint16_t iot::mqtt::packets::Unsubscribe::getPacketIdentifier ( ) const

Definition at line 76 of file Unsubscribe.cpp.

76 {
77 return packetIdentifier;
78 }

References packetIdentifier.

Referenced by iot::mqtt::server::Mqtt::_onUnsubscribe().

Here is the caller graph for this function:

◆ getTopics()

const std::list< std::string > & iot::mqtt::packets::Unsubscribe::getTopics ( ) const

Definition at line 80 of file Unsubscribe.cpp.

80 {
81 return topics;
82 }

References topics.

Referenced by iot::mqtt::server::Mqtt::_onUnsubscribe().

Here is the caller graph for this function:

◆ serializeVP()

std::vector< char > iot::mqtt::packets::Unsubscribe::serializeVP ( ) const
overrideprivatevirtual

Implements iot::mqtt::ControlPacket.

Definition at line 62 of file Unsubscribe.cpp.

62 {
63 std::vector<char> packet(packetIdentifier.serialize());
64
65 for (const std::string& topic : topics) {
66 iot::mqtt::types::String topicString;
67 topicString = topic;
68
69 std::vector<char> tmpPacket = topicString.serialize();
70 packet.insert(packet.end(), tmpPacket.begin(), tmpPacket.end());
71 }
72
73 return packet;
74 }
std::vector< char > serialize() const override
Definition String.cpp:97
virtual std::vector< char > serialize() const
Definition TypeBase.hpp:83

References iot::mqtt::types::String::operator=(), packetIdentifier, iot::mqtt::types::TypeBase< ValueTypeT >::serialize(), iot::mqtt::types::String::serialize(), and topics.

Here is the call graph for this function:

Member Data Documentation

◆ packetIdentifier

iot::mqtt::types::UInt16 iot::mqtt::packets::Unsubscribe::packetIdentifier
protected

◆ topics

std::list<std::string> iot::mqtt::packets::Unsubscribe::topics
protected

The documentation for this class was generated from the following files: