| 14 | { |
| 15 | |
| 16 | CoreModule::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 | |
| 41 | CoreModule::~CoreModule() |
| 42 | { |
nothing calls this directly
no test coverage detected