From: 이한종/동작제어Lab(SR)/Engineer/삼성전자 Date: Fri, 14 Dec 2018 01:37:20 +0000 (+0900) Subject: [neurun] Move template specializations (#4039) X-Git-Tag: 0.3~83 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5397abe298173608414dbdbd9fa9eec532fb6db;p=platform%2Fcore%2Fml%2Fnnfw.git [neurun] Move template specializations (#4039) Move template specializations to source file to avoid duplicated definition error. Signed-off-by: Hanjoung Lee --- diff --git a/runtimes/neurun/src/util/config/ConfigManager.cc b/runtimes/neurun/src/util/config/ConfigManager.cc index 9b8f97d..46b8031 100644 --- a/runtimes/neurun/src/util/config/ConfigManager.cc +++ b/runtimes/neurun/src/util/config/ConfigManager.cc @@ -48,5 +48,27 @@ ConfigManager::ConfigManager() #undef CONFIG } +template <> bool ConfigManager::get(const std::string &key) const +{ + auto raw = _map.at(key); + + static const std::array false_list{"0", "OFF", "FALSE", "N", "NO"}; + auto false_found = std::find(false_list.begin(), false_list.end(), raw); + + return (false_found == false_list.end()); +} + +template <> int ConfigManager::get(const std::string &key) const +{ + auto raw = _map.at(key); + return std::stoi(raw); +} + +template <> std::string ConfigManager::get(const std::string &key) const +{ + auto raw = _map.at(key); + return raw; +} + } // namespace config } // namespace neurun diff --git a/runtimes/neurun/src/util/config/ConfigManager.h b/runtimes/neurun/src/util/config/ConfigManager.h index 8c5b852..78db03d 100644 --- a/runtimes/neurun/src/util/config/ConfigManager.h +++ b/runtimes/neurun/src/util/config/ConfigManager.h @@ -61,27 +61,9 @@ private: std::unordered_map _map; }; -template <> bool ConfigManager::get(const std::string &key) const -{ - auto raw = _map.at(key); - - static const std::array false_list{"0", "OFF", "FALSE", "N", "NO"}; - auto false_found = std::find(false_list.begin(), false_list.end(), raw); - - return (false_found == false_list.end()); -} - -template <> int ConfigManager::get(const std::string &key) const -{ - auto raw = _map.at(key); - return std::stoi(raw); -} - -template <> std::string ConfigManager::get(const std::string &key) const -{ - auto raw = _map.at(key); - return raw; -} +template <> bool ConfigManager::get(const std::string &key) const; +template <> int ConfigManager::get(const std::string &key) const; +template <> std::string ConfigManager::get(const std::string &key) const; } // namespace config } // namespace neurun