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_UINT16_H
43#define IOT_MQTT_TYPES_UINT16_H
45#include "iot/mqtt/types/TypeBase.h"
49#ifndef DOXYGEN_SHOULD_SKIP_THIS
55namespace iot::mqtt::types {
57 class UInt16 :
public TypeBase<uint16_t> {
60 UInt16(
const UInt16&) =
default;
61 UInt16(UInt16&&)
noexcept =
default;
63 UInt16& operator=(
const UInt16&) =
default;
64 UInt16& operator=(UInt16&&)
noexcept =
default;
68 UInt16& operator=(
const uint16_t& newValue);
69 operator uint16_t()
const;
57 class UInt16 :
public TypeBase<uint16_t> {
…};
72 extern template class TypeBase<uint16_t>;
#define SUBSCRIBTION_MAX_QOS
Session & operator=(const Session &)=default
std::set< uint16_t > publishPacketIdentifierSet
virtual nlohmann::json toJson() const
Session(const nlohmann::json &json)
bool isCleanSession() const
Session(const Session &)=default
virtual ~Session()=default
void fromJson(const nlohmann::json &json)
std::set< uint16_t > pubrelPacketIdentifierSet
iot::mqtt::types::StringRaw message
std::string getTopic() const
std::string getMessage() const
Publish(uint16_t packetIdentifier, const std::string &topic, const std::string &message, uint8_t qoS, bool dup, bool retain)
iot::mqtt::types::UInt16 packetIdentifier
uint16_t getPacketIdentifier() const
iot::mqtt::types::String topic
std::vector< char > serializeVP() const override
SocketContextFactory(const std::string &sessionStoreFileName)
std::shared_ptr< iot::mqtt::server::broker::Broker > broker
virtual core::socket::stream::SocketContext * create(core::socket::stream::SocketConnection *socketConnection, std::shared_ptr< iot::mqtt::server::broker::Broker > broker)=0
core::socket::stream::SocketContext * create(core::socket::stream::SocketConnection *socketConnection) final
void restartSession(const std::string &clientId)
std::string sessionStoreFileName
uint8_t subscribe(const std::string &clientId, const std::string &topic, uint8_t qoS)
bool hasActiveSession(const std::string &clientId)
bool isActiveSession(const std::string &clientId, const Mqtt *mqtt)
iot::mqtt::server::broker::RetainTree retainTree
void publish(const std::string &originClientId, const std::string &topic, const std::string &message, uint8_t qoS, bool retain)
std::list< std::string > getSubscriptions(const std::string &clientId) const
Broker(uint8_t maxQoS, const std::string &sessionStoreFileName)
void release(const std::string &topic)
bool hasSession(const std::string &clientId)
void appear(const std::string &clientId, const std::string &topic, uint8_t qoS)
static std::shared_ptr< Broker > instance(uint8_t maxQoS, const std::string &sessionStoreFileName)
void unsubscribe(const std::string &clientId, const std::string &topic)
Session * renewSession(const std::string &clientId, iot::mqtt::server::Mqtt *mqtt)
void deleteSession(const std::string &clientId)
void unsubscribe(const std::string &clientId)
bool hasRetainedSession(const std::string &clientId)
iot::mqtt::server::broker::SubscribtionTree subscribtionTree
Session * newSession(const std::string &clientId, iot::mqtt::server::Mqtt *mqtt)
void sendPublish(const std::string &clientId, Message &message, uint8_t qoS, bool retain)
void retainSession(const std::string &clientId)
void setMessage(const std::string &message)
const std::string & getOriginClientId() const
std::string originClientId
nlohmann::json toJson() const
const std::string & getTopic() const
void setTopic(const std::string &topic)
bool getOriginRetain() const
const std::string & getMessage() const
Message & operator=(const Message &)=default
Message(const Message &message)=default
Message(const std::string &originClientId, const std::string &topic, const std::string &message, uint8_t qoS, bool originRetain)
Message & fromJson(const nlohmann::json &json)
void retain(const Message &message, std::string topic)
void appear(const std::string &clientId, uint8_t clientQoS)
TopicLevel(iot::mqtt::server::broker::Broker *broker)
TopicLevel & fromJson(const nlohmann::json &json)
void appear(const std::string &clientId, std::string topic, uint8_t qoS)
nlohmann::json toJson() const
bool release(std::string topic)
void appear(const std::string &clientId, const std::string &topic, uint8_t qoS)
void retain(Message &&message)
void fromJson(const nlohmann::json &json)
RetainTree(iot::mqtt::server::broker::Broker *broker)
nlohmann::json toJson() const
void release(const std::string &topic)
void sendPublish(iot::mqtt::server::broker::Message &message, uint8_t qoS, bool retain)
std::deque< Message > messageQueue
nlohmann::json toJson() const final
Session(iot::mqtt::server::Mqtt *mqtt)
void fromJson(const nlohmann::json &json)
Session * renew(iot::mqtt::server::Mqtt *mqtt)
bool isOwnedBy(const iot::mqtt::server::Mqtt *mqtt) const