ie_plugin_dispatcher.hpp
Go to the documentation of this file.
1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @brief A header for a class to handle plugin loading.
7  *
8  * @file ie_plugin_dispatcher.hpp
9  */
10 #pragma once
11 
12 #include <cpp/ie_plugin_cpp.hpp>
13 #include <string>
14 #include <vector>
15 
16 #include "ie_plugin_ptr.hpp"
17 
18 namespace InferenceEngine {
19 
20 /**
21  * @deprecated Use InferenceEngine::Core instead. Will be removed in 2021.1
22  * @brief This is a class to load a suitable plugin
23  */
24 class INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::Core instead which dispatches plugin automatically."
25  "Will be removed in 2021.1") INFERENCE_ENGINE_API_CLASS(PluginDispatcher) {
26 public:
27  /**
28  * @brief A constructor
29  *
30  * @param pp Vector of paths to plugin directories
31  */
32  explicit PluginDispatcher(const std::vector<file_name_t>& pp = {file_name_t()});
33 
34  IE_SUPPRESS_DEPRECATED_START
35 
36  /**
37  * @brief Loads a plugin from plugin directories
38  *
39  * @param name Plugin name
40  * @return A pointer to the loaded plugin
41  */
42  virtual InferencePlugin getPluginByName(const file_name_t& name) const;
43 
44  /**
45  * @deprecated Use InferenceEngine::Core to work with devices by name
46  * @brief Loads a plugin from directories that is suitable for the device string
47  *
48  * @param deviceName A string value representing target device
49  * @return A pointer to the plugin
50  */
51  InferencePlugin getPluginByDevice(const std::string& deviceName) const;
52 
53  IE_SUPPRESS_DEPRECATED_END
54 
55 protected:
56  /**
57  * @brief Creates path to the plugin
58  *
59  * @param path Path to the plugin
60  * @param input Plugin name
61  * @return The path to the plugin
62  */
63  file_name_t make_plugin_name(const file_name_t& path, const file_name_t& input) const;
64 
65 private:
66  std::vector<file_name_t> pluginDirs;
67 };
68 } // namespace InferenceEngine
This class represents Inference Engine Core entity.
Definition: ie_core.hpp:29
Inference Engine API.
Definition: ie_argmax_layer.hpp:15
This class is a C++ API wrapper for IInferencePlugin.
Definition: ie_plugin_cpp.hpp:30
std::string name
Layer name.
Definition: ie_layers.h:42
A header file contains a wrapper class for handling plugin instantiation and releasing resources...
This is a class to load a suitable plugin.
Definition: ie_plugin_dispatcher.hpp:24
This is a header file for the Inference Engine plugin C++ API.