nnc: plugin common lib (Plugin type) (#233)
authorVitaliy Cherepanov/SRR-AI Tools Lab/./삼성전자 <v.cherepanov@samsung.com>
Tue, 22 May 2018 23:11:12 +0000 (02:11 +0300)
committer박종현/동작제어Lab(SR)/Senior Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 22 May 2018 23:11:12 +0000 (08:11 +0900)
* nnc: plugin common lib (Plugin type)

This commit creates common plugin library.
This library will be used by plugins and nnc for communication.

Implemented:
  - Plugin type. Will be used to determinate plugin type and
    for debug also.

Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
* nnc: plugin common lib (Plugin type)

rename typeWrong to typeInvalid
using switch case
add to make file

Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
* nnc: plugin common lib (Plugin type)

make code readable

Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
* remove HLO and LLO from plugin types

Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
* nnc: plugin common lib (Plugin type)

fix build

Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
contrib/nnc/libs/CMakeLists.txt
contrib/nnc/libs/plugin/CMakeLists.txt [new file with mode: 0644]
contrib/nnc/libs/plugin/include/PluginType.h [new file with mode: 0644]
contrib/nnc/libs/plugin/src/PluginType.cpp [new file with mode: 0644]

index 4dcc379..0d5e2ed 100644 (file)
@@ -1 +1,2 @@
 add_subdirectory(frontend)
+add_subdirectory(plugin)
diff --git a/contrib/nnc/libs/plugin/CMakeLists.txt b/contrib/nnc/libs/plugin/CMakeLists.txt
new file mode 100644 (file)
index 0000000..559a575
--- /dev/null
@@ -0,0 +1,7 @@
+file(GLOB_RECURSE HEADERS "include/*.h")
+file(GLOB_RECURSE SOURCES "src/*.cpp")
+
+add_nncc_library(nnc_plugin_core SHARED ${HEADERS} ${SOURCES})
+set_target_properties(nnc_plugin_core PROPERTIES LINKER_LANGUAGE CXX)
+target_link_libraries(nnc_plugin_core PRIVATE nncc_foundation)
+target_include_directories(nnc_plugin_core PUBLIC include)
diff --git a/contrib/nnc/libs/plugin/include/PluginType.h b/contrib/nnc/libs/plugin/include/PluginType.h
new file mode 100644 (file)
index 0000000..be9cebb
--- /dev/null
@@ -0,0 +1,30 @@
+//
+// Created by v.cherepanov@samsung.com on 02.04.18.
+//
+
+#ifndef __PLUGIN_TYPE_H__
+#define __PLUGIN_TYPE_H__
+
+#include <string>
+
+namespace nncc
+{
+namespace contrib
+{
+namespace plugin
+{
+
+enum PluginType
+{
+  typeInvalid = 0,
+  typeFrontEnd,
+  typeBackEnd
+};
+
+std::string pluginTypeToStr(PluginType type);
+
+} // namespace plugin
+} // namespace contrib
+} // namespace nncc
+
+#endif // __PLUGIN_TYPE_H__
diff --git a/contrib/nnc/libs/plugin/src/PluginType.cpp b/contrib/nnc/libs/plugin/src/PluginType.cpp
new file mode 100644 (file)
index 0000000..b2d7ee8
--- /dev/null
@@ -0,0 +1,31 @@
+//
+// Created by v.cherepanov@samsung.com on 02.04.18.
+//
+
+#include <string>
+
+#include "PluginType.h"
+
+namespace nncc
+{
+namespace contrib
+{
+namespace plugin
+{
+
+std::string pluginTypeToStr(PluginType type)
+{
+  switch (type)
+  {
+  case typeFrontEnd:
+    return "FrontEnd";
+  case typeBackEnd:
+    return "BackEnd";
+  default:
+    return "Invalid";
+  }
+}
+
+} // namespace plugin
+} // namespace contrib
+} // namespace nncc