VLink  2.1.0
A high-performance communication middleware
conf_plugin_interface.h 文件参考

Stable ABI implemented by transport plugins that ship a Conf factory. 更多...

#include <memory>
#include "../base/plugin.h"
#include "./conf.h"
conf_plugin_interface.h 的引用(Include)关系图:

浏览源代码.

struct  vlink::ConfPluginInterface
 Stateless factory contract that external recognized-transport plugins must implement. 更多...
 

命名空间

 

详细描述

Stable ABI implemented by transport plugins that ship a Conf factory.

This is an internal implementation header used by the URL routing layer and by out-of-tree plugins for recognized transport backends; it is not part of the public application API. External plugins are shared libraries made available according to the process-wide VLINK_URL_PLUGINS value: an explicit module list is preloaded, while a complete value of auto (case-insensitive) enables first-use loading of the fixed library for a recognized transport. An empty value or the case-insensitive value none disables plugin loading. Each plugin exports exactly one concrete subclass of ConfPluginInterface; the runtime asks it for its existing TransportType and uses create() to obtain a fresh Conf instance when a URL with that transport is constructed. The complete setting is sampled once when the process-wide plugin manager is initialized.

Plugin contract
Member Required Description
VLINK_PLUGIN_REGISTER(iface) Yes Tags the interface with a stable plugin id.
VLINK_PLUGIN_DECLARE(...) Yes (in .cc) Exports the create / destroy plugin entry points.
get_transport_type() const Override Reports the TransportType the plugin handles.
create() const Override Allocates a new transport Conf instance.
Lifecycle
first Url/plugin use -> sample VLINK_URL_PLUGINS
| | |
| list | auto | empty / none
v v v
explicit first-use load disabled
preload vlink-<module>
| |
+-----> validate type -> registry -> plugin->create()
|
v
unique_ptr<Conf>
Loading constraints
In list mode, VLINK_URL_PLUGINS accepts recognized transport module names, not arbitrary plugin names. For example, zenoh maps to the fixed library base name vlink-zenoh and to the existing TransportType::kZenoh. The on-demand path derives the same fixed name and is enabled only when the entire sampled value equals auto, ignoring case. Mode values cannot be combined with an explicit list. Unknown module names are rejected before Plugin::load() is called, linked transports take precedence over plugins, and TransportType::kUnknown is never dispatched to this interface. New URL schemes therefore require core enum, URL mapping, and backend creation support before this interface can be used.
注解
Implementations must remain stateless because create() may be invoked repeatedly to serve several independent Url instances.