131 explicit Protocol(
const std::string& address);
214 explicit Url(
const std::string& str);
267 [[nodiscard]]
const std::string&
get_str()
const;
301 [[nodiscard]]
bool is_valid()
const override;
404 static void global_init(uint16_t transport_enable_flags = 0);
448 std::unique_ptr<Conf> target_;
462inline Url::Url(
Url&& url) noexcept : protocol_(std::move(url.protocol_)), target_(std::move(url.target_)) {}
471 protocol_ = url.protocol_;
483 protocol_ = std::move(url.protocol_);
484 target_ = std::move(url.target_);
489inline const std::string&
Url::get_str()
const {
return protocol_.str; }
510 return target_->is_valid();
518 return target_->get_impl_type();
526 return target_->get_transport_type();
530 if (transport_enable_flags == 0) {
534 (void)transport_enable_flags;
538#ifndef VLINK_ENABLE_C_INTERFACE
540#ifdef VLINK_SUPPORT_INTRA
542 IntraConf::global_init();
546#ifdef VLINK_SUPPORT_SHM
548 ShmConf::global_init();
552#ifdef VLINK_SUPPORT_SHM2
554 Shm2Conf::global_init();
558#ifdef VLINK_SUPPORT_ZENOH
560 ZenohConf::global_init();
564#ifdef VLINK_SUPPORT_DDS
566 DdsConf::global_init();
570#ifdef VLINK_SUPPORT_DDSC
572 DdscConf::global_init();
576#ifdef VLINK_SUPPORT_DDSR
578 DdsrConf::global_init();
582#ifdef VLINK_SUPPORT_DDST
584 DdstConf::global_init();
588#ifdef VLINK_SUPPORT_SOMEIP
590 SomeipConf::global_init();
594#ifdef VLINK_SUPPORT_MQTT
596 MqttConf::global_init();
600#ifdef VLINK_SUPPORT_FDBUS
602 FdbusConf::global_init();
606#ifdef VLINK_SUPPORT_QNX
608 QnxConf::global_init();
618#ifdef VLINK_SUPPORT_INTRA
622#ifdef VLINK_SUPPORT_SHM
626#ifdef VLINK_SUPPORT_SHM2
630#ifdef VLINK_SUPPORT_ZENOH
634#ifdef VLINK_SUPPORT_DDS
638#ifdef VLINK_SUPPORT_DDSC
642#ifdef VLINK_SUPPORT_DDSR
646#ifdef VLINK_SUPPORT_DDST
650#ifdef VLINK_SUPPORT_SOMEIP
654#ifdef VLINK_SUPPORT_MQTT
658#ifdef VLINK_SUPPORT_FDBUS
662#ifdef VLINK_SUPPORT_QNX
676#ifdef VLINK_SUPPORT_INTRA
678 target = std::make_unique<IntraConf>();
682#ifdef VLINK_SUPPORT_SHM
684 target = std::make_unique<ShmConf>();
688#ifdef VLINK_SUPPORT_SHM2
690 target = std::make_unique<Shm2Conf>();
694#ifdef VLINK_SUPPORT_ZENOH
696 target = std::make_unique<ZenohConf>();
700#ifdef VLINK_SUPPORT_DDS
702 target = std::make_unique<DdsConf>();
706#ifdef VLINK_SUPPORT_DDSC
708 target = std::make_unique<DdscConf>();
712#ifdef VLINK_SUPPORT_DDSR
714 target = std::make_unique<DdsrConf>();
718#ifdef VLINK_SUPPORT_DDST
720 target = std::make_unique<DdstConf>();
724#ifdef VLINK_SUPPORT_SOMEIP
726 target = std::make_unique<SomeipConf>();
730#ifdef VLINK_SUPPORT_MQTT
732 target = std::make_unique<MqttConf>();
736#ifdef VLINK_SUPPORT_FDBUS
738 target = std::make_unique<FdbusConf>();
742#ifdef VLINK_SUPPORT_QNX
744 target = std::make_unique<QnxConf>();
758 CLOG_F(
"Unsupported url[%s].", protocol.
str.c_str());
767 return target_->create_server();
775 return target_->create_client();
783 return target_->create_publisher();
791 return target_->create_subscriber();
799 return target_->create_setter();
807 return target_->create_getter();
static void global_init()
Initialises process-wide VLink singletons.
Abstract base class for all transport-specific client (RPC caller) implementations.
Abstract transport configuration base class and associated helper macros.
#define VLINK_DECLARE_CONF_FRIEND()
Macro Definitions.
Definition conf.h:199
Transport configuration for the dds:// Fast-DDS RTPS backend.
Transport configuration for the ddsc:// CycloneDDS backend.
Transport configuration for the ddsr:// RTI Connext DDS backend.
Transport configuration for the ddst:// TravoDDS backend.
Transport configuration for the fdbus:// FDBus IPC backend.
Abstract base class for all transport-specific getter (field reader) implementations.
Transport configuration for the intra:// in-process messaging backend.
Global singleton logger with three output styles and pluggable backends.
#define CLOG_F(...)
Definition logger.h:868
#define VUNLIKELY(...)
Shorthand alias for VLINK_UNLIKELY. Hints that the expression is unlikely true.
Definition macros.h:302
#define VLINK_EXPORT
Definition macros.h:85
Transport configuration for the mqtt:// MQTT protocol backend.
TransportType
Enumeration of all supported transport backends.
Definition types.h:107
@ kShm2
Iceoryx2 shared memory (shm2://).
Definition types.h:111
@ kSomeip
SOME/IP via vsomeip (someip://).
Definition types.h:117
@ kUnknown
Unknown or unsupported transport.
Definition types.h:108
@ kMqtt
MQTT (mqtt://).
Definition types.h:118
@ kZenoh
Zenoh publish/subscribe (zenoh://).
Definition types.h:112
@ kDds
Fast-DDS RTPS (dds://).
Definition types.h:113
@ kDdsc
CycloneDDS (ddsc://).
Definition types.h:114
@ kQnx
QNX IPC (qnx://; QNX only).
Definition types.h:120
@ kIntra
In-process queue (intra://).
Definition types.h:109
@ kDdsr
RTI DDS (ddsr://).
Definition types.h:115
@ kDdst
TravoDDS (ddst://).
Definition types.h:116
@ kShm
Iceoryx shared memory (shm://).
Definition types.h:110
@ kFdbus
FDBus IPC (fdbus://).
Definition types.h:119
ImplType
Bitmask identifying the role of a VLink node implementation.
Definition types.h:89
@ kGetter
Field getter (retrieve latest value).
Definition types.h:96
@ kSubscriber
Event subscriber (receive broadcast).
Definition types.h:94
@ kClient
Method client (RPC caller).
Definition types.h:92
@ kSetter
Field setter (update latest value).
Definition types.h:95
@ kPublisher
Event publisher (N-to-N broadcast).
Definition types.h:93
@ kUnknownImplType
Type not yet determined.
Definition types.h:90
@ kServer
Method server (RPC responder).
Definition types.h:91
Abstract base class for all transport-specific publisher implementations.
Transport configuration for the qnx:// QNX IPC backend.
Abstract base class for all transport-specific server (RPC responder) implementations.
Abstract base class for all transport-specific setter (field writer) implementations.
Transport configuration for the shm2:// Iceoryx2 shared-memory backend.
Transport configuration for the shm:// Iceoryx shared-memory backend.
Transport configuration for the someip:// SOME/IP (vsomeip) backend.
virtual bool parse_protocol(struct Protocol *protocol)
friend struct Url
Definition conf.h:164
virtual std::unique_ptr< class GetterImpl > create_getter() const
virtual std::unique_ptr< class PublisherImpl > create_publisher() const
virtual std::unique_ptr< class SetterImpl > create_setter() const
virtual bool parse(ImplType impl_type) const
Validates the conf for the given node role and caches the type.
virtual std::unique_ptr< class ServerImpl > create_server() const
virtual std::unique_ptr< class ClientImpl > create_client() const
virtual std::unique_ptr< class SubscriberImpl > create_subscriber() const
Parsed URL components used to select and configure a transport Conf.
Definition url.h:121
TransportType transport
Resolved transport backend.
Definition url.h:123
friend struct Url
Definition url.h:130
std::string str
Canonical URL string (post-remap).
Definition url.h:122
std::map< std::string, std::string > dictionary
Parsed query key-value pairs.
Definition url.h:126
std::string fragment
Fragment identifier (after #).
Definition url.h:127
std::string host
Hostname or IP address component.
Definition url.h:124
std::string path
Topic path component.
Definition url.h:125
URL-based Conf dispatcher that routes to the correct transport backend.
Definition url.h:161
static VLINK_EXPORT int get_sort_index(std::string_view url)
Returns a numeric sort index for the transport backend used by a URL.
Url(const std::string &str)
Constructs a Url from a transport address string.
Definition url.h:457
static VLINK_EXPORT bool is_intra_type(std::string_view url)
Returns true if the URL uses the intra:// in-process transport.
bool is_valid() const override
Returns true if the underlying target_ Conf is valid.
Definition url.h:505
TransportEnableFlag
Bitmask controlling which transport backends are active at runtime.
Definition url.h:187
@ kEnableShm2
Enable shm2:// (Iceoryx2) transport.
Definition url.h:191
@ kEnableZenoh
Enable zenoh:// transport.
Definition url.h:192
@ kEnableDds
Enable dds:// (Fast-DDS) transport.
Definition url.h:193
@ kEnableShm
Enable shm:// (Iceoryx) transport.
Definition url.h:190
@ kEnableDdsc
Enable ddsc:// (CycloneDDS) transport.
Definition url.h:194
@ kEnableDdst
Enable ddst:// (TravoDDS) transport.
Definition url.h:196
@ kEnableMqtt
Enable mqtt:// transport.
Definition url.h:198
@ kEnableSomeip
Enable someip:// transport.
Definition url.h:197
@ kEnableDdsr
Enable ddsr:// (RTI DDS) transport.
Definition url.h:195
@ kEnableFdbus
Enable fdbus:// transport.
Definition url.h:199
@ kEnableEmpty
No transport enabled.
Definition url.h:188
@ kEnableQnx
Enable qnx:// transport (QNX only).
Definition url.h:200
@ kEnableIntra
Enable intra:// transport.
Definition url.h:189
@ kEnableAll
Enable all transports.
Definition url.h:201
~Url() override
Destructor.
static VLINK_EXPORT void init_plugins(uint16_t transport_enable_flags=0)
Loads and registers ConfPluginInterface plugins for the enabled transports.
VLINK_EXPORT friend std::ostream & operator<<(std::ostream &ostream, const Url &conf) noexcept
static VLINK_EXPORT std::unique_ptr< Conf > load_for_plugin(TransportType type)
Searches loaded plugins for a Conf factory matching type.
static VLINK_EXPORT bool is_local_type(std::string_view url)
Returns true if the URL refers to a local (same-machine) transport.
static void init_target_internal(const Protocol &protocol, std::unique_ptr< Conf > &target)
Creates the target_ Conf for a given Protocol.
Definition url.h:669
static uint16_t get_transport_enable_flags()
Returns a bitmask of all compile-time-enabled transport backends.
Definition url.h:615
ImplType get_impl_type() const override
Returns the ImplType resolved by the underlying target_ Conf.
Definition url.h:513
const std::string & get_str() const
Returns the original (or remapped) URL string.
Definition url.h:489
bool parse(ImplType impl_type) const override
Parses the URL for the given node type, delegating to target_.
Definition url.h:493
Url & operator=(const Url &url)
Copy-assignment operator.
Definition url.h:466
TransportType get_transport_type() const override
Returns the transport backend resolved from the URL.
Definition url.h:521
static void global_init(uint16_t transport_enable_flags=0)
Initialises the global state for all enabled transport backends.
Definition url.h:529
const Conf * get_target() const
Returns a pointer to the underlying transport Conf, or nullptr.
Definition url.h:491
static VLINK_EXPORT bool is_shm_type(std::string_view url)
Returns true if the URL uses a shared-memory transport (shm:// or shm2://).
Abstract base class for all transport-specific subscriber implementations.
Transport configuration for the zenoh:// Zenoh protocol backend.