VLink  2.0.0
A high-performance communication middleware
conf_plugin_interface.h File Reference

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

#include <memory>
#include "../base/plugin.h"
#include "./conf.h"
Include dependency graph for conf_plugin_interface.h:

Go to the source code of this file.

Classes

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

Namespaces

 

Detailed Description

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 discovered by the URL layer when Url::init_plugins() reads VLINK_URL_PLUGINS. 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.

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
+-----------+ +--------------+ +-----------------+
| Url::ctor | -------> | init_plugins | -------> | dlopen library |
+-----------+ +------+-------+ +--------+--------+
| |
| v
| +-----------------------+
| | Plugin::create_object |
| +-----------+-----------+
| |
v v
+----------------+ +------------------+
| load_for_plugin| -------> | plugin->create() |
+----------------+ +--------+---------+
|
v
+-------------+
| unique<Conf>|
+-------------+
Loading constraints
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. 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 plugin interface can be used.
Note
Implementations must remain stateless because create() may be invoked repeatedly to serve several independent Url instances.