| 43 | } |
| 44 | |
| 45 | std::shared_ptr<plugin> plugin_manager_impl::get_plugin(plugin_type_e _type, const std::string& _name) { |
| 46 | std::scoped_lock its_lock_start_stop{plugins_mutex_}; |
| 47 | auto its_type = plugins_.find(_type); |
| 48 | if (its_type != plugins_.end()) { |
| 49 | auto its_name = its_type->second.find(_name); |
| 50 | if (its_name != its_type->second.end()) { |
| 51 | return its_name->second; |
| 52 | } |
| 53 | } |
| 54 | return load_plugin(_name, _type, 1); |
| 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); |