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