mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-07-09 18:45:22 +02:00
Fixed support in the module manager
This commit is contained in:
@ -140,6 +140,14 @@ bool ModuleManager::instanceEnabled(std::string name) {
|
||||
return instances[name].instance->isEnabled();
|
||||
}
|
||||
|
||||
void ModuleManager::postInit(std::string name) {
|
||||
if (instances.find(name) == instances.end()) {
|
||||
spdlog::error("Cannot post-init '{0}', instance doesn't exist", name);
|
||||
return;
|
||||
}
|
||||
instances[name].instance->postInit();
|
||||
}
|
||||
|
||||
std::string ModuleManager::getInstanceModuleName(std::string name) {
|
||||
if (instances.find(name) == instances.end()) {
|
||||
spdlog::error("Cannot get module name of'{0}', instance doesn't exist", name);
|
||||
@ -159,4 +167,11 @@ int ModuleManager::countModuleInstances(std::string module) {
|
||||
if (instance.module == mod) { count++; }
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void ModuleManager::doPostInitAll() {
|
||||
for (auto& [name, inst] : instances) {
|
||||
spdlog::info("Running post-init for {0}", name);
|
||||
inst.instance->postInit();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user