24 #ifndef __mqtt_topic_h 25 #define __mqtt_topic_h 27 #include "MQTTAsync.h" 56 using ptr_t = std::shared_ptr<topic>;
69 : cli_(cli), name_(name), qos_(qos), retained_(retained) {}
81 return std::make_shared<topic>(cli, name, qos, retained);
92 const string&
get_name()
const {
return name_; }
144 int qos,
bool retained);
200 std::vector<string> fields_;
240 #endif // __mqtt_topic_h
topic(iasync_client &cli, const string &name, int qos=message::DFLT_QOS, bool retained=message::DFLT_RETAINED)
Definition: topic.h:67
topic::const_ptr_t const_topic_ptr
Definition: topic.h:180
std::string string
Definition: types.h:40
std::shared_ptr< const topic > const_ptr_t
Definition: topic.h:58
string to_string() const
Definition: topic.h:173
void set_qos(int qos)
Definition: topic.h:114
bool get_retained() const
Definition: topic.h:109
bool has_wildcards() const
int get_qos() const
Definition: topic.h:104
topic::ptr_t topic_ptr
Definition: topic.h:177
iasync_client & get_client()
Definition: topic.h:87
Definition: iasync_client.h:58
static std::vector< std::string > split(const std::string &topic)
delivery_token_ptr publish(const void *payload, size_t n)
token::ptr_t token_ptr
Definition: token.h:506
token_ptr subscribe(const subscribe_options &opts=subscribe_options())
delivery_token::ptr_t delivery_token_ptr
Definition: delivery_token.h:125
static PAHO_MQTTPP_EXPORT const int DFLT_QOS
Definition: message.h:59
Definition: subscribe_options.h:41
std::shared_ptr< topic > ptr_t
Definition: topic.h:56
static ptr_t create(iasync_client &cli, const string &name, int qos=message::DFLT_QOS, bool retained=message::DFLT_RETAINED)
Definition: topic.h:78
void set_retained(bool retained)
Definition: topic.h:122
static void validate_qos(int qos)
Definition: message.h:324
Definition: async_client.h:49
static PAHO_MQTTPP_EXPORT const bool DFLT_RETAINED
Definition: message.h:61
bool matches(const string &topic) const
topic_filter(const string &filter)
const string & get_name() const
Definition: topic.h:92