nnc: create AbstractSession class (#246)
authorVitaliy Cherepanov/AI Tools Lab/Engineer/삼성전자 <v.cherepanov@samsung.com>
Thu, 24 May 2018 14:09:30 +0000 (17:09 +0300)
committerSergey Vostokov/AI Tools Lab/Staff Engineer/삼성전자 <s.vostokov@samsung.com>
Thu, 24 May 2018 14:09:30 +0000 (17:09 +0300)
nnc: create AbstractSession class

This class will be used for plugin and nnc communication

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

diff --git a/contrib/nnc/libs/plugin/include/AbstractSession.h b/contrib/nnc/libs/plugin/include/AbstractSession.h
new file mode 100644 (file)
index 0000000..a4bffb1
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef __ABSTRACT_SESSION_H__
+#define __ABSTRACT_SESSION_H__
+
+#include <string>
+#include "PluginParam.h"
+#include "PluginType.h"
+
+namespace nncc
+{
+namespace contrib
+{
+namespace config
+{
+
+class AbstractSession
+{
+public:
+  AbstractSession() = default;
+
+  virtual void addInfo(const std::string &name, const std::string &value) = 0;
+  virtual void registerParam(const PluginParam &param) = 0;
+
+  plugin::PluginType getPluginType();
+  void setPluginType(plugin::PluginType pluginType);
+
+private:
+  plugin::PluginType _pluginType;
+};
+
+} // namespace config
+} // namespace contrib
+} // namespace nncc
+
+#endif // __ABSTRACT_SESSION_H__
diff --git a/contrib/nnc/libs/plugin/src/AbstractSession.cpp b/contrib/nnc/libs/plugin/src/AbstractSession.cpp
new file mode 100644 (file)
index 0000000..571956e
--- /dev/null
@@ -0,0 +1,17 @@
+#include "AbstractSession.h"
+#include "PluginType.h"
+
+namespace nncc
+{
+namespace contrib
+{
+namespace config
+{
+
+plugin::PluginType AbstractSession::getPluginType() { return _pluginType; }
+
+void AbstractSession::setPluginType(plugin::PluginType pluginType) { _pluginType = pluginType; }
+
+} // namespace config
+} // namespace contrib
+} // namespace nncc