MCPcopy Create free account
hub / github.com/AimRT/AimRT / InitModule

Method InitModule

src/runtime/core/module/module_manager.cc:365–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363}
364
365void ModuleManager::InitModule(ModuleWrapper* module_wrapper_ptr) {
366 const auto& module_name = module_wrapper_ptr->info.name;
367 const auto* module_ptr = module_wrapper_ptr->module_ptr;
368
369 auto module_options = GetModuleOptions(module_name);
370 auto& detail_info = module_wrapper_ptr->info;
371 if (module_options) {
372 detail_info.log_lvl = module_options->log_lvl;
373 detail_info.use_default_log_lvl = module_options->use_default_log_lvl;
374 detail_info.cfg_file_path = module_options->cfg_file_path;
375 } else {
376 options_.modules_options.emplace_back(Options::ModuleOptions{
377 .name = module_name,
378 .log_lvl = detail_info.log_lvl,
379 .use_default_log_lvl = detail_info.use_default_log_lvl,
380 .cfg_file_path = detail_info.cfg_file_path});
381 }
382
383 module_proxy_configurator_(detail_info, *(module_wrapper_ptr->core_proxy_ptr));
384
385 // Initialize the module
386 if (module_ptr != nullptr) {
387 bool ret = module_ptr->initialize(
388 module_ptr->impl, module_wrapper_ptr->core_proxy_ptr->NativeHandle());
389
390 AIMRT_CHECK_ERROR_THROW(ret, "Init module '{}' failed.", module_name);
391 }
392
393 AIMRT_TRACE("Init module '{}' succeeded.", module_name);
394}
395
396std::list<std::pair<std::string, std::string>> ModuleManager::GenInitializationReport() const {
397 AIMRT_CHECK_ERROR_THROW(

Callers

nothing calls this directly

Calls 1

NativeHandleMethod · 0.45

Tested by

no test coverage detected