allow static dependencies
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <variant>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace Archimedes {
|
|||||||
skip = false;
|
skip = false;
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
load(dynamicLoad(it->second), blacklist);
|
load(it->second, blacklist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,6 +88,12 @@ namespace Archimedes {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool App::load(std::string modulePath, std::list<std::string> blacklist = {}) {
|
||||||
|
Module* m = dynamicLoad(modulePath);
|
||||||
|
return load(m, blacklist);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void App::unload(std::list<Module*>::iterator it) {
|
void App::unload(std::list<Module*>::iterator it) {
|
||||||
|
|
||||||
Module* m = *it;
|
Module* m = *it;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ namespace Archimedes {
|
|||||||
std::list<std::string> toOpen;
|
std::list<std::string> toOpen;
|
||||||
|
|
||||||
Module* dynamicLoad(std::string);
|
Module* dynamicLoad(std::string);
|
||||||
|
virtual bool load(std::string, std::list<std::string>);
|
||||||
virtual bool load(Module*, std::list<std::string>);
|
virtual bool load(Module*, std::list<std::string>);
|
||||||
|
|
||||||
virtual void unload(std::list<Module*>::iterator);
|
virtual void unload(std::list<Module*>::iterator);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace Archimedes {
|
|||||||
|
|
||||||
App* app;
|
App* app;
|
||||||
|
|
||||||
std::unordered_map<std::string, std::string> deps;
|
std::unordered_map<std::string, std::variant<std::string, Archimedes::Module*>> deps;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ void ImguiEmbed::run() {
|
|||||||
toClose.clear();
|
toClose.clear();
|
||||||
|
|
||||||
for(std::string s : toOpen) {
|
for(std::string s : toOpen) {
|
||||||
load(dynamicLoad(s), getBlacklist());
|
load(s, getBlacklist());
|
||||||
}
|
}
|
||||||
toOpen.clear();
|
toOpen.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ void MinimalApp::run() {
|
|||||||
toClose.clear();
|
toClose.clear();
|
||||||
|
|
||||||
for(std::string s : toOpen) {
|
for(std::string s : toOpen) {
|
||||||
load(dynamicLoad(s), getBlacklist());
|
load(s, getBlacklist());
|
||||||
}
|
}
|
||||||
toOpen.clear();
|
toOpen.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user