Publishing R5 content (#72)
[platform/upstream/dldt.git] / inference-engine / src / inference_engine / cpp_interfaces / impl / ie_executable_network_internal.hpp
1 // Copyright (C) 2018 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #pragma once
6
7 #include <vector>
8 #include <memory>
9 #include <map>
10 #include <string>
11 #include <ie_plugin_ptr.hpp>
12 #include "cpp_interfaces/interface/ie_iinfer_request_internal.hpp"
13 #include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp"
14 #include "cpp_interfaces/impl/ie_infer_request_internal.hpp"
15 #include "cpp_interfaces/impl/ie_infer_async_request_internal.hpp"
16
17 namespace InferenceEngine {
18
19 class InferencePluginInternal;
20
21 typedef std::shared_ptr<InferencePluginInternal> InferencePluginInternalPtr;
22
23 /**
24  * @brief minimum API to be implemented by plugin, which is used in ExecutableNetworkBase forwarding mechanism
25  */
26 class ExecutableNetworkInternal : public IExecutableNetworkInternal {
27 public:
28     typedef std::shared_ptr<ExecutableNetworkInternal> Ptr;
29
30     virtual void setNetworkInputs(const InferenceEngine::InputsDataMap networkInputs) {
31         _networkInputs = networkInputs;
32     }
33
34     virtual void setNetworkOutputs(const InferenceEngine::OutputsDataMap networkOutputs) {
35         _networkOutputs = networkOutputs;
36     }
37
38     ConstOutputsDataMap GetOutputsInfo() const override {
39         ConstOutputsDataMap outputMap;
40         for (const auto & output : _networkOutputs) {
41             outputMap[output.first] = output.second;
42         }
43         return outputMap;
44     }
45
46     ConstInputsDataMap GetInputsInfo() const override {
47         ConstInputsDataMap  inputMap;
48         for (const auto & input : _networkInputs) {
49             inputMap[input.first] = input.second;
50         }
51         return inputMap;
52     }
53
54     void Export(const std::string &modelFileName) override {
55         THROW_IE_EXCEPTION << NOT_IMPLEMENTED_str;
56     }
57
58     void GetMappedTopology(std::map<std::string, std::vector<PrimitiveInfo::Ptr>> &deployedTopology) override {
59         THROW_IE_EXCEPTION << NOT_IMPLEMENTED_str;
60     }
61
62     void SetPointerToPluginInternal(InferencePluginInternalPtr plugin) {
63         _plugin = plugin;
64     }
65
66     std::vector<IMemoryStateInternal::Ptr>  QueryState() override {
67         // meaning base plugin reports as no state available - plugin owners need to create proper override of this
68         return {};
69     }
70
71
72 protected:
73     InferenceEngine::InputsDataMap _networkInputs;
74     InferenceEngine::OutputsDataMap _networkOutputs;
75
76     InferencePluginInternalPtr _plugin;
77 };
78
79 }  // namespace InferenceEngine