summaryrefslogtreecommitdiff
path: root/inference-engine/include/ie_plugin_dispatcher.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'inference-engine/include/ie_plugin_dispatcher.hpp')
-rw-r--r--inference-engine/include/ie_plugin_dispatcher.hpp35
1 files changed, 22 insertions, 13 deletions
diff --git a/inference-engine/include/ie_plugin_dispatcher.hpp b/inference-engine/include/ie_plugin_dispatcher.hpp
index 257b4946a..60d729dbf 100644
--- a/inference-engine/include/ie_plugin_dispatcher.hpp
+++ b/inference-engine/include/ie_plugin_dispatcher.hpp
@@ -1,5 +1,4 @@
// Copyright (C) 2018 Intel Corporation
-//
// SPDX-License-Identifier: Apache-2.0
//
@@ -24,24 +23,24 @@ public:
* @brief A constructor
* @param pp Vector of paths to plugin directories
*/
- explicit PluginDispatcher(const std::vector<std::string> &pp) : pluginDirs(pp) {}
+ explicit PluginDispatcher(const std::vector<file_name_t> &pp) : pluginDirs(pp) {}
/**
* @brief Loads a plugin from plugin directories
* @param name Plugin name
* @return A pointer to the loaded plugin
*/
- virtual InferencePlugin getPluginByName(const std::string& name) const {
+ virtual InferencePlugin getPluginByName(const file_name_t& name) const {
std::stringstream err;
for (auto &pluginPath : pluginDirs) {
try {
return InferencePlugin(InferenceEnginePluginPtr(make_plugin_name(pluginPath, name)));
}
catch (const std::exception &ex) {
- err << "cannot load plugin: " << name << " from " << pluginPath << ": " << ex.what() << ", skipping\n";
+ err << "cannot load plugin: " << fileNameToString(name) << " from " << fileNameToString(pluginPath) << ": " << ex.what() << ", skipping\n";
}
}
- THROW_IE_EXCEPTION << "Plugin " << name << " cannot be loaded: " << err.str() << "\n";
+ THROW_IE_EXCEPTION << "Plugin " << fileNameToString(name) << " cannot be loaded: " << err.str() << "\n";
}
/**
@@ -77,7 +76,7 @@ public:
std::stringstream err;
for (std::string& name : result.names) {
try {
- return getPluginByName(name);
+ return getPluginByName(stringToFileName(name));
}
catch (const std::exception &ex) {
err << "Tried load plugin : " << name << ", error: " << ex.what() << "\n";
@@ -93,17 +92,26 @@ protected:
* @param input Plugin name
* @return The path to the plugin
*/
- std::string make_plugin_name(const std::string &path, const std::string &input) const {
- std::string separator =
+ file_name_t make_plugin_name(const file_name_t &path, const file_name_t &input) const {
+ file_name_t separator =
#if defined _WIN32 || defined __CYGWIN__
- "\\";
+# if defined UNICODE
+ L"\\";
+# else
+ "\\";
+# endif
#else
- "/";
+ "/";
#endif
if (path.empty())
- separator = "";
+ separator = file_name_t();
#ifdef _WIN32
- return path + separator + input + ".dll";
+ return path + separator + input +
+# if defined UNICODE
+ L".dll";
+# else
+ ".dll";
+# endif
#elif __APPLE__
return path + separator + "lib" + input + ".dylib";
#else
@@ -111,7 +119,8 @@ protected:
#endif
}
+
private:
- std::vector<std::string> pluginDirs;
+ std::vector<file_name_t> pluginDirs;
};
} // namespace InferenceEngine