]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/DataValue.h
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / cpp / DataBoardTest / DataBoard / DataValue.h
1 #pragma once
2
3 namespace Databoard {
4         namespace Value {
5
6
7                 class Value {
8                 public:
9                         Value();
10                         virtual ~Value() = 0; // meniks tää näin..
11                 };
12
13
14                 class Integer : public Value {
15                 public:
16                         Integer();
17                         Integer(int value);
18
19                         virtual ~Integer();
20
21                         int getValue();
22                         void setValue(int value);
23
24                 protected:
25
26                         int value;
27                 };
28
29
30
31                 class Array : public Value {
32                 public:
33                         virtual int size() = 0;
34                         virtual Value get(int index) = 0;
35                 };
36
37
38
39                 class GenericArray : public Array {
40                 public:
41                         Value get(int index) { return values.get(index); }
42                 private:
43                         std::vector<Value> values;
44                 };
45
46
47                 class ByteArray : public Array {
48                 public:
49                         Value get(int index) { return null; }
50                         char* getPrimitiveArray() { return null; }
51                 private:
52                         std::vector<char> values;
53                 };
54
55                 class Double : public Value {
56                 public:
57                         double getValue() { return value; }
58                 private:
59                         double value;
60                 }
61         }
62 }