| 55 | } |
| 56 | |
| 57 | std::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 | |
| 78 | bool plugin_manager_impl::unload_plugin(plugin_type_e _type) { |
| 79 | std::scoped_lock its_lock_start_stop{plugins_mutex_}; |
nothing calls this directly
no test coverage detected