From: 박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 Date: Mon, 16 Jul 2018 09:38:16 +0000 (+0900) Subject: [nest] Add 'Bound' class (#668) X-Git-Tag: nncc_backup~2414 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a9bd209c3dcd4d152e8d19904d1f40af7b9d0c3;p=platform%2Fcore%2Fml%2Fnnfw.git [nest] Add 'Bound' class (#668) This commit adds 'Bound' class which expresses value range of each variable as min/max. Signed-off-by: Jonghyun Park --- diff --git a/contrib/nest/include/nest/Bound.h b/contrib/nest/include/nest/Bound.h new file mode 100644 index 0000000..bad28c5 --- /dev/null +++ b/contrib/nest/include/nest/Bound.h @@ -0,0 +1,31 @@ +#ifndef __NEST_BOUND_H__ +#define __NEST_BOUND_H__ + +#include + +namespace nest +{ + +class Bound +{ +public: + Bound() = default; + +public: + Bound(int64_t min, int64_t max) : _min{min}, _max{max} + { + // DO NOTHING + } + +public: + int64_t min(void) const { return _min; } + int64_t max(void) const { return _max; } + +private: + int64_t _min; + int64_t _max; +}; + +} // namespace nest + +#endif // __NEST_BOUND_H__ diff --git a/contrib/nest/src/Bound.test.cpp b/contrib/nest/src/Bound.test.cpp new file mode 100644 index 0000000..6a7c83d --- /dev/null +++ b/contrib/nest/src/Bound.test.cpp @@ -0,0 +1,11 @@ +#include "nest/Bound.h" + +#include + +TEST(BOUND, ctor) +{ + const nest::Bound b{-10, 20}; + + ASSERT_EQ(b.min(), -10); + ASSERT_EQ(b.max(), 20); +}