]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/DataBoards.h
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.databoard / cpp / DataBoardTest / DataBoard / DataBoards.h
1 #pragma once
2
3 #include "DataType.h"
4 #include "DataValue.h"
5
6 namespace Databoard {
7         namespace Util {
8
9
10
11                 Value* parse(std::string textValue, DataType* dataBoard)
12                 {
13                         return null;
14                 }
15
16                 DataType* parse(std::string textValue)
17                 {
18                         return null;
19                 }
20
21                 bool equals(DataType* a, DataType* b)
22                 {
23                         return false;
24                 }
25
26                 bool equals(DataType* type, Value* a, Value* b)
27                 {
28                         return false;
29                 }
30
31                 std::string toString(DataType* type)
32                 {
33                         return "";
34                 }
35
36                 std::string toString(Value* value)
37                 {
38                         return "";
39                 }
40
41                 /**
42                 * Compares its two data values for order.  Returns a negative integer,
43                 * zero, or a positive integer as the first argument is less than, equal
44                 * to, or greater than the second.<p>
45                 * 
46                 * The implementor must also ensure that the relation is transitive:
47                 * <tt>((compare(x, y)&gt;0) &amp;&amp; (compare(y, z)&gt;0))</tt> implies
48                 * <tt>compare(x, z)&gt;0</tt>.<p>
49                 *
50                 * Finally, the implementor must ensure that <tt>compare(x, y)==0</tt>
51                 * implies that <tt>sgn(compare(x, z))==sgn(compare(y, z))</tt> for all
52                 * <tt>z</tt>.<p>
53                 * 
54                 * The comparison function is defined at 
55                 * https://www.simantics.org/wiki/index.php/Org.simantics.databoard_Manual#CompareTo_and_Equals <p>
56                 * 
57                 * Note, comparing 2 different number types will not result a value comparison.
58                 * Instead values have the following type precedence ByteType, IntegerType, LongType,
59                 * FloatType, and the highest DoubleType. <p>
60                 *
61                 * @param o1 the first object to be compared.
62                 * @param o2 the second object to be compared.
63                 * @return a negative integer, zero, or a positive integer as the
64                 *              first argument is less than, equal to, or greater than the
65                 *              second.
66                 * @throws BindingException if object cannot be handled by a binding
67                 */
68
69                 int compare(Value* a, Value* b)
70                 {
71                         return 0;
72                 }
73         }
74 }