swift
Classes | Public Member Functions | Protected Member Functions | List of all members
swift::core::CPluginManagerSimulator Class Reference

Manages plugins for the simulator context. More...

Inheritance diagram for swift::core::CPluginManagerSimulator:
[legend]

Public Member Functions

 CPluginManagerSimulator (QObject *parent=nullptr)
 Ctor.
 
ISimulatorFactorygetFactory (const QString &pluginId)
 Get simulator factory from the plugin.
 
ISimulatorListenercreateListener (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.
 
ISimulatorListenergetListener (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...
 
- Public Member Functions inherited from swift::core::IPluginManager
 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...
 
- Protected Member Functions inherited from swift::core::IPluginManager
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.
 

Detailed Description

Manages plugins for the simulator context.

Definition at line 27 of file pluginmanagersimulator.h.

Member Function Documentation

◆ acceptedIids()

CSequence< QString > swift::core::CPluginManagerSimulator::acceptedIids ( ) const
protectedvirtual

Returns the list of valid IIDs for the implementation.

Implements swift::core::IPluginManager.

Definition at line 94 of file pluginmanagersimulator.cpp.

◆ collectPlugins()

void swift::core::CPluginManagerSimulator::collectPlugins ( )
virtual

Looks for all available plugins.

Reimplemented from swift::core::IPluginManager.

Definition at line 78 of file pluginmanagersimulator.cpp.

◆ pluginDirectory()

const QString & swift::core::CPluginManagerSimulator::pluginDirectory ( ) const
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.


The documentation for this class was generated from the following files: