feat: impl lifecycle with tests

This commit is contained in:
Samsonium
2026-10-03 15:24:21 +03:00
parent 1a2722da57
commit 8c65860153
5 changed files with 107 additions and 18 deletions
+7 -2
View File
@@ -132,12 +132,12 @@ MscEngine::getLoadedModules() const
return result;
}
MscEngineModule &MscEngine::getModule(const std::string &name)
std::shared_ptr<MscEngineModule> &MscEngine::getModule(const std::string &name)
{
for (auto &module : _modules)
{
if (module.get()->getName() == name)
return *module.get();
return module;
}
throw std::runtime_error("Module not found: " + name);
@@ -153,3 +153,8 @@ MscEngine::createDBProvider(const std::string &filepath)
{
return std::make_unique<MscEngineDBProvider>(filepath);
}
void MscEngine::requestStop()
{
this->stop(); // TODO: заменить на флаг
}