ie_memory_state.hpp
Go to the documentation of this file.
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @brief A header file that provides wrapper classes for IVariableState
7  *
8  * @file ie_memory_state.hpp
9  */
10 
11 #pragma once
12 
13 #include <string>
14 
15 #include "ie_blob.h"
17 #include "details/ie_so_loader.h"
18 
19 namespace InferenceEngine {
20 
21 IE_SUPPRESS_DEPRECATED_START
22 class IVariableState;
23 IE_SUPPRESS_DEPRECATED_END
24 
25 /**
26  * @brief C++ exception based error reporting wrapper of API class IVariableState
27  */
28 class INFERENCE_ENGINE_API_CLASS(VariableState) {
29  IE_SUPPRESS_DEPRECATED_START
30  std::shared_ptr<IVariableState> actual = nullptr;
31  IE_SUPPRESS_DEPRECATED_END
32  details::SharedObjectLoader::Ptr plugin = nullptr;
33 
34 public:
35  IE_SUPPRESS_DEPRECATED_START
36  /**
37  * @brief constructs VariableState from the initialized std::shared_ptr
38  * @param pState Initialized shared pointer
39  * @param plg Optional: Plugin to use. This is required to ensure that VariableState can work properly even if plugin object is destroyed.
40  */
41  explicit VariableState(std::shared_ptr<IVariableState> pState, details::SharedObjectLoader::Ptr plg = {});
42  IE_SUPPRESS_DEPRECATED_END
43 
44  /**
45  * @copybrief IVariableState::Reset
46  *
47  * Wraps IVariableState::Reset
48  */
49  void Reset();
50 
51  /**
52  * @copybrief IVariableState::GetName
53  *
54  * Wraps IVariableState::GetName
55  * @return A string representing a state name
56  */
57  std::string GetName() const;
58 
59  /**
60  * @copybrief IVariableState::GetState
61  *
62  * Wraps IVariableState::GetState
63  * @return A blob representing a state
64  */
66 
67  /**
68  * @copybrief IVariableState::GetLastState
69  * @deprecated Use IVariableState::SetState instead
70  *
71  * Wraps IVariableState::GetLastState
72  * @return A blob representing a last state
73  */
74  INFERENCE_ENGINE_DEPRECATED("Use VariableState::GetState function instead")
75  Blob::CPtr GetLastState() const;
76 
77  /**
78  * @copybrief IVariableState::SetState
79  *
80  * Wraps IVariableState::SetState
81  * @param state The current state to set
82  */
83  void SetState(Blob::Ptr state);
84 };
85 
86 /**
87  * @brief For compatibility reasons.
88  */
90 
91 } // namespace InferenceEngine
This class represents a universal container in the Inference Engine.
Definition: ie_blob.h:38
std::shared_ptr< const Blob > CPtr
A smart pointer to the const Blob object.
Definition: ie_blob.h:48
C++ exception based error reporting wrapper of API class IVariableState.
Definition: ie_memory_state.hpp:28
Blob::CPtr GetState() const
Returns the value of the variable state.
std::string GetName() const
Gets name of current variable state, if length of array is not enough name is truncated by len,...
void Reset()
Reset internal variable state for relevant infer request, to a value specified as default for accordi...
VariableState(std::shared_ptr< IVariableState > pState, details::SharedObjectLoader::Ptr plg={})
constructs VariableState from the initialized std::shared_ptr
A header file for Blob and generic TBlob<>
A header file that provides macros to handle no exception methods.
A header file for definition of abstraction over platform specific shared objects.
Inference Engine C++ API.
Definition: cldnn_config.hpp:15