MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / CoreModule

Method CoreModule

libs/module/CoreModule.cpp:16–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14{
15
16CoreModule::CoreModule(IApplicationContext& context) :
17 _instance(nullptr)
18{
19 auto coreModulePath = findCoreModule(context);
20
21 _coreModuleLibrary.reset(new DynamicLibrary(coreModulePath));
22
23 if (_coreModuleLibrary->failed())
24 {
25 throw FailureException("Cannot load the main module " + _coreModuleLibrary->getName());
26 }
27
28 auto symbol = _coreModuleLibrary->findSymbol(QUOTE(SYMBOL_CREATE_RADIANT));
29
30 if (symbol == nullptr)
31 {
32 throw FailureException("Main module " + _coreModuleLibrary->getName() +
33 " doesn't expose the symbol " + QUOTE(SYMBOL_CREATE_RADIANT));
34 }
35
36 auto createFunc = reinterpret_cast<CreateRadiantFunc>(symbol);
37
38 _instance = createFunc(context);
39}
40
41CoreModule::~CoreModule()
42{

Callers

nothing calls this directly

Calls 5

findSymbolMethod · 0.80
FailureExceptionClass · 0.70
resetMethod · 0.45
failedMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected