SNode.C
|
Public Member Functions | |
TopicLevel (iot::mqtt::server::broker::Broker *broker, const std::string &topicLevel) | |
void | appear (const std::string &clientId, const std::string &topic) |
bool | subscribe (const std::string &clientId, uint8_t qoS, std::string topic) |
void | publish (Message &message, std::string topic) |
bool | unsubscribe (const std::string &clientId, std::string topic) |
bool | unsubscribe (const std::string &clientId) |
std::list< std::string > | getSubscriptions (const std::string &clientId) const |
std::map< std::string, std::list< std::pair< std::string, uint8_t > > > | getSubscriptionTree () const |
TopicLevel & | fromJson (const nlohmann::json &json) |
nlohmann::json | toJson () const |
void | clear () |
Private Member Functions | |
std::list< std::string > | getSubscriptions (const std::string &absoluteTopicLevel, const std::string &clientId) const |
std::map< std::string, std::list< std::pair< std::string, uint8_t > > > | getSubscriptionTree (const std::string &absoluteTopicLevel) const |
Private Attributes | |
iot::mqtt::server::broker::Broker * | broker |
std::map< std::string, uint8_t > | clientIds |
std::map< std::string, TopicLevel > | topicLevels |
std::string | topicLevel |
Definition at line 87 of file SubscribtionTree.h.
|
explicit |
Definition at line 130 of file SubscribtionTree.cpp.
References topicLevel.
Referenced by clear(), fromJson(), subscribe(), and iot::mqtt::server::broker::SubscribtionTree::SubscribtionTree().
void iot::mqtt::server::broker::SubscribtionTree::TopicLevel::appear | ( | const std::string & | clientId, |
const std::string & | topic | ||
) |
Definition at line 135 of file SubscribtionTree.cpp.
References appear(), iot::mqtt::server::broker::Broker::appear(), clientIds, and topicLevels.
Referenced by iot::mqtt::server::broker::SubscribtionTree::appear(), and appear().
void iot::mqtt::server::broker::SubscribtionTree::TopicLevel::clear | ( | ) |
Definition at line 347 of file SubscribtionTree.cpp.
References TopicLevel().
Referenced by iot::mqtt::server::broker::SubscribtionTree::clear().
SubscribtionTree::TopicLevel & iot::mqtt::server::broker::SubscribtionTree::TopicLevel::fromJson | ( | const nlohmann::json & | json | ) |
Definition at line 328 of file SubscribtionTree.cpp.
References clientIds, fromJson(), TopicLevel(), and topicLevels.
Referenced by iot::mqtt::server::broker::SubscribtionTree::fromJson(), and fromJson().
|
private |
Definition at line 291 of file SubscribtionTree.cpp.
References clientIds, getSubscriptions(), and topicLevels.
Referenced by getSubscriptions(), and getSubscriptions().
std::list< std::string > iot::mqtt::server::broker::SubscribtionTree::TopicLevel::getSubscriptions | ( | const std::string & | clientId | ) | const |
Definition at line 283 of file SubscribtionTree.cpp.
References getSubscriptions().
Referenced by iot::mqtt::server::broker::SubscribtionTree::getSubscriptions().
std::map< std::string, std::list< std::pair< std::string, uint8_t > > > iot::mqtt::server::broker::SubscribtionTree::TopicLevel::getSubscriptionTree | ( | ) | const |
Definition at line 287 of file SubscribtionTree.cpp.
References getSubscriptionTree().
Referenced by iot::mqtt::server::broker::SubscribtionTree::getSubscriptionTree().
|
private |
Definition at line 309 of file SubscribtionTree.cpp.
References clientIds, getSubscriptionTree(), and topicLevels.
Referenced by getSubscriptionTree(), and getSubscriptionTree().
void iot::mqtt::server::broker::SubscribtionTree::TopicLevel::publish | ( | Message & | message, |
std::string | topic | ||
) |
Definition at line 170 of file SubscribtionTree.cpp.
References clientIds, iot::mqtt::server::broker::Message::getMessage(), iot::mqtt::server::broker::Message::getTopic(), publish(), iot::mqtt::server::broker::Broker::sendPublish(), iot::mqtt::Mqtt::toHexString(), and topicLevels.
Referenced by iot::mqtt::server::broker::SubscribtionTree::publish(), and publish().
bool iot::mqtt::server::broker::SubscribtionTree::TopicLevel::subscribe | ( | const std::string & | clientId, |
uint8_t | qoS, | ||
std::string | topic | ||
) |
Definition at line 145 of file SubscribtionTree.cpp.
References clientIds, subscribe(), TopicLevel(), and topicLevels.
Referenced by subscribe(), and iot::mqtt::server::broker::SubscribtionTree::subscribe().
nlohmann::json iot::mqtt::server::broker::SubscribtionTree::TopicLevel::toJson | ( | ) | const |
Definition at line 269 of file SubscribtionTree.cpp.
References clientIds, toJson(), and topicLevels.
Referenced by iot::mqtt::server::broker::SubscribtionTree::toJson(), and toJson().
bool iot::mqtt::server::broker::SubscribtionTree::TopicLevel::unsubscribe | ( | const std::string & | clientId | ) |
Definition at line 249 of file SubscribtionTree.cpp.
References clientIds, topicLevel, topicLevels, and unsubscribe().
Referenced by iot::mqtt::server::broker::SubscribtionTree::unsubscribe(), and unsubscribe().
bool iot::mqtt::server::broker::SubscribtionTree::TopicLevel::unsubscribe | ( | const std::string & | clientId, |
std::string | topic | ||
) |
Definition at line 224 of file SubscribtionTree.cpp.
References clientIds, topicLevel, topicLevels, and unsubscribe().
Referenced by unsubscribe(), and iot::mqtt::server::broker::SubscribtionTree::unsubscribe().
|
private |
Definition at line 114 of file SubscribtionTree.h.
|
private |
Definition at line 116 of file SubscribtionTree.h.
Referenced by appear(), fromJson(), getSubscriptions(), getSubscriptionTree(), publish(), subscribe(), toJson(), unsubscribe(), and unsubscribe().
|
private |
Definition at line 119 of file SubscribtionTree.h.
Referenced by TopicLevel(), unsubscribe(), and unsubscribe().
|
private |
Definition at line 117 of file SubscribtionTree.h.
Referenced by appear(), fromJson(), getSubscriptions(), getSubscriptionTree(), publish(), subscribe(), toJson(), unsubscribe(), and unsubscribe().