SNode.C
|
#include <SubscribtionTree.h>
Classes | |
class | TopicLevel |
Public Member Functions | |
SubscribtionTree (iot::mqtt::server::broker::Broker *broker) | |
void | appear (const std::string &clientId) |
bool | subscribe (const std::string &topic, const std::string &clientId, uint8_t qoS) |
void | publish (Message &&message) |
void | unsubscribe (const std::string &topic, const std::string &clientId) |
void | unsubscribe (const std::string &clientId) |
nlohmann::json | toJson () const |
void | fromJson (const nlohmann::json &json) |
std::list< std::string > | getSubscriptions (const std::string &clientId) const |
std::map< std::string, std::list< std::pair< std::string, uint8_t > > > | getSubscriptionTree () const |
void | clear () |
Private Attributes | |
TopicLevel | head |
Definition at line 65 of file SubscribtionTree.h.
|
explicit |
Definition at line 61 of file SubscribtionTree.cpp.
References head, and iot::mqtt::server::broker::SubscribtionTree::TopicLevel::TopicLevel().
Referenced by iot::mqtt::server::broker::Broker::Broker().
void iot::mqtt::server::broker::SubscribtionTree::appear | ( | const std::string & | clientId | ) |
Definition at line 65 of file SubscribtionTree.cpp.
References iot::mqtt::server::broker::SubscribtionTree::TopicLevel::appear(), and head.
Referenced by iot::mqtt::server::broker::Broker::restartSession().
void iot::mqtt::server::broker::SubscribtionTree::clear | ( | ) |
Definition at line 126 of file SubscribtionTree.cpp.
References iot::mqtt::server::broker::SubscribtionTree::TopicLevel::clear(), and head.
Referenced by iot::mqtt::server::broker::Broker::Broker().
void iot::mqtt::server::broker::SubscribtionTree::fromJson | ( | const nlohmann::json & | json | ) |
Definition at line 116 of file SubscribtionTree.cpp.
References iot::mqtt::server::broker::SubscribtionTree::TopicLevel::fromJson(), and head.
Referenced by iot::mqtt::server::broker::Broker::Broker().
std::list< std::string > iot::mqtt::server::broker::SubscribtionTree::getSubscriptions | ( | const std::string & | clientId | ) | const |
Definition at line 106 of file SubscribtionTree.cpp.
References iot::mqtt::server::broker::SubscribtionTree::TopicLevel::getSubscriptions(), and head.
Referenced by iot::mqtt::server::broker::Broker::getSubscriptions().
std::map< std::string, std::list< std::pair< std::string, uint8_t > > > iot::mqtt::server::broker::SubscribtionTree::getSubscriptionTree | ( | ) | const |
Definition at line 112 of file SubscribtionTree.cpp.
References iot::mqtt::server::broker::SubscribtionTree::TopicLevel::getSubscriptionTree(), and head.
Referenced by iot::mqtt::server::broker::Broker::getSubscriptionTree().
void iot::mqtt::server::broker::SubscribtionTree::publish | ( | Message && | message | ) |
Definition at line 84 of file SubscribtionTree.cpp.
References iot::mqtt::server::broker::Message::getTopic(), head, and iot::mqtt::server::broker::SubscribtionTree::TopicLevel::publish().
Referenced by iot::mqtt::server::broker::Broker::publish().
bool iot::mqtt::server::broker::SubscribtionTree::subscribe | ( | const std::string & | topic, |
const std::string & | clientId, | ||
uint8_t | qoS | ||
) |
Definition at line 69 of file SubscribtionTree.cpp.
References head, and iot::mqtt::server::broker::SubscribtionTree::TopicLevel::subscribe().
Referenced by iot::mqtt::server::broker::Broker::subscribe().
nlohmann::json iot::mqtt::server::broker::SubscribtionTree::toJson | ( | ) | const |
Definition at line 122 of file SubscribtionTree.cpp.
References head, and iot::mqtt::server::broker::SubscribtionTree::TopicLevel::toJson().
Referenced by iot::mqtt::server::broker::Broker::~Broker().
void iot::mqtt::server::broker::SubscribtionTree::unsubscribe | ( | const std::string & | clientId | ) |
Definition at line 102 of file SubscribtionTree.cpp.
References head, and iot::mqtt::server::broker::SubscribtionTree::TopicLevel::unsubscribe().
Referenced by iot::mqtt::server::broker::Broker::deleteSession(), and iot::mqtt::server::broker::Broker::unsubscribe().
void iot::mqtt::server::broker::SubscribtionTree::unsubscribe | ( | const std::string & | topic, |
const std::string & | clientId | ||
) |
Definition at line 93 of file SubscribtionTree.cpp.
References head, and iot::mqtt::server::broker::SubscribtionTree::TopicLevel::unsubscribe().
Referenced by iot::mqtt::server::broker::Broker::unsubscribe().
|
private |
Definition at line 122 of file SubscribtionTree.h.
Referenced by appear(), clear(), fromJson(), getSubscriptions(), getSubscriptionTree(), publish(), subscribe(), SubscribtionTree(), toJson(), unsubscribe(), and unsubscribe().