fix load function
This commit is contained in:
@@ -117,14 +117,21 @@ namespace Archimedes {
|
||||
//insert temporarily to avoid circular dependencies
|
||||
runOrder.insert(roInsert, m->getName());
|
||||
|
||||
for(auto it = runOrder.begin(); it != runOrder.end(); it++) {
|
||||
|
||||
if(m->deps.find(*it) == m->deps.end()) {
|
||||
if(std::holds_alternative<std::string>(m->deps[*it]))
|
||||
m->depsInstances[*it] = load(std::get<std::string>(m->deps[*it]));
|
||||
else
|
||||
m->depsInstances[*it] = load(std::get<Module*>(m->deps[*it]));
|
||||
bool skip = false;
|
||||
for(auto it : m->deps) {
|
||||
for(auto s : runOrder) {
|
||||
if(s == it.first) {
|
||||
skip = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(skip)
|
||||
continue;
|
||||
|
||||
if(std::holds_alternative<std::string>(it.second))
|
||||
m->depsInstances[it.first] = load(std::get<std::string>(it.second));
|
||||
else
|
||||
m->depsInstances[it.first] = load(std::get<Module*>(it.second));
|
||||
}
|
||||
|
||||
//reinsert once final order has been reached
|
||||
@@ -132,6 +139,9 @@ namespace Archimedes {
|
||||
|
||||
runOrder.insert(roInsert, m->getName());
|
||||
|
||||
for(auto s : runOrder)
|
||||
std::cout << s << std::endl;
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user