14 namespace InferenceEngine {
29 template <
typename Result,
typename Tmp>
31 const std::string& handle_Key,
32 const std::string& type_Key,
33 const std::string& obj_T1,
34 const std::string& obj_T2 =
"__")
const {
35 auto itrType = params.find(type_Key);
36 if (itrType == params.end())
39 std::string param_val = itrType->second.as<std::string>();
40 if (obj_T1 != param_val && obj_T2 != param_val)
43 auto itrHandle = params.find(handle_Key);
44 if (itrHandle == params.end()) {
48 Tmp handle = itrHandle->second;
49 return static_cast<Result
>(handle);
56 template <
typename Result>
58 auto itrHandle = params.find(handle_Key);
59 if (itrHandle == params.end()) {
63 Result handle = itrHandle->second;
72 std::string Key)
const {
73 auto itrType = params.find(Key);
74 if (itrType == params.end())
76 return itrType->second.as<std::string>();
This wrapper class is used to obtain low-level handles from remote blob or context object parameters.
Definition: gpu_context_helpers.hpp:23
Result _ObjFromParams(const ParamMap ¶ms, const std::string &handle_Key, const std::string &type_Key, const std::string &obj_T1, const std::string &obj_T2="__") const
Template function that returns specified object parameter typecasted to desired user type.
Definition: gpu_context_helpers.hpp:30
Result _ObjFromParamSimple(const ParamMap ¶ms, const std::string &handle_Key) const
Same as _ObjFromParams(), but should be used if check for object type is not required.
Definition: gpu_context_helpers.hpp:57
std::string _StrFromParams(const ParamMap ¶ms, std::string Key) const
Template function that extracts string value from map entry under specified key.
Definition: gpu_context_helpers.hpp:71
#define THROW_IE_EXCEPTION
A macro used to throw the exception with a notable description.
Definition: ie_exception.hpp:25
std::map< std::string, Parameter > ParamMap
An std::map object containing low-level object parameters of classes that are derived from RemoteBlob...
Definition: ie_remote_context.hpp:26