feat: impl lifecycle with tests
This commit is contained in:
@@ -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: заменить на флаг
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user