dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
Registry.hpp
1// SPDX-FileCopyrightText: 2026 Vincent Leroy
2// SPDX-License-Identifier: MIT
3//
4// This file is part of dfx.
5//
6// Licensed under the MIT License. See the LICENSE file in the project root
7// for full license information.
8
9#pragma once
10
11// Standard includes
12#include <unordered_map>
13
14// Project includes
15#include "Plugin.hpp"
16#include <dfx-graph/TransportFactory.hpp>
17#include <dfx-graph/NodeFactory.hpp>
19#include <dfx-utilities/FileSystem.hpp>
20#include <dfx-utilities/SystemConfig.hpp>
21
22namespace dfx::Plugins
23{
33{
34public:
42 explicit Registry(Utils::SystemConfig & sysConfig);
43
46
58 Graph::TransportFactory & transportFactory);
59
60private:
61 void _validatePluginInfoConfig();
62
63 void _discoverPluginsAt(fs::path const & path, bool recursive);
64
65 void _registerTransportBuilder(Graph::TransportFactory & factory,
66 Plugin * plugin, std::string scheme,
67 dfx_transport_interface_t const * interface, size_t interfaceSize);
68 void _registerNodeBuilder(Graph::NodeFactory & factory,
69 Plugin * plugin, std::string type,
70 std::string rawNodeMetadata, std::string rawConfigSchema,
71 dfx_node_interface_t const * interface, size_t interfaceSize);
72
73 nlohmann::json _getConfigOfPlugin(Plugin const & plugin) const;
74
75private:
76 std::vector<std::string> _searchPath;
77 std::unordered_map<std::string, PluginPtr> _plugins;
78 nlohmann::json _pluginInfos;
79 fs::path _configBasePath;
80};
81} // !namespace dfx::Plugins
82
Convenience macros to explicitly control copy and move semantics.
Runtime node instantiation and validation facility (builders + config/metadata schemas).
Definition NodeFactory.hpp:60
Registry and factory for creating Source and Destination transports.
Definition TransportFactory.hpp:40
Manager for a loaded plugin shared library.
Definition Plugin.hpp:38
DFX_DISABLE_COPY_AND_MOVE(Registry)
Non-copyable and non-movable to maintain registry integrity.
Registry(Utils::SystemConfig &sysConfig)
Constructs the registry and performs initial plugin discovery.
void loadAllPlugins(Graph::NodeFactory &nodeFactory, Graph::TransportFactory &transportFactory)
Loads and initializes all plugins that passed the discovery phase.
System configuration registry with typed values, entry metadata, and change callbacks.
Definition SystemConfig.hpp:84
Definition MessageApi.hpp:16
The vtable that a plugin must implement to define a Node.
Definition PluginInterface.h:719
The Transport Plugin Interface.
Definition PluginInterface.h:781