ie_plugin_dispatcher.hpp
Go to the documentation of this file.
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6 * @brief A header for a class to handle plugin loading.
7 * @file ie_plugin_dispatcher.hpp
8 */
9 #pragma once
10 
11 #include "ie_plugin_ptr.hpp"
12 #include <string>
13 #include <vector>
14 #include <cpp/ie_plugin_cpp.hpp>
16 
17 namespace InferenceEngine {
18 /**
19 * @brief This is a class to load a suitable plugin
20 */
21 class INFERENCE_ENGINE_API_CLASS(PluginDispatcher) {
22 public:
23  /**
24  * @brief A constructor
25  * @param pp Vector of paths to plugin directories
26  */
27  explicit PluginDispatcher(const std::vector<file_name_t> &pp = {file_name_t()});
28 
29  /**
30  * @brief Loads a plugin from plugin directories
31  * @param name Plugin name
32  * @return A pointer to the loaded plugin
33  */
34  virtual InferencePlugin getPluginByName(const file_name_t& name) const;
35 
36  /**
37  * @deprecated Use InferenceEngine::Core to work with devices by name
38  * @brief Loads a plugin from directories that is suitable for the device string
39  * @param deviceName A string value representing target device
40  * @return A pointer to the plugin
41  */
42  INFERENCE_ENGINE_DEPRECATED
43  InferencePlugin getPluginByDevice(const std::string& deviceName) const;
44 
45  /**
46  * @deprecated Use InferenceEngine::Core to work with devices by name
47  * @brief Loads a plugin from directories that is suitable for the device
48  * @param device An instance of InferenceEngine::TargetDevice
49  * @return A pointer to the plugin
50  */
51  INFERENCE_ENGINE_DEPRECATED
52  InferenceEnginePluginPtr getSuitablePlugin(TargetDevice device) const;
53 
54 protected:
55  /**
56  * @brief Creates path to the plugin
57  * @param path Path to the plugin
58  * @param input Plugin name
59  * @return The path to the plugin
60  */
61  file_name_t make_plugin_name(const file_name_t &path, const file_name_t &input) const;
62 
63 private:
64  std::vector<file_name_t> pluginDirs;
65 };
66 } // namespace InferenceEngine
InferenceEngine::details::SOPointer< IInferencePlugin > InferenceEnginePluginPtr
A C++ helper to work with objects created by the plugin. Implements different interfaces.
Definition: ie_plugin_ptr.hpp:52
TargetDevice
Describes known device types.
Definition: ie_device.hpp:24
Definition: ie_argmax_layer.hpp:11
This class is a C++ API wrapper for IInferencePlugin. It can throw exceptions safely for the applicat...
Definition: ie_plugin_cpp.hpp:28
A header file contains a wrapper class for handling plugin instantiation and releasing resources...
A header that defines advanced related properties for Multi_Device plugin. These properties should be...
This is a class to load a suitable plugin.
Definition: ie_plugin_dispatcher.hpp:21
This is a header file for the Inference Engine plugin C++ API.