81 #ifdef VLINK_SUPPORT_DDST
85 #include <shared_mutex>
90 #include "../base/functional.h"
91 #include "../extension/qos.h"
92 #include "../impl/conf.h"
109 PropertiesMap qos_ext;
119 explicit DdstConf(
const std::string& _topic, int32_t _domain = 0, int32_t _depth = 0,
const std::string& _qos =
"");
128 explicit DdstConf(
const std::string& _topic, int32_t _domain,
const PropertiesMap& _qos_ext);
136 [[nodiscard]]
bool operator==(
const DdstConf& conf)
const noexcept;
144 [[nodiscard]]
bool operator!=(
const DdstConf& conf)
const noexcept;
151 [[nodiscard]]
TransportType get_transport_type()
const override;
164 [[nodiscard]]
static std::vector<std::tuple<std::string, std::string>> get_discovered_topics(int32_t _domain);
176 static bool load_global_qos_file(
const std::string& filepath);
189 static void register_qos(
const std::string& name,
const Qos& qos);
192 static void register_qos_internal(
const std::string& name,
const Qos& qos);
194 static const Qos& find_qos(
const std::string& name);
196 friend class DdstFactory;
197 static std::map<std::string, Function<
void*()>> type_support_map_;
198 static std::map<std::string, Qos> qos_map_;
199 static std::shared_mutex mtx_;
200 static constexpr
const char* kRespSuffix{
"___resp"};
201 #ifndef VLINK_ENABLE_C_INTERFACE
212 inline DdstConf::DdstConf(
const std::string& _topic, int32_t _domain, int32_t _depth,
const std::string& _qos)
213 : topic(_topic), domain(_domain), depth(_depth), qos(_qos) {}
215 inline DdstConf::DdstConf(
const std::string& _topic, int32_t _domain,
const PropertiesMap& _qos_ext)
216 : topic(_topic), domain(_domain), qos_ext(_qos_ext) {}
219 return topic == conf.topic && domain == conf.domain && depth == conf.depth && qos == conf.qos &&
220 qos_ext == conf.qos_ext;
223 inline bool DdstConf::operator!=(
const DdstConf& conf)
const noexcept {
return !(*
this == conf); }
225 inline TransportType DdstConf::get_transport_type()
const {
return TransportType::kDdst; }
#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