41 , plugin_providers_(plugin_providers)
65 QList<PluginDescriptor*> descriptors;
68 QList<PluginDescriptor*> sub_descriptors;
71 sub_descriptors = (*it)->discover_descriptors(discovery_data);
73 catch (std::runtime_error e)
76 qCritical(
"CompositePluginProvider::discover() could not discover plugins from provider - runtime_error:\n%s", e.what());
82 qCritical(
"CompositePluginProvider::discover() could not discover plugins from provider");
86 QSet<QString> plugin_ids;
87 for (QList<PluginDescriptor*>::iterator jt = sub_descriptors.begin(); jt != sub_descriptors.end(); jt++)
90 descriptors.append(descriptor);
91 plugin_ids.insert(descriptor->
pluginId());
103 if (it.value().contains(plugin_id))
108 void* instance = plugin_provider->
load(plugin_id, plugin_context);
112 catch (std::exception& e)
114 qWarning(
"CompositePluginProvider::load(%s) failed loading plugin (%s)", plugin_id.toStdString().c_str(), e.what());
127 if (it.value().contains(plugin_id))
136 catch (std::exception& e)
148 QMap<void*, PluginProvider*>::iterator it =
running_plugins_.find(plugin_instance);
151 (*it)->unload(plugin_instance);
155 throw std::runtime_error(
"plugin_instance not found");
virtual Plugin * load_plugin(const QString &plugin_id, PluginContext *plugin_context)
CompositePluginProvider(const QList< PluginProvider * > &plugin_providers=QList< PluginProvider * >())
const QString & pluginId() const
QMap< void *, PluginProvider * > running_plugins_
QMap< PluginProvider *, QSet< QString > > discovered_plugins_
virtual void unload(void *plugin_instance)
virtual void * load(const QString &plugin_id, PluginContext *plugin_context)
virtual void * load(const QString &plugin_id, PluginContext *plugin_context)
QList< PluginProvider * > plugin_providers_
virtual void set_plugin_providers(const QList< PluginProvider * > &plugin_providers)
virtual ~CompositePluginProvider()
virtual QList< PluginDescriptor * > discover_descriptors(QObject *discovery_data)
virtual Plugin * load_plugin(const QString &plugin_id, PluginContext *plugin_context)