ie_memory_state.hpp
Go to the documentation of this file.
1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @file
7  */
8 
9 #pragma once
10 #include <string>
11 
12 namespace InferenceEngine {
13 
14 /**
15  * @brief C++ exception based error reporting wrapper of API class IMemoryState
16  */
17 class MemoryState {
18  IMemoryState::Ptr actual = nullptr;
19 
20 public:
21  /**
22  * constructs MemoryState from the initialized shared_pointer
23  * @param pState Initialized shared pointer
24  */
25  explicit MemoryState(IMemoryState::Ptr pState): actual(pState) {}
26 
27  /**
28  * @copybrief IMemoryState::Reset
29  *
30  * Wraps IMemoryState::Reset
31  */
32  void Reset() {
33  CALL_STATUS_FNC_NO_ARGS(Reset);
34  }
35 
36  /**
37  * @copybrief IMemoryState::GetName
38  *
39  * Wraps IMemoryState::GetName
40  */
41  std::string GetName() const {
42  char name[256];
43  CALL_STATUS_FNC(GetName, name, sizeof(name));
44  return name;
45  }
46 
47  /**
48  * @copybrief IMemoryState::GetLastState
49  *
50  * Wraps IMemoryState::GetLastState
51  */
53  Blob::CPtr stateBlob;
54  CALL_STATUS_FNC(GetLastState, stateBlob);
55  return stateBlob;
56  }
57 
58  /**
59  * @copybrief IMemoryState::SetState
60  *
61  * Wraps IMemoryState::SetState
62  */
63  void SetState(Blob::Ptr state) {
64  CALL_STATUS_FNC(SetState, state);
65  }
66 };
67 
68 } // namespace InferenceEngine
Inference Engine API.
Definition: ie_argmax_layer.hpp:15
void SetState(Blob::Ptr state)
Definition: ie_memory_state.hpp:63
std::string GetName() const
Definition: ie_memory_state.hpp:41
std::shared_ptr< const Blob > CPtr
A smart pointer to the const Blob object.
Definition: ie_blob.h:47
std::shared_ptr< Blob > Ptr
A smart pointer containing Blob object.
Definition: ie_blob.h:42
Blob::CPtr GetLastState() const
Definition: ie_memory_state.hpp:52
C++ exception based error reporting wrapper of API class IMemoryState.
Definition: ie_memory_state.hpp:17
MemoryState(IMemoryState::Ptr pState)
Definition: ie_memory_state.hpp:25
void Reset()
Definition: ie_memory_state.hpp:32