12345678910111213141516171819202122232425262728293031323334353637 |
- #pragma once
- #include <string>
- #include "memepp/buffer_def.hpp"
- namespace mqtt {
- // 定义 mqtt 主题的类
- class MqttTopic {
- public:
- // 构造函数
- MqttTopic() {}
- MqttTopic(const std::string& topic, const std::string& stationId);
- // 构造函数
- MqttTopic(const std::string& topic, const std::string& stationId, bool hasReply);
- // 构造函数
- MqttTopic(const std::string& topic, const std::string& stationId, bool hasReply, bool is_gateway_active);
- // 返回订阅topic
- memepp::string get_subscribe_topic() const;
- // 返回订阅topic
- memepp::string get_publish_topic() const;
- // 是否有回复
- bool hasReply_ = true;
- // 是否网关主动
- bool is_gateway_active_ = true;
-
- private:
- // 成员变量
- std::string topic_;
- std::string stationId_;
-
-
-
- };
- } // namespace mqtt
|