2014-05-18 11:52:39 -04:00
|
|
|
#ifndef INCLUDE_PLUGINAPI_H
|
|
|
|
#define INCLUDE_PLUGINAPI_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2016-05-16 12:34:23 -04:00
|
|
|
#include <QList>
|
|
|
|
|
2018-03-20 08:49:21 -04:00
|
|
|
#include "export.h"
|
2017-11-01 15:06:33 -04:00
|
|
|
#include "plugin/plugininterface.h"
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2016-05-14 22:38:37 -04:00
|
|
|
class QString;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
class PluginManager;
|
2016-05-16 04:35:36 -04:00
|
|
|
class MessageQueue;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2018-03-03 14:23:38 -05:00
|
|
|
class SDRBASE_API PluginAPI : public QObject {
|
2014-05-18 11:52:39 -04:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-11-01 22:30:54 -04:00
|
|
|
struct SamplingDeviceRegistration //!< This is the device registration
|
|
|
|
{
|
2019-12-15 19:03:47 -05:00
|
|
|
QString m_deviceHardwareId;
|
2017-11-01 22:30:54 -04:00
|
|
|
QString m_deviceId;
|
|
|
|
PluginInterface* m_plugin;
|
2019-12-15 19:03:47 -05:00
|
|
|
SamplingDeviceRegistration(const QString& hardwareId, const QString& deviceId, PluginInterface* plugin) :
|
|
|
|
m_deviceHardwareId(hardwareId),
|
2017-11-01 22:30:54 -04:00
|
|
|
m_deviceId(deviceId),
|
|
|
|
m_plugin(plugin)
|
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef QList<SamplingDeviceRegistration> SamplingDeviceRegistrations;
|
|
|
|
|
2016-05-16 12:34:23 -04:00
|
|
|
struct ChannelRegistration
|
|
|
|
{
|
2017-11-22 19:19:32 -05:00
|
|
|
QString m_channelIdURI; //!< Channel type ID in URI form
|
|
|
|
QString m_channelId; //!< Channel type ID in short form from object name
|
2016-05-16 12:34:23 -04:00
|
|
|
PluginInterface* m_plugin;
|
2017-11-22 19:19:32 -05:00
|
|
|
ChannelRegistration(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin) :
|
|
|
|
m_channelIdURI(channelIdURI),
|
2017-11-01 08:03:12 -04:00
|
|
|
m_channelId(channelId),
|
2016-05-16 12:34:23 -04:00
|
|
|
m_plugin(plugin)
|
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef QList<ChannelRegistration> ChannelRegistrations;
|
|
|
|
|
2020-09-19 19:06:34 -04:00
|
|
|
struct FeatureRegistration
|
2020-09-08 10:47:20 -04:00
|
|
|
{
|
2020-09-19 19:06:34 -04:00
|
|
|
QString m_featureIdURI; //!< Feature type ID in URI form
|
|
|
|
QString m_featureId; //!< Feature type ID in short form from object name
|
|
|
|
PluginInterface *m_plugin;
|
|
|
|
FeatureRegistration(const QString& featureIdURI, const QString& featureId, PluginInterface* plugin) :
|
|
|
|
m_featureIdURI(featureIdURI),
|
|
|
|
m_featureId(featureId),
|
2020-09-08 10:47:20 -04:00
|
|
|
m_plugin(plugin)
|
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
2020-09-19 19:06:34 -04:00
|
|
|
typedef QList<FeatureRegistration> FeatureRegistrations;
|
2020-09-08 10:47:20 -04:00
|
|
|
|
2016-10-19 12:07:27 -04:00
|
|
|
// Rx Channel stuff
|
2017-11-22 19:19:32 -05:00
|
|
|
void registerRxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
|
2016-10-13 16:23:43 -04:00
|
|
|
ChannelRegistrations *getRxChannelRegistrations();
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2016-10-19 12:07:27 -04:00
|
|
|
// Tx Channel stuff
|
2017-11-22 19:19:32 -05:00
|
|
|
void registerTxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
|
2016-10-19 12:07:27 -04:00
|
|
|
ChannelRegistrations *getTxChannelRegistrations();
|
|
|
|
|
2019-09-02 12:36:56 -04:00
|
|
|
// MIMO Channel stuff
|
|
|
|
void registerMIMOChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
|
|
|
|
ChannelRegistrations *getMIMOChannelRegistrations();
|
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
// Sample Source stuff
|
|
|
|
void registerSampleSource(const QString& sourceName, PluginInterface* plugin);
|
|
|
|
|
2016-10-19 12:07:27 -04:00
|
|
|
// Sample Sink stuff
|
|
|
|
void registerSampleSink(const QString& sinkName, PluginInterface* plugin);
|
|
|
|
|
2019-05-18 00:30:37 -04:00
|
|
|
// Sample MIMO stuff
|
|
|
|
void registerSampleMIMO(const QString& sinkName, PluginInterface* plugin);
|
|
|
|
|
2020-09-19 19:06:34 -04:00
|
|
|
// Feature stuff
|
|
|
|
void registerFeature(const QString& featureIdURI, const QString& featureId, PluginInterface* plugin);
|
|
|
|
FeatureRegistrations *getFeatureRegistrations();
|
2020-09-08 10:47:20 -04:00
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
protected:
|
|
|
|
PluginManager* m_pluginManager;
|
|
|
|
|
2017-10-24 08:01:31 -04:00
|
|
|
PluginAPI(PluginManager* pluginManager);
|
2016-05-13 05:42:03 -04:00
|
|
|
~PluginAPI();
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
friend class PluginManager;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_PLUGINAPI_H
|