2021-08-19 00:37:25 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "dll_export.h"
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <map>
|
2025-01-03 12:05:46 -05:00
|
|
|
|
2025-05-26 19:42:16 +01:00
|
|
|
#include "utils/event_bus.h"
|
2025-05-26 19:21:10 +01:00
|
|
|
#include "utils/task_scheduler.h"
|
2021-08-19 00:37:25 +02:00
|
|
|
|
|
|
|
|
#define PLUGIN_LOADER(constructor) \
|
|
|
|
|
extern "C" \
|
|
|
|
|
{ \
|
|
|
|
|
satdump::Plugin *loader() \
|
|
|
|
|
{ \
|
|
|
|
|
return (satdump::Plugin *)new constructor(); \
|
|
|
|
|
} \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace satdump
|
|
|
|
|
{
|
|
|
|
|
struct SatDumpStartedEvent
|
|
|
|
|
{
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class Plugin
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Plugin() {}
|
|
|
|
|
virtual std::string getID() = 0;
|
|
|
|
|
virtual void init() = 0;
|
|
|
|
|
virtual ~Plugin(){};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SATDUMP_DLL extern std::map<std::string, std::shared_ptr<satdump::Plugin>> loaded_plugins;
|
2022-05-13 23:40:35 +02:00
|
|
|
SATDUMP_DLL extern std::shared_ptr<EventBus> eventBus;
|
2025-01-03 12:05:46 -05:00
|
|
|
SATDUMP_DLL extern std::shared_ptr<TaskScheduler> taskScheduler;
|
2021-08-19 00:37:25 +02:00
|
|
|
}; // namespace satdump
|
|
|
|
|
|
2022-05-12 18:19:01 +02:00
|
|
|
void loadPlugins(std::map<std::string, std::shared_ptr<satdump::Plugin>> &loaded_plugins = satdump::loaded_plugins);
|