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  /**
18  * constructs MemoryState from the initialized shared_pointer
19  * @param pState Initialized shared pointer
20  */
21  explicit MemoryState(IMemoryState::Ptr pState) : actual(pState) {}
22 
23  /**
24  * @brief Wraps original method
25  * IMemoryState::Reset
26  */
27  void Reset() {
28  CALL_STATUS_FNC_NO_ARGS(Reset);
29  }
30 
31  /**
32  * @brief Wraps original method
33  * IMemoryState::GetName
34  */
35  std::string GetName() const {
36  char name[256];
37  CALL_STATUS_FNC(GetName, name, sizeof(name));
38  return name;
39  }
40 
41  /**
42  * @brief Wraps original method
43  * IMemoryState::GetLastState
44  */
46  Blob::CPtr stateBlob;
47  CALL_STATUS_FNC(GetLastState, stateBlob);
48  return stateBlob;
49  }
50 
51  /**
52  * @brief Wraps original method
53  * IMemoryState::SetState
54  */
55  void SetState(Blob::Ptr state) {
56  CALL_STATUS_FNC(SetState, state);
57  }
58 };
59 
60 } // namespace InferenceEngine
Definition: ie_argmax_layer.hpp:11
void SetState(Blob::Ptr state)
Wraps original method IMemoryState::SetState.
Definition: ie_memory_state.hpp:55
std::string GetName() const
Wraps original method IMemoryState::GetName.
Definition: ie_memory_state.hpp:35
std::shared_ptr< const Blob > CPtr
A smart pointer to the const Blob object.
Definition: ie_blob.h:45
std::shared_ptr< Blob > Ptr
A smart pointer containing Blob object.
Definition: ie_blob.h:40
Blob::CPtr GetLastState() const
Wraps original method IMemoryState::GetLastState.
Definition: ie_memory_state.hpp:45
c++ exception based error reporting wrapper of API class IMemoryState
Definition: ie_memory_state.hpp:13
MemoryState(IMemoryState::Ptr pState)
Definition: ie_memory_state.hpp:21
void Reset()
Wraps original method IMemoryState::Reset.
Definition: ie_memory_state.hpp:27