Continues migration with DDS, Common

This commit is contained in:
torsten committed 2026-07-17 12:41:42 +02:00
1 parent 9b15cee841
commit fa48db111e
668 files changed
+111841 -2

No files matched your search

+85
View File
@@ -0,0 +1,85 @@
#pragma once
#define PLUGIN_LOADER_VERSION 3
#include <qglobal.h>
#include <functional>
#include <QMap>
#include <QPair>
#ifndef LTSPLUGINLOADER_EXPORT
# ifdef BUILD_STATIC_LIBRARIES
# define LTSPLUGINLOADER_EXPORT
# else
# if defined(MAKE_LTSPLUGINLOADER_LIB)
# define LTSPLUGINLOADER_EXPORT Q_DECL_EXPORT
# else
# define LTSPLUGINLOADER_EXPORT Q_DECL_IMPORT
# endif
# endif
#endif
class QObject;
class QPluginLoader;
namespace LtsAppDescriptor
{
struct AppDescription;
}
namespace LtsPluginManager
{
enum class PluginType
{
UNKNOWN = 0,
DATA,
GUI,
TOPIC_TYPE,
PROJECT,
STYLE,
SPECIAL,
};
struct PluginInstance
{
QString pluginName;
QString fullFileName;
QString fileName;
QObject *plugin = nullptr;
QPluginLoader *pluginLoader = nullptr;
};
class LTSPLUGINLOADER_EXPORT LtsPluginLoader
{
public:
static LtsPluginLoader *getInstance();
void unloadAllPlugins();
void checkPlugins(const QVector<LtsAppDescriptor::AppDescription> &appVector,
QStringList &errors );
bool loadPlugins(PluginType requestedPluginType,
const std::function<bool(const PluginInstance &pluginInstance)> &loadPlugin,
const QStringList &requiredPlugins = QStringList(),
const QString &specialTopicTypeFilter = QString(),
const QStringList &optionalPlugins = QStringList());
typedef QPair<PluginType, QString> PluginKey;
private:
friend struct LtsPluginLoaderHandler;
LtsPluginLoader() = default;
~LtsPluginLoader();
QMap<PluginKey, PluginInstance> m_loadedPlugins;
};
}