-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample_datamodel.xml
More file actions
67 lines (57 loc) · 2.47 KB
/
Copy pathsample_datamodel.xml
File metadata and controls
67 lines (57 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0" encoding="UTF-8"?>
<doc namespace="resource">
<imports>
<package>time</package>
<package no_persistence="true">uuid github.com/satori/go.uuid</package>
</imports>
<dbtypemappings>
<map from="guid" to="varchar(36)" />
<map from="string" to="varchar(%d)" fieldsize="128"/>
<map from="time" to="datetime" />
<map from="mediumblob" to="mediumblob" />
<map from="SensorState" to="int(11)" />
<map from="ActionType" to="int(11)" />
<map from="ActionStatus" to="int(11)" />
<map from="UserRole" to="int(11)" />
</dbtypemappings>
<gotypemappings>
<map from="guid" to="uuid.UUID" />
<map from="time" to="time.Time" />
<map from="mediumblob" to="[]byte"/>
<map from="float" to="float32" />
</gotypemappings>
<anytypemappings>
<map lang="cpp" from="string" to="std::string"/>
<map lang="cpp" from="guid" to="uuid_t" />
<map lang="cpp" from="time" to="std::tm" />
<map lang="cpp" from="mediumblob" to="uint8_t *"/>
<map lang="cpp" from="float" to="float" decode="atof(%s.c_str())"/>
<map lang="cpp" from="int" to="int32_t" encode="(int)%s" decode="atoi(%s.c_str())" />
<map lang="cpp" from="bool" to="bool" decode="(%s == "true")" />
<map lang="cpp" from="UserRole" to="UserRole" encode="(int)%s" decode="(UserRole)atoi(%s.c_str())" />
</anytypemappings>
<dbcontrol>
<host>localhost</host>
<dbname>sensors</dbname>
<user>sensors</user>
<password>sensors</password>
</dbcontrol>
<define type="enum" prefix="kUserRole_" name="UserRole">
<int name="UserRoleAdmin" value="1"/>
<int name="UserRoleUser" value="100"/>
</define>
<define type="class" prefix="m_" name="Subobject">
<field type="string" name="NameOfObject" />>
</define>
<define type="class" prefix="m_" name="Resource">
<field type="string" name="StringValue" />
<field type="int" name="IntValue" />
<field type="float" name="FloatValue" />
<field type="bool" name="Verified" />
<field type="UserRole" name="EnumValue"/>
<field type="int" islist="true" name="IntList" />
<field type="Subobject" name="Subba" />>
<field type="Subobject" name="SubList" islist="true" ispointer="true" />>
<field type="Subobject" name="PtrSubba" ispointer="true" />>
</define>
</doc>