|
QtCanpool 3.3.0
|
Discovers, orders, loads and isolates QtCanpool plugins. 更多...
#include <qxplugin/qxpluginmanager.h>

Public 成员函数 | |
| QxPluginManager (QObject *parent=Q_NULLPTR) | |
| ~QxPluginManager () override | |
| void | setPluginPaths (const QStringList &paths) |
| QStringList | pluginPaths () const |
| void | setDisabledPlugins (const QStringList &ids) |
| Ids that never start, whatever their metadata says. | |
| QStringList | disabledPlugins () const |
| void | setEnabledPlugins (const QStringList &ids) |
| Ids to start even though their metadata says EnabledByDefault is false. | |
| QStringList | enabledPlugins () const |
| void | setRequiredInterfaceVersion (int version) |
| Minimum interface version a plugin must report to be accepted (default 1). | |
| int | requiredInterfaceVersion () const |
| void | setHostVersion (const QVersionNumber &version) |
| The host version plugins must be compatible with; accept-all until set. | |
| QVersionNumber | hostVersion () const |
| bool | hasHostVersion () const |
| void | setContext (QxPluginContext *context) |
| The context handed to every plugin's initialize(); set before loadPlugins(). | |
| QxPluginContext * | context () const |
| void | loadPlugins () |
| Scans the paths (or the registered static plugins), resolves dependencies and loads in order. | |
| void | shutdown () |
| Calls shutdown() on every initialized plugin, in reverse initialization order. | |
| void | registerStaticPlugin (const QString &key, const QJsonObject &metaData, std::function< QxPlugin *()> factory) |
| Static-build entry (WASM / QTC_STATIC_BUILD): register a pre-built instance factory. | |
| QList< QxPluginSpec * > | specs () const |
| All specs in dependency order (the order loadPlugins() would load them). | |
| QList< QxPluginSpec * > | allSpecs () const |
| Every plugin the manager knows about, in discovery order (the static ones first, then the dynamic ones as they were found) - including the ones specs() leaves out: switched off, skipped by default, unresolved or failed. | |
| QxPluginSpec * | spec (const QString &id) const |
| QxPlugin * | plugin (const QString &id) const |
| bool | hasError () const |
| True when at least one plugin failed (load or initialize). | |
| QString | errorString () const |
| Every failure joined once, each prefixed by its plugin id. | |
| void | pluginInitialized (QxPluginSpec *spec) |
| A plugin reached the Initialized state. | |
| void | pluginFailed (QxPluginSpec *spec, const QString &reason) |
| A plugin was set aside; reason is the same string spec()->error() holds. | |
Discovers, orders, loads and isolates QtCanpool plugins.
Workflow:
Dynamic plugins are found through QPluginLoader; static builds (incl. WASM, K17) use registerStaticPlugin() instead and share the exact same resolution, ordering and failure-isolation logic.
在文件 qxpluginmanager.h 第 39 行定义.
|
explicit |
在文件 qxpluginmanager.cpp 第 329 行定义.
|
override |
在文件 qxpluginmanager.cpp 第 333 行定义.
| QList< QxPluginSpec * > QxPlugin::QxPluginManager::allSpecs | ( | ) | const |
Every plugin the manager knows about, in discovery order (the static ones first, then the dynamic ones as they were found) - including the ones specs() leaves out: switched off, skipped by default, unresolved or failed.
This is the list a manager UI shows, because a plugin that did not start is exactly the one someone opens that UI to look at.
在文件 qxpluginmanager.cpp 第 539 行定义.
| QxPluginContext * QxPlugin::QxPluginManager::context | ( | ) | const |
在文件 qxpluginmanager.cpp 第 417 行定义.
| QStringList QxPlugin::QxPluginManager::disabledPlugins | ( | ) | const |
在文件 qxpluginmanager.cpp 第 362 行定义.
| QStringList QxPlugin::QxPluginManager::enabledPlugins | ( | ) | const |
在文件 qxpluginmanager.cpp 第 374 行定义.
| QString QxPlugin::QxPluginManager::errorString | ( | ) | const |
Every failure joined once, each prefixed by its plugin id.
在文件 qxpluginmanager.cpp 第 570 行定义.
| bool QxPlugin::QxPluginManager::hasError | ( | ) | const |
True when at least one plugin failed (load or initialize).
Skips-by-default do not count.
在文件 qxpluginmanager.cpp 第 564 行定义.
| bool QxPlugin::QxPluginManager::hasHostVersion | ( | ) | const |
在文件 qxpluginmanager.cpp 第 405 行定义.
| QVersionNumber QxPlugin::QxPluginManager::hostVersion | ( | ) | const |
在文件 qxpluginmanager.cpp 第 399 行定义.
| void QxPlugin::QxPluginManager::loadPlugins | ( | ) |
Scans the paths (or the registered static plugins), resolves dependencies and loads in order.
在文件 qxpluginmanager.cpp 第 434 行定义.
| QxPlugin * QxPlugin::QxPluginManager::plugin | ( | const QString & | id | ) | const |
在文件 qxpluginmanager.cpp 第 557 行定义.
| void QxPlugin::QxPluginManager::pluginFailed | ( | QxPluginSpec * | spec, |
| const QString & | reason | ||
| ) |
A plugin was set aside; reason is the same string spec()->error() holds.
| void QxPlugin::QxPluginManager::pluginInitialized | ( | QxPluginSpec * | spec | ) |
A plugin reached the Initialized state.
| QStringList QxPlugin::QxPluginManager::pluginPaths | ( | ) | const |
在文件 qxpluginmanager.cpp 第 350 行定义.
| void QxPlugin::QxPluginManager::registerStaticPlugin | ( | const QString & | key, |
| const QJsonObject & | metaData, | ||
| std::function< QxPlugin *()> | factory | ||
| ) |
Static-build entry (WASM / QTC_STATIC_BUILD): register a pre-built instance factory.
在文件 qxpluginmanager.cpp 第 423 行定义.
| int QxPlugin::QxPluginManager::requiredInterfaceVersion | ( | ) | const |
在文件 qxpluginmanager.cpp 第 386 行定义.
| void QxPlugin::QxPluginManager::setContext | ( | QxPluginContext * | context | ) |
The context handed to every plugin's initialize(); set before loadPlugins().
在文件 qxpluginmanager.cpp 第 411 行定义.
| void QxPlugin::QxPluginManager::setDisabledPlugins | ( | const QStringList & | ids | ) |
Ids that never start, whatever their metadata says.
Wins over the enable list.
在文件 qxpluginmanager.cpp 第 356 行定义.
| void QxPlugin::QxPluginManager::setEnabledPlugins | ( | const QStringList & | ids | ) |
Ids to start even though their metadata says EnabledByDefault is false.
Writing both lists is a contradiction the caller is expected to avoid; when it happens the disabled list wins and the plugin stays off.
在文件 qxpluginmanager.cpp 第 368 行定义.
| void QxPlugin::QxPluginManager::setHostVersion | ( | const QVersionNumber & | version | ) |
The host version plugins must be compatible with; accept-all until set.
在文件 qxpluginmanager.cpp 第 392 行定义.
| void QxPlugin::QxPluginManager::setPluginPaths | ( | const QStringList & | paths | ) |
在文件 qxpluginmanager.cpp 第 344 行定义.
| void QxPlugin::QxPluginManager::setRequiredInterfaceVersion | ( | int | version | ) |
Minimum interface version a plugin must report to be accepted (default 1).
在文件 qxpluginmanager.cpp 第 380 行定义.
| void QxPlugin::QxPluginManager::shutdown | ( | ) |
Calls shutdown() on every initialized plugin, in reverse initialization order.
在文件 qxpluginmanager.cpp 第 519 行定义.
| QxPluginSpec * QxPlugin::QxPluginManager::spec | ( | const QString & | id | ) | const |
在文件 qxpluginmanager.cpp 第 551 行定义.
| QList< QxPluginSpec * > QxPlugin::QxPluginManager::specs | ( | ) | const |
All specs in dependency order (the order loadPlugins() would load them).
在文件 qxpluginmanager.cpp 第 533 行定义.