SNode.C
Loading...
Searching...
No Matches
iot::mqtt::server::broker::RetainTree Class Reference

#include <RetainTree.h>

Collaboration diagram for iot::mqtt::server::broker::RetainTree:

Classes

class  TopicLevel
 

Public Member Functions

 RetainTree (iot::mqtt::server::broker::Broker *broker)
 
void retain (Message &&message)
 
void appear (const std::string &clientId, const std::string &topic, uint8_t qoS)
 
void release (const std::string &topic)
 
nlohmann::json toJson () const
 
void fromJson (const nlohmann::json &json)
 
std::list< std::pair< std::string, std::string > > getRetainedTree () const
 
void clear ()
 

Private Attributes

TopicLevel head
 

Detailed Description

Definition at line 65 of file RetainTree.h.

Constructor & Destructor Documentation

◆ RetainTree()

iot::mqtt::server::broker::RetainTree::RetainTree ( iot::mqtt::server::broker::Broker broker)
explicit

Definition at line 61 of file RetainTree.cpp.

62 : head(broker) {
63 }

References head, and iot::mqtt::server::broker::RetainTree::TopicLevel::TopicLevel().

Referenced by iot::mqtt::server::broker::Broker::Broker().

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

Member Function Documentation

◆ appear()

void iot::mqtt::server::broker::RetainTree::appear ( const std::string &  clientId,
const std::string &  topic,
uint8_t  qoS 
)

Definition at line 75 of file RetainTree.cpp.

75 {
76 head.appear(clientId, topic, qoS);
77 }
void appear(const std::string &clientId, std::string topic, uint8_t qoS)

References iot::mqtt::server::broker::RetainTree::TopicLevel::appear(), and head.

Referenced by iot::mqtt::server::broker::Broker::appear(), and iot::mqtt::server::broker::Broker::subscribe().

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

◆ clear()

void iot::mqtt::server::broker::RetainTree::clear ( )

Definition at line 97 of file RetainTree.cpp.

References iot::mqtt::server::broker::RetainTree::TopicLevel::clear(), and head.

Referenced by iot::mqtt::server::broker::Broker::Broker().

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

◆ fromJson()

void iot::mqtt::server::broker::RetainTree::fromJson ( const nlohmann::json &  json)

Definition at line 83 of file RetainTree.cpp.

83 {
84 if (!json.empty()) {
85 head.fromJson(json);
86 }
87 }
TopicLevel & fromJson(const nlohmann::json &json)

References iot::mqtt::server::broker::RetainTree::TopicLevel::fromJson(), and head.

Referenced by iot::mqtt::server::broker::Broker::Broker().

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

◆ getRetainedTree()

std::list< std::pair< std::string, std::string > > iot::mqtt::server::broker::RetainTree::getRetainedTree ( ) const

Definition at line 89 of file RetainTree.cpp.

89 {
90 return head.getRetainTree();
91 }
std::list< std::pair< std::string, std::string > > getRetainTree() const

References iot::mqtt::server::broker::RetainTree::TopicLevel::getRetainTree(), and head.

Here is the call graph for this function:

◆ release()

void iot::mqtt::server::broker::RetainTree::release ( const std::string &  topic)

Definition at line 79 of file RetainTree.cpp.

79 {
80 head.release(topic);
81 }

References head, and iot::mqtt::server::broker::RetainTree::TopicLevel::release().

Here is the call graph for this function:

◆ retain()

void iot::mqtt::server::broker::RetainTree::retain ( Message &&  message)

Definition at line 65 of file RetainTree.cpp.

65 {
66 if (!message.getTopic().empty()) {
67 if (!message.getMessage().empty()) {
68 head.retain(message, message.getTopic());
69 } else {
70 head.release(message.getTopic());
71 }
72 }
73 }
void retain(const Message &message, std::string topic)

References iot::mqtt::server::broker::Message::getMessage(), iot::mqtt::server::broker::Message::getTopic(), head, iot::mqtt::server::broker::RetainTree::TopicLevel::release(), and iot::mqtt::server::broker::RetainTree::TopicLevel::retain().

Referenced by iot::mqtt::server::broker::Broker::publish().

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

◆ toJson()

nlohmann::json iot::mqtt::server::broker::RetainTree::toJson ( ) const

Definition at line 93 of file RetainTree.cpp.

93 {
94 return head.toJson();
95 }

References head, and iot::mqtt::server::broker::RetainTree::TopicLevel::toJson().

Referenced by iot::mqtt::server::broker::Broker::~Broker().

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

Member Data Documentation

◆ head

TopicLevel iot::mqtt::server::broker::RetainTree::head
private

Definition at line 110 of file RetainTree.h.

Referenced by appear(), clear(), fromJson(), getRetainedTree(), release(), retain(), RetainTree(), and toJson().


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