87 #ifdef VLINK_SUPPORT_ZENOH
92 #include <shared_mutex>
95 #include "../extension/qos.h"
96 #include "../impl/conf.h"
115 std::string fragment;
117 std::string shm_mode;
118 std::string shm_size;
119 std::string shm_threshold;
120 std::string shm_loan_threshold;
121 std::string shm_blocking;
132 explicit ZenohConf(
const std::string& _address,
const std::string& _event =
"", int32_t _domain = 0,
133 const std::string& _qos =
"",
const std::string& _fragment =
"");
141 [[nodiscard]]
bool operator==(
const ZenohConf& conf)
const noexcept;
149 [[nodiscard]]
bool operator!=(
const ZenohConf& conf)
const noexcept;
156 [[nodiscard]]
TransportType get_transport_type()
const override;
167 void append_properties(PropertiesMap& properties)
const;
180 static void register_qos(
const std::string& name,
const Qos& qos);
183 static void register_qos_internal(
const std::string& name,
const Qos& qos);
185 static const Qos& find_qos(
const std::string& name);
187 friend class ZenohFactory;
188 static std::map<std::string, Qos> qos_map_;
189 static std::shared_mutex mtx_;
190 static constexpr
const char* kRespSuffix{
"___resp"};
191 #ifndef VLINK_ENABLE_C_INTERFACE
202 inline ZenohConf::ZenohConf(
const std::string& _address,
const std::string& _event, int32_t _domain,
203 const std::string& _qos,
const std::string& _fragment)
204 : address(_address), event(_event), domain(_domain), qos(_qos), fragment(_fragment) {}
207 return address == conf.address &&
event == conf.event && domain == conf.domain && depth == conf.depth &&
208 qos == conf.qos && fragment == conf.fragment && shm == conf.shm && shm_mode == conf.shm_mode &&
209 shm_size == conf.shm_size && shm_threshold == conf.shm_threshold &&
210 shm_loan_threshold == conf.shm_loan_threshold && shm_blocking == conf.shm_blocking;
215 inline TransportType ZenohConf::get_transport_type()
const {
return TransportType::kZenoh; }
217 inline void ZenohConf::append_properties(PropertiesMap& properties)
const {
219 properties[
"zenoh.shm"] = shm;
222 if (!shm_mode.empty()) {
223 properties[
"zenoh.shm_mode"] = shm_mode;
226 if (!shm_size.empty()) {
227 properties[
"zenoh.shm_size"] = shm_size;
230 if (!shm_threshold.empty()) {
231 properties[
"zenoh.shm_threshold"] = shm_threshold;
234 if (!shm_loan_threshold.empty()) {
235 properties[
"zenoh.shm_loan_threshold"] = shm_loan_threshold;
238 if (!shm_blocking.empty()) {
239 properties[
"zenoh.shm_blocking"] = shm_blocking;
#define VLINK_CONF_IMPL(classname)
Convenience macro that emits the standard concrete conf boilerplate.
Definition: conf.h:251
#define VLINK_DECLARE_GLOBAL_PROPERTY()
Declares per-transport static configuration storage and access helpers.
Definition: conf.h:309
#define VLINK_ALLOW_IMPL_TYPE(type)
Records the bitmask of ImplType values supported by a conf.
Definition: conf.h:292
#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:1051
bool operator!=(const Function< ReturnT(ArgsT...), SboSizeT > &cb, std::nullptr_t) noexcept
Inequality with nullptr; true when cb stores a target.
Definition: functional.h:1061
TransportType
Enumeration of every transport backend recognised by VLink.
Definition: types.h:128
@ kGetter
Field getter (reads latest value).
Definition: types.h:117
@ kSubscriber
Event subscriber (receives broadcasts).
Definition: types.h:115
@ kClient
Method client (RPC caller).
Definition: types.h:113
@ kSetter
Field setter (writes latest value).
Definition: types.h:116
@ kPublisher
Event publisher (one-to-many broadcast).
Definition: types.h:114
@ kServer
Method server (RPC responder).
Definition: types.h:112