MCPcopy Create free account
hub / github.com/COVESA/vsomeip / load_plugin

Method load_plugin

implementation/plugin/src/plugin_manager_impl.cpp:57–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57std::shared_ptr<plugin> plugin_manager_impl::load_plugin(const std::string& _library, plugin_type_e _type, uint32_t _version) {
58 void* handle = load_library(_library);
59 plugin_init_func its_init_func = reinterpret_cast<plugin_init_func>(load_symbol(handle, VSOMEIP_PLUGIN_INIT_SYMBOL));
60 if (its_init_func) {
61 create_plugin_func its_create_func = (*its_init_func)();
62 if (its_create_func) {
63 handles_[_type][_library] = handle;
64 auto its_plugin = (*its_create_func)();
65 if (its_plugin) {
66 if (its_plugin->get_plugin_type() == _type && its_plugin->get_plugin_version() == _version) {
67 add_plugin(its_plugin, _library);
68 return its_plugin;
69 } else {
70 VSOMEIP_ERROR << "Plugin version mismatch. Ignoring plugin " << its_plugin->get_plugin_name();
71 }
72 }
73 }
74 }
75 return nullptr;
76}
77
78bool plugin_manager_impl::unload_plugin(plugin_type_e _type) {
79 std::scoped_lock its_lock_start_stop{plugins_mutex_};

Callers

nothing calls this directly

Calls 2

get_plugin_typeMethod · 0.80
get_plugin_versionMethod · 0.80

Tested by

no test coverage detected