[nnkit] Remove duplicated VectorArguments (#1757)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Fri, 5 Oct 2018 04:15:20 +0000 (13:15 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 5 Oct 2018 04:15:20 +0000 (13:15 +0900)
This commit replaces VectorArguments implemented in nni with the one
that nnkit_support_cmdline provides.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/nnkit/tools/nni/CMakeLists.txt
contrib/nnkit/tools/nni/nni.cpp

index 73edd02..6f4064e 100644 (file)
@@ -3,4 +3,5 @@ file(GLOB_RECURSE SOURCES "*.cpp")
 add_executable(nni ${SOURCES})
 target_link_libraries(nni nnkit_intf_action)
 target_link_libraries(nni nnkit_intf_backend)
+target_link_libraries(nni nnkit_support_cmdline)
 target_link_libraries(nni dl)
index 501b498..f754e53 100644 (file)
  */
 
 #include <nnkit/CmdlineArguments.h>
-
-#include <string>
-#include <vector>
-
-// TODO Extract this helper class
-class VectorArguments : public nnkit::CmdlineArguments
-{
-public:
-  uint32_t size(void) const { return _args.size(); }
-
-public:
-  const char *at(uint32_t nth) const { return _args.at(nth).c_str(); }
-
-public:
-  VectorArguments &append(const std::string &arg)
-  {
-    _args.emplace_back(arg);
-    return (*this);
-  }
-
-private:
-  std::vector<std::string> _args;
-};
+#include <nnkit/VectorArguments.h>
 
 namespace
 {
@@ -54,7 +32,7 @@ public:
   void append(const std::string &arg) { _args.append(arg); }
 
 private:
-  VectorArguments _args;
+  nnkit::VectorArguments _args;
 };
 
 }