VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
url.h 文件参考

URL-based transport configuration dispatcher for VLink nodes. 更多...

#include <map>
#include <memory>
#include <string>
#include <utility>
#include "../base/logger.h"
#include "./conf.h"
#include "../modules/dds_conf.h"
#include "../modules/ddsc_conf.h"
#include "../modules/ddsr_conf.h"
#include "../modules/ddst_conf.h"
#include "../modules/fdbus_conf.h"
#include "../modules/intra_conf.h"
#include "../modules/mqtt_conf.h"
#include "../modules/qnx_conf.h"
#include "../modules/shm2_conf.h"
#include "../modules/shm_conf.h"
#include "../modules/someip_conf.h"
#include "../modules/zenoh_conf.h"
#include "./client_impl.h"
#include "./getter_impl.h"
#include "./publisher_impl.h"
#include "./server_impl.h"
#include "./setter_impl.h"
#include "./subscriber_impl.h"
url.h 的引用(Include)关系图:
此图展示该文件被哪些文件直接或间接地引用了:

浏览该文件的源代码.

 Parsed URL components used to select and configure a transport Conf. 更多...
 URL-based Conf dispatcher that routes to the correct transport backend. 更多...

命名空间

详细描述

URL-based transport configuration dispatcher for VLink nodes.

This header provides two types that together implement the "one API, multiple transports" core promise of VLink:

Protocol
A plain-data struct that holds the parsed components of a VLink URL (transport, host, path, query dictionary, fragment). It is constructed from a URL string and is used by Url::init_target_internal() to select the correct Conf subclass. Protocol is only constructible by Url (private constructor, friend struct Url).
Url
A concrete Conf subclass that wraps a Protocol and delegates all Conf virtual methods to the underlying transport Conf (target_). On construction it calls init_target_internal() which selects the correct *Conf class based on the transport prefix in the URL and compile-time feature flags.
Transport Selection at Construction
Url url("dds://vehicle/speed?domain_id=1");
// Internally creates a DdsConf and calls:
// url.parse(kSubscriber) -> target_->parse(kSubscriber)
// url.create_subscriber() -> target_->create_subscriber()
URL Remapping
When the VLINK_URL_USE_REMAP preprocessor flag is set, the Protocol constructor checks the VLINK_URL_REMAP environment variable and rewrites the URL before transport detection, enabling zero-code transport switching.
Dynamic Plugin Transport Loading
When the VLINK_URL_USE_PLUGIN flag is set, Url::load_for_plugin() searches dynamically loaded ConfPluginInterface plugins (from VLINK_URL_PLUGINS env var) for a matching transport when built-in transports are not found.
Transport Enable Flags
The TransportEnableFlag bitmask controls which transports are initialised via global_init() and init_plugins(). This allows embedding environments (e.g. Android, QNX) to exclude unsupported transports at runtime.
注解
This file includes all *_conf.h module headers and all *_impl.h headers. It is the single aggregation point for the VLink transport abstraction layer.