From: Vitaliy Cherepanov/SRR-AI Tools Lab/./삼성전자 Date: Tue, 22 May 2018 23:02:24 +0000 (+0300) Subject: nnc: plugin common lib (Plugin params) (#234) X-Git-Tag: nncc_backup~2678 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8abecd52c3d6e864212b2b405fe4e5f6adf96a11;p=platform%2Fcore%2Fml%2Fnnfw.git nnc: plugin common lib (Plugin params) (#234) 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 --- diff --git a/contrib/nnc/libs/plugin/include/PluginParam.h b/contrib/nnc/libs/plugin/include/PluginParam.h new file mode 100644 index 0000000..0923ab7 --- /dev/null +++ b/contrib/nnc/libs/plugin/include/PluginParam.h @@ -0,0 +1,39 @@ +// +// Created by v.cherepanov@samsung.com on 09.04.18. +// + +#ifndef __PLUGIN_PARAM_H__ +#define __PLUGIN_PARAM_H__ + +#include + +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 ¶m); + +} // 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 index 0000000..f862142 --- /dev/null +++ b/contrib/nnc/libs/plugin/src/PluginParam.cpp @@ -0,0 +1,36 @@ +// +// Created by v.cherepanov@samsung.com on 09.04.18. +// + +#include +#include + +#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 ¶m) +{ + os << param.getName() << " " << param.getDesc(); + return os; +} + +} // namespace config +} // namespace contrib +} // namespace nncc