]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/DataValue.h
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.databoard / cpp / DataBoardTest / DataBoard / DataValue.h
diff --git a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/DataValue.h b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/DataValue.h
new file mode 100644 (file)
index 0000000..7ca1af1
--- /dev/null
@@ -0,0 +1,62 @@
+#pragma once\r
+\r
+namespace Databoard {\r
+       namespace Value {\r
+\r
+\r
+               class Value {\r
+               public:\r
+                       Value();\r
+                       virtual ~Value() = 0; // meniks tää näin..\r
+               };\r
+\r
+\r
+               class Integer : public Value {\r
+               public:\r
+                       Integer();\r
+                       Integer(int value);\r
+\r
+                       virtual ~Integer();\r
+\r
+                       int getValue();\r
+                       void setValue(int value);\r
+\r
+               protected:\r
+\r
+                       int value;\r
+               };\r
+\r
+\r
+\r
+               class Array : public Value {\r
+               public:\r
+                       virtual int size() = 0;\r
+                       virtual Value get(int index) = 0;\r
+               };\r
+\r
+\r
+\r
+               class GenericArray : public Array {\r
+               public:\r
+                       Value get(int index) { return values.get(index); }\r
+               private:\r
+                       std::vector<Value> values;\r
+               };\r
+\r
+\r
+               class ByteArray : public Array {\r
+               public:\r
+                       Value get(int index) { return null; }\r
+                       char* getPrimitiveArray() { return null; }\r
+               private:\r
+                       std::vector<char> values;\r
+               };\r
+\r
+               class Double : public Value {\r
+               public:\r
+                       double getValue() { return value; }\r
+               private:\r
+                       double value;\r
+               }\r
+       }\r
+}
\ No newline at end of file