This commit introduces 'ann::OperandID' class to denote an
operand in Android NN network in a type-safe way.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
--- /dev/null
+#ifndef __ANN_IR_OPERAND_ID_H__
+#define __ANN_IR_OPERAND_ID_H__
+
+#include <cstdint>
+
+namespace ann
+{
+
+class OperandID
+{
+public:
+ OperandID() : _value{0}
+ {
+ // DO NOTHING
+ }
+
+public:
+ explicit OperandID(uint32_t value) : _value{value}
+ {
+ // DO NOTHING
+ }
+
+public:
+ uint32_t value(void) const { return _value; }
+
+private:
+ uint32_t _value;
+};
+
+} // namespace ann
+
+#endif // __ANN_IR_OPERAND_ID_H__
--- /dev/null
+#include "OperandID.h"
+
+#include <gtest/gtest.h>
+
+TEST(ANN_IR_OPERAND_ID, default_constructor)
+{
+ ann::OperandID id;
+
+ ASSERT_EQ(id.value(), 0);
+}
+
+TEST(ANN_IR_OPERAND_ID, explicit_constructor)
+{
+ ann::OperandID id{4};
+
+ ASSERT_EQ(id.value(), 4);
+}