65#ifdef VLINK_SUPPORT_MQTT
69#include <shared_mutex>
99 explicit MqttConf(
const std::string& _address,
const std::string& _event =
"", int32_t _domain = 0, int32_t _qos = 1,
100 const std::string& _fragment =
"");
108 [[nodiscard]]
bool operator==(
const MqttConf& conf)
const noexcept;
116 [[nodiscard]]
bool operator!=(
const MqttConf& conf)
const noexcept;
123 [[nodiscard]]
TransportType get_transport_type()
const override;
125 static constexpr const char* kRespSuffix{
"___resp"};
127#ifndef VLINK_ENABLE_C_INTERFACE
138inline MqttConf::MqttConf(
const std::string& _address,
const std::string& _event, int32_t _domain, int32_t _qos,
139 const std::string& _fragment)
140 : address(_address), event(_event), domain(_domain), qos(_qos), fragment(_fragment) {}
142inline bool MqttConf::operator==(
const MqttConf& conf)
const noexcept {
143 return address == conf.address &&
event == conf.event && domain == conf.domain && qos == conf.qos &&
144 fragment == conf.fragment;
147inline bool MqttConf::operator!=(
const MqttConf& conf)
const noexcept {
return !(*
this == conf); }
149inline TransportType MqttConf::get_transport_type()
const {
return TransportType::kMqtt; }
Abstract transport configuration base class and associated helper macros.
#define VLINK_CONF_IMPL(classname)
Standard boilerplate for concrete Conf subclass declarations.
定义 conf.h:227
#define VLINK_DECLARE_GLOBAL_PROPERTY()
Declares per-transport global state: thread count and property storage.
定义 conf.h:292
#define VLINK_ALLOW_IMPL_TYPE(type)
Declares a static constexpr bitmask of supported ImplType values.
定义 conf.h:268
#define VLINK_EXPORT
定义 macros.h:85
TransportType
Enumeration of all supported transport backends.
定义 types.h:107
Abstract base class for VLink transport configuration objects.
定义 conf.h:83