93 #ifdef VLINK_SUPPORT_ZENOH
98 #include <shared_mutex>
101 #include "../extension/qos.h"
102 #include "../impl/conf.h"
121 std::string fragment;
123 std::string shm_mode;
124 std::string shm_size;
125 std::string shm_threshold;
126 std::string shm_loan_threshold;
127 std::string shm_blocking;
138 explicit ZenohConf(
const std::string& _address,
const std::string& _event =
"", int32_t _domain = 0,
139 const std::string& _qos =
"",
const std::string& _fragment =
"");
147 [[nodiscard]]
bool operator==(
const ZenohConf& conf)
const noexcept;
155 [[nodiscard]]
bool operator!=(
const ZenohConf& conf)
const noexcept;
162 [[nodiscard]]
TransportType get_transport_type()
const override;
173 void append_properties(PropertiesMap& properties)
const;
186 static void register_qos(
const std::string& name,
const Qos& qos);
189 static void register_qos_internal(
const std::string& name,
const Qos& qos);
191 static const Qos& find_qos(
const std::string& name);
193 friend class ZenohFactory;
194 static std::map<std::string, Qos> qos_map_;
195 static std::shared_mutex mtx_;
196 static constexpr
const char* kRespSuffix{
"___resp"};
197 #ifndef VLINK_ENABLE_C_INTERFACE
208 inline ZenohConf::ZenohConf(
const std::string& _address,
const std::string& _event, int32_t _domain,
209 const std::string& _qos,
const std::string& _fragment)
210 : address(_address), event(_event), domain(_domain), qos(_qos), fragment(_fragment) {}
213 return address == conf.address &&
event == conf.event && domain == conf.domain && depth == conf.depth &&
214 qos == conf.qos && fragment == conf.fragment && shm == conf.shm && shm_mode == conf.shm_mode &&
215 shm_size == conf.shm_size && shm_threshold == conf.shm_threshold &&
216 shm_loan_threshold == conf.shm_loan_threshold && shm_blocking == conf.shm_blocking;
221 inline TransportType ZenohConf::get_transport_type()
const {
return TransportType::kZenoh; }
223 inline void ZenohConf::append_properties(PropertiesMap& properties)
const {
225 properties[
"zenoh.shm"] = shm;
228 if (!shm_mode.empty()) {
229 properties[
"zenoh.shm_mode"] = shm_mode;
232 if (!shm_size.empty()) {
233 properties[
"zenoh.shm_size"] = shm_size;
236 if (!shm_threshold.empty()) {
237 properties[
"zenoh.shm_threshold"] = shm_threshold;
240 if (!shm_loan_threshold.empty()) {
241 properties[
"zenoh.shm_loan_threshold"] = shm_loan_threshold;
244 if (!shm_blocking.empty()) {
245 properties[
"zenoh.shm_blocking"] = shm_blocking;
#define VLINK_CONF_IMPL(classname)
Convenience macro that emits the standard concrete conf boilerplate.
Definition: conf.h:250
#define VLINK_DECLARE_GLOBAL_PROPERTY()
Declares per-transport static configuration storage and access helpers.
Definition: conf.h:308
#define VLINK_ALLOW_IMPL_TYPE(type)
Records the bitmask of ImplType values supported by a conf.
Definition: conf.h:291
#define VLINK_EXPORT
Definition: macros.h:81
bool operator==(const Function< ReturnT(ArgsT...), SboSizeT > &cb, std::nullptr_t) noexcept
Equality with nullptr; true when cb has no stored target.
Definition: functional.h:1057
bool operator!=(const Function< ReturnT(ArgsT...), SboSizeT > &cb, std::nullptr_t) noexcept
Inequality with nullptr; true when cb stores a target.
Definition: functional.h:1067
TransportType
Enumeration of every transport backend recognised by VLink.
Definition: types.h:126
@ kGetter
Field getter (reads latest value).
Definition: types.h:115
@ kSubscriber
Event subscriber (receives broadcasts).
Definition: types.h:113
@ kClient
Method client (RPC caller).
Definition: types.h:111
@ kSetter
Field setter (writes latest value).
Definition: types.h:114
@ kPublisher
Event publisher (one-to-many broadcast).
Definition: types.h:112
@ kServer
Method server (RPC responder).
Definition: types.h:110