| 34 | namespace aimrt::plugins::parameter_plugin { |
| 35 | |
| 36 | bool ParameterPlugin::Initialize(runtime::core::AimRTCore* core_ptr) noexcept { |
| 37 | try { |
| 38 | core_ptr_ = core_ptr; |
| 39 | |
| 40 | YAML::Node plugin_options_node = core_ptr_->GetPluginManager().GetPluginOptionsNode(Name()); |
| 41 | |
| 42 | if (plugin_options_node && !plugin_options_node.IsNull()) { |
| 43 | options_ = plugin_options_node.as<Options>(); |
| 44 | } |
| 45 | |
| 46 | init_flag_ = true; |
| 47 | |
| 48 | core_ptr_->RegisterHookFunc(runtime::core::AimRTCore::State::kPostInitLog, |
| 49 | [this] { SetPluginLogger(); }); |
| 50 | |
| 51 | core_ptr_->RegisterHookFunc(runtime::core::AimRTCore::State::kPreInitModules, |
| 52 | [this] { RegisterRpcService(); }); |
| 53 | |
| 54 | plugin_options_node = options_; |
| 55 | core_ptr_->GetPluginManager().UpdatePluginOptionsNode(Name(), plugin_options_node); |
| 56 | |
| 57 | return true; |
| 58 | } catch (const std::exception& e) { |
| 59 | AIMRT_ERROR("Initialize failed, {}", e.what()); |
| 60 | } |
| 61 | |
| 62 | return false; |
| 63 | } |
| 64 | |
| 65 | void ParameterPlugin::Shutdown() noexcept { |
| 66 | try { |
nothing calls this directly
no test coverage detected