updated readme file due to moving CMake scripts to the root folder
[platform/upstream/dldt.git] / inference-engine / src / inference_engine / cpp_interfaces / interface / ie_iplugin_internal.hpp
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 /**
6  * \brief inference engine plugin API wrapper, to be used by particular implementors
7  * \file ie_plugin_base.hpp
8  */
9
10 #pragma once
11
12 #include <memory>
13 #include <map>
14 #include <string>
15 #include <ie_icnn_network.hpp>
16 #include <ie_iexecutable_network.hpp>
17 #include <ie_iextension.h>
18 #include <ie_icore.hpp>
19
20 namespace InferenceEngine {
21
22 /**
23  * @brief minimum API to be implemented by plugin, which is used in PluginBase forwarding mechanism
24  */
25 class IInferencePluginInternal {
26 public:
27     virtual ~IInferencePluginInternal() = default;
28
29     virtual std::string GetName() const noexcept = 0;
30     virtual void SetName(const std::string & name) noexcept = 0;
31
32     /**
33      * @brief Creates an executable network from an pares network object, users can create as many networks as they need and use
34      *        them simultaneously (up to the limitation of the HW resources)
35      * @param executableNetwork - a reference to a shared ptr of the returned network interface
36      * @param network - a network object acquired from CNNNetReader
37      * @param config string-string map of config parameters relevant only for this load operation
38      */
39     virtual void LoadNetwork(IExecutableNetwork::Ptr &executableNetwork,
40                              ICNNNetwork &network,
41                              const std::map<std::string, std::string> &config) = 0;
42
43     /**
44      * @brief Registers extension within plugin
45      * @param extension - pointer to already loaded extension
46      */
47     virtual void AddExtension(InferenceEngine::IExtensionPtr extension) = 0;
48
49     /**
50      * @brief Sets configuration for plugin, acceptable keys can be found in ie_plugin_config.hpp
51      * @param config string-string map of config parameters
52      */
53     virtual void SetConfig(const std::map<std::string, std::string> &config) = 0;
54
55     /**
56      * @brief Gets configuration dedicated to plugin behaviour
57      * @param name  - value of config corresponding to config key
58      * @param options - configuration details for config
59      * @return Value of config corresponding to config key
60      */
61     virtual Parameter GetConfig(const std::string& name, const std::map<std::string, Parameter> & options) const = 0;
62
63     /**
64      * @brief Gets general runtime metric for dedicated hardware
65      * @param name  - metric name to request
66      * @param options - configuration details for metric
67      * @return Metric value corresponding to metric key
68      */
69     virtual Parameter GetMetric(const std::string& name, const std::map<std::string, Parameter> & options) const = 0;
70
71     /**
72      * @brief Creates an executable network from an previously exported network
73      * @param ret - a reference to a shared ptr of the returned network interface
74      * @param modelFileName - path to the location of the exported file
75      */
76     virtual IExecutableNetwork::Ptr ImportNetwork(const std::string &modelFileName, const std::map<std::string, std::string> &config) = 0;
77
78     /**
79      * @brief Sets logging callback
80      * Logging is used to track what is going on inside
81      * @param listener - logging sink
82      */
83     virtual void SetLogCallback(IErrorListener &listener) = 0;
84
85     /**
86      * @brief Sets pointer to ICore interface
87      * @param core Pointer to Core interface
88      */
89     virtual void SetCore(ICore *core) noexcept = 0;
90
91     /**
92      * @brief Gets refernce to ICore interface
93      * @return Reference to core interface
94      */
95     virtual const ICore* GetCore() const noexcept = 0;
96
97     virtual void QueryNetwork(const ICNNNetwork &network, const std::map<std::string, std::string>& config, QueryNetworkResult &res) const = 0;
98 };
99
100 }  // namespace InferenceEngine