66 using ptr_t = std::shared_ptr<topic>;
81 : cli_(cli), name_(name), qos_(qos), retained_(retained) {}
94 return std::make_shared<topic>(cli, name, qos, retained);
112 static std::vector<std::string>
split(
const std::string&
topic);
220 std::variant<string, std::vector<string>> filter_;
Definition iasync_client.h:60
static constexpr bool DFLT_RETAINED
Definition message.h:62
static void validate_qos(int qos)
Definition message.h:330
static constexpr int DFLT_QOS
Definition message.h:60
Definition subscribe_options.h:49
static bool has_wildcards(const string &filter)
static bool is_wildcard(const string &s)
Definition topic.h:242
bool has_wildcards() const
static bool is_wildcard(char c)
Definition topic.h:236
bool matches(const string &topic) const
topic_filter(const string &filter)
bool get_retained() const
Definition topic.h:122
static ptr_t create(iasync_client &cli, const string &name, int qos=message::DFLT_QOS, bool retained=message::DFLT_RETAINED)
Definition topic.h:90
iasync_client & get_client()
Definition topic.h:100
void set_qos(int qos)
Definition topic.h:127
delivery_token_ptr publish(const void *payload, size_t n)
delivery_token_ptr publish(const void *payload, size_t n, int qos, bool retained)
topic(iasync_client &cli, const string &name, int qos=message::DFLT_QOS, bool retained=message::DFLT_RETAINED)
Definition topic.h:77
int get_qos() const
Definition topic.h:117
std::shared_ptr< topic > ptr_t
Definition topic.h:66
void set_retained(bool retained)
Definition topic.h:135
token_ptr subscribe(const subscribe_options &opts=subscribe_options())
std::shared_ptr< const topic > const_ptr_t
Definition topic.h:68
delivery_token_ptr publish(binary_ref payload)
delivery_token_ptr publish(binary_ref payload, int qos, bool retained)
static std::vector< std::string > split(const std::string &topic)
const string & get_name() const
Definition topic.h:105
string to_string() const
Definition topic.h:185
Definition async_client.h:60
buffer_ref< char > binary_ref
Definition buffer_ref.h:305
topic::ptr_t topic_ptr
Definition topic.h:189
delivery_token::ptr_t delivery_token_ptr
Definition delivery_token.h:127
token::ptr_t token_ptr
Definition token.h:513
topic::const_ptr_t const_topic_ptr
Definition topic.h:192