...
1namespace keyfield.sample;
2
3struct Baz {
4 a: [uint8:4] (key); // A fixed-sized array of uint8 as a Key
5 b: uint8 ;
6}
7
8struct Bar {
9 a: [float:3] (key); // A fixed-sized array of float as a Key
10 b: uint8;
11}
12
13struct Color {
14 rgb: [float:3] (key);
15 tag: uint8;
16}
17
18struct Apple {
19 tag: uint8;
20 color: Color(key);
21}
22
23struct Fruit {
24 a: Apple (key);
25 b: uint8;
26}
27
28struct Rice {
29 origin: [uint8:3];
30 quantity: uint32;
31}
32
33struct Grain {
34 a: [Rice:3] (key);
35 tag: uint8;
36}
37
38table FooTable {
39 a: int;
40 b: int;
41 c: string (key);
42 d: [Baz];
43 e: [Bar];
44 f: [Apple];
45 g: [Fruit];
46 h: [Grain];
47}
48root_type FooTable;
49
View as plain text