nnc: plugin common lib (Plugin params) (#234)
authorVitaliy Cherepanov/SRR-AI Tools Lab/./삼성전자 <v.cherepanov@samsung.com>
Tue, 22 May 2018 23:02:24 +0000 (02:02 +0300)
committer박종현/동작제어Lab(SR)/Senior Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 22 May 2018 23:02:24 +0000 (08:02 +0900)
This library will be used by plugins and nnc for communication.

Implemented:
  - Plugin params. Will be used to declare plugin neccessary
    configuration parameters.

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

diff --git a/contrib/nnc/libs/plugin/include/PluginParam.h b/contrib/nnc/libs/plugin/include/PluginParam.h
new file mode 100644 (file)
index 0000000..0923ab7
--- /dev/null
@@ -0,0 +1,39 @@
+//
+// Created by v.cherepanov@samsung.com on 09.04.18.
+//
+
+#ifndef __PLUGIN_PARAM_H__
+#define __PLUGIN_PARAM_H__
+
+#include <string>
+
+namespace nncc
+{
+namespace contrib
+{
+namespace config
+{
+
+class PluginParam
+{
+public:
+  PluginParam() = delete;
+  PluginParam(const std::string &name, const std::string &desc, bool isOptional);
+
+  const std::string & getName() const;
+  const std::string & getDesc() const;
+  bool isOptional();
+
+protected:
+  std::string _name;
+  std::string _desc;
+  bool _isOptional;
+};
+
+std::ostream &operator<<(std::ostream &os, const PluginParam &param);
+
+} // namespace config
+} // namespace contrib
+} // namespace nncc
+
+#endif // __PLUGIN_PARAM_H__
diff --git a/contrib/nnc/libs/plugin/src/PluginParam.cpp b/contrib/nnc/libs/plugin/src/PluginParam.cpp
new file mode 100644 (file)
index 0000000..f862142
--- /dev/null
@@ -0,0 +1,36 @@
+//
+// Created by v.cherepanov@samsung.com on 09.04.18.
+//
+
+#include <ostream>
+#include <string>
+
+#include "PluginParam.h"
+
+namespace nncc
+{
+namespace contrib
+{
+namespace config
+{
+
+PluginParam::PluginParam(const std::string &name, const std::string &desc, bool isOptional)
+    : _name(name), _desc(desc), _isOptional(isOptional)
+{
+}
+
+const std::string & PluginParam::getName() const { return _name; }
+
+const std::string & PluginParam::getDesc() const { return _desc; }
+
+bool PluginParam::isOptional() { return _isOptional; }
+
+std::ostream &operator<<(std::ostream &os, const PluginParam &param)
+{
+  os << param.getName() << " " << param.getDesc();
+  return os;
+}
+
+} // namespace config
+} // namespace contrib
+} // namespace nncc