68#ifdef VLINK_SUPPORT_ZENOH
73#include <shared_mutex>
98 std::string shm_threshold;
99 std::string shm_loan_threshold;
100 std::string shm_blocking;
111 explicit ZenohConf(
const std::string& _address,
const std::string& _event =
"", int32_t _domain = 0,
112 const std::string& _qos =
"",
const std::string& _fragment =
"");
120 [[nodiscard]]
bool operator==(
const ZenohConf& conf)
const noexcept;
128 [[nodiscard]]
bool operator!=(
const ZenohConf& conf)
const noexcept;
135 [[nodiscard]]
TransportType get_transport_type()
const override;
144 void append_properties(PropertiesMap& properties)
const;
158 static void register_qos(
const std::string& name,
const Qos& qos);
161 static void register_qos_internal(
const std::string& name,
const Qos& qos);
163 static const Qos& find_qos(
const std::string& name);
165 friend class ZenohFactory;
166 static std::map<std::string, Qos> qos_map_;
167 static std::shared_mutex mtx_;
168 static constexpr const char* kRespSuffix{
"___resp"};
169#ifndef VLINK_ENABLE_C_INTERFACE
180inline ZenohConf::ZenohConf(
const std::string& _address,
const std::string& _event, int32_t _domain,
181 const std::string& _qos,
const std::string& _fragment)
182 : address(_address), event(_event), domain(_domain), qos(_qos), fragment(_fragment) {}
184inline bool ZenohConf::operator==(
const ZenohConf& conf)
const noexcept {
185 return address == conf.address &&
event == conf.event && domain == conf.domain && depth == conf.depth &&
186 qos == conf.qos && fragment == conf.fragment && shm == conf.shm && shm_mode == conf.shm_mode &&
187 shm_size == conf.shm_size && shm_threshold == conf.shm_threshold &&
188 shm_loan_threshold == conf.shm_loan_threshold && shm_blocking == conf.shm_blocking;
191inline bool ZenohConf::operator!=(
const ZenohConf& conf)
const noexcept {
return !(*
this == conf); }
193inline TransportType ZenohConf::get_transport_type()
const {
return TransportType::kZenoh; }
195inline void ZenohConf::append_properties(PropertiesMap& properties)
const {
197 properties[
"zenoh.shm"] = shm;
200 if (!shm_mode.empty()) {
201 properties[
"zenoh.shm_mode"] = shm_mode;
204 if (!shm_size.empty()) {
205 properties[
"zenoh.shm_size"] = shm_size;
208 if (!shm_threshold.empty()) {
209 properties[
"zenoh.shm_threshold"] = shm_threshold;
212 if (!shm_loan_threshold.empty()) {
213 properties[
"zenoh.shm_loan_threshold"] = shm_loan_threshold;
216 if (!shm_blocking.empty()) {
217 properties[
"zenoh.shm_blocking"] = shm_blocking;
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
Quality of Service (QoS) policy aggregate for VLink publishers and subscribers.
Abstract base class for VLink transport configuration objects.
定义 conf.h:83