swift
|
Manages plugins for the simulator context. More...
Public Member Functions | |
CPluginManagerSimulator (QObject *parent=nullptr) | |
Ctor. | |
ISimulatorFactory * | getFactory (const QString &pluginId) |
Get simulator factory from the plugin. | |
ISimulatorListener * | createListener (const QString &pluginId) |
Create simulator listener from the plugin In case one is existing already, it is returned instead. Returns nullptr if no listener could be created. | |
ISimulatorListener * | getListener (const QString &pluginId) |
Get previously created simulator listener from the plugin Returns nullptr if listener is not yet created. | |
swift::misc::simulation::CSimulatorPluginInfoList | getAvailableSimulatorPlugins () const |
Get all simulator driver plugins. | |
int | checkAvailableListeners () |
Check if simulator is connected. | |
virtual void | collectPlugins () |
Looks for all available plugins. More... | |
![]() | |
IPluginManager (QObject *parent=nullptr) | |
Constructor. | |
QString | getPluginConfigId (const QString &identifier) |
If the plugin specifies its config plugin, its identifier can be obtained using this method. You can get the plugin config instance later, using getPluginById() . | |
template<class T > | |
T * | getPluginById (const QString &identifier) |
Loads the given plugin (if necessary), casts it to the desired type and returns its instance. Returns nullptr on failure. | |
Protected Member Functions | |
virtual swift::misc::CSequence< QString > | acceptedIids () const |
Returns the list of valid IIDs for the implementation. More... | |
virtual const QString & | pluginDirectory () const |
Where to look for plugins, absolute path. Default implementation returns plugins in the application dir. More... | |
![]() | |
virtual bool | isValid (const QJsonObject &metadata) const |
Defines whether the given plugin is valid or not, based on its metadata. The default implementation checks if all values common for all plugins (i.e. MetaData and identifier) are present and valid. It also checks if each plugin meets one of the specified in acceptedIids() IIDs. Override custom plugin validation in the subclass if needed. | |
QString | pluginIdentifier (const QJsonObject &metadata) const |
Gets the plugin identifier from the metadata. | |
QString | getIdByPlugin (const QObject *instance) const |
Gets plugin identifier by its instance. | |
const swift::misc::CSequence< QJsonObject > & | getPlugins () const |
Gets direct access to all plugins' metadata. | |
Manages plugins for the simulator context.
Definition at line 27 of file pluginmanagersimulator.h.
|
protectedvirtual |
Returns the list of valid IIDs for the implementation.
Implements swift::core::IPluginManager.
Definition at line 94 of file pluginmanagersimulator.cpp.
|
virtual |
Looks for all available plugins.
Reimplemented from swift::core::IPluginManager.
Definition at line 78 of file pluginmanagersimulator.cpp.
|
protectedvirtual |
Where to look for plugins, absolute path. Default implementation returns plugins
in the application dir.
Reimplemented from swift::core::IPluginManager.
Definition at line 100 of file pluginmanagersimulator.cpp.