|
🛰️航天仿真算法库 SpaceAST 0.4.0
|
#include <PluginRegistry.hpp>
Public 成员函数 | |
| errc_t | scanDirectory (StringView dir, StringView namePrefix=StringView()) |
| errc_t | scanDirectory (StringView dir, Span< const StringView > namePrefixes) |
| PluginInstance * | find (StringView iid, StringView key) |
| template<class IFace > | |
| IFace * | find (StringView key) |
| void | keys (StringView iid, std::vector< std::string > &keys) const |
| std::vector< std::string > | keys (StringView iid) const |
| template<class IFace > | |
| std::vector< std::string > | keys () const |
| template<class IFace > | |
| void | keys (std::vector< std::string > &keys) const |
| size_t | pluginCount () const |
| size_t | entryCount () const |
| void | clear () |
静态 Public 成员函数 | |
| static PluginRegistry * | Instance () |
插件注册表(进程级单例)
维护 (接口 ID, 索引键) → 插件库 的索引,已成功加载的插件库将常驻进程
| void ast::PluginRegistry::clear | ( | ) |
清空索引
| PluginInstance * ast::PluginRegistry::find | ( | StringView | iid, |
| StringView | key ) |
按 (接口 ID, 索引键) 查找插件根对象
| errc_t ast::PluginRegistry::scanDirectory | ( | StringView | dir, |
| Span< const StringView > | namePrefixes ) |
扫描目录并建立索引,只处理文件名以任一前缀开头的库
| dir | 目录路径 |
| namePrefixes | 前缀列表;为空表示不筛选。不持有视图指向的存储,调用期间需保持有效 |
| errc_t ast::PluginRegistry::scanDirectory | ( | StringView | dir, |
| StringView | namePrefix = StringView() ) |
扫描目录并建立索引
| dir | 目录路径 |
| namePrefix | 只处理文件名以此前缀开头的库;为空表示不筛选 |