Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / include / cpp / ie_memory_state.hpp
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #pragma once
6 #include <string>
7
8 namespace InferenceEngine {
9
10 /**
11  * @brief c++ exception based error reporting wrapper of API class IMemoryState
12  */
13 class MemoryState {
14     IMemoryState::Ptr actual = nullptr;
15
16  public:
17     explicit MemoryState(IMemoryState::Ptr pState) : actual(pState) {}
18
19     /**
20      * @brief Wraps original method
21      * IMemoryState::Reset
22      */
23      void Reset() {
24         CALL_STATUS_FNC_NO_ARGS(Reset);
25      }
26     /**
27      * @brief Wraps original method
28      * IMemoryState::GetName
29      */
30      std::string GetName() const {
31          char name[256];
32          CALL_STATUS_FNC(GetName, name, sizeof(name));
33          return name;
34      }
35     /**
36      * @brief Wraps original method
37      * IMemoryState::GetLastState
38      */
39       Blob::CPtr GetLastState() const {
40          Blob::CPtr stateBlob;
41          CALL_STATUS_FNC(GetLastState, stateBlob);
42          return stateBlob;
43      }
44     /**
45      * @brief Wraps original method
46      * IMemoryState::SetState
47      */
48      void SetState(Blob::Ptr state) {
49          CALL_STATUS_FNC(SetState, state);
50      }
51 };
52
53 }  // namespace InferenceEngine