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

Method Initialize

src/plugins/parameter_plugin/parameter_plugin.cc:36–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34namespace aimrt::plugins::parameter_plugin {
35
36bool 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
65void ParameterPlugin::Shutdown() noexcept {
66 try {

Callers

nothing calls this directly

Calls 4

GetPluginOptionsNodeMethod · 0.80
RegisterHookFuncMethod · 0.80
whatMethod · 0.80

Tested by

no test coverage detected