JustEnoughMod
Loading...
Searching...
No Matches
PluginLoader.hpp
1#ifndef PLUGIN_PLUGINLOADER_HPP
2#define PLUGIN_PLUGINLOADER_HPP
3
4#include <core/AppModule.hpp>
5#include <plugin/Plugin.hpp>
6
7#include <dylib.hpp>
8
9#include <utility>
10
11namespace JEM::Plugin {
12 class PluginLoader : public AppModule {
13 public:
14 explicit PluginLoader(std::shared_ptr<Application> app) : AppModule(app) {}
15
16 void loadFile(const std::string &path, const std::string &name);
17 void loadFolder(const std::string &path);
18
19 [[nodiscard]] auto getNative() const -> auto & {
20 return m_pluginVec;
21 }
22
23 private:
24 std::vector<std::shared_ptr<dylib>>
25 m_dylibVec; // add dylib object to vector so that the Plugin doesn't outlive the Loader
26 std::vector<std::shared_ptr<Plugin>> m_pluginVec;
27 };
28} // namespace JEM::Plugin
29
30#endif
Definition AppModule.hpp:9
Definition PluginLoader.hpp:12