MCPcopy Create free account
hub / github.com/GlobedGD/globed2 / addModule

Method addModule

src/core/CoreImpl.cpp:17–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15CoreImpl::~CoreImpl() {}
16
17Result<> CoreImpl::addModule(std::shared_ptr<Module> mod) {
18 if (this->findModule(mod->id())) {
19 return Err("Module with ID '{}' is already registered", mod->id());
20 }
21
22 m_modules.push_back(std::move(mod));
23
24 return Ok();
25}
26
27Module* CoreImpl::findModule(std::string_view id) {
28 for (auto& mod : m_modules) {

Callers

nothing calls this directly

Calls 2

findModuleMethod · 0.95
idMethod · 0.45

Tested by

no test coverage detected