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  */
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
Definition: ie_argmax_layer.hpp:11
void SetState(Blob::Ptr state)
Wraps original method IMemoryState::SetState.
Definition: ie_memory_state.hpp:48
std::string GetName() const
Wraps original method IMemoryState::GetName.
Definition: ie_memory_state.hpp:30
std::shared_ptr< const Blob > CPtr
A smart pointer to the const Blob object.
Definition: ie_blob.h:43
std::shared_ptr< Blob > Ptr
A smart pointer containing Blob object.
Definition: ie_blob.h:38
Blob::CPtr GetLastState() const
Wraps original method IMemoryState::GetLastState.
Definition: ie_memory_state.hpp:39
c++ exception based error reporting wrapper of API class IMemoryState
Definition: ie_memory_state.hpp:13
void Reset()
Wraps original method IMemoryState::Reset.
Definition: ie_memory_state.hpp:23