aboutsummaryrefslogtreecommitdiff
path: root/flatcc/test/benchmark/schema/flatbench.fbs
blob: 34bd2df36379724f81b9208354544664ddf54eaa (plain)
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
// trying to represent a typical mix of datatypes:
// 1 array of 3 elements, each element: 1 string, 3 nested objects, 9 scalars
// root element has the array, additional string and an enum

namespace benchfb;

enum Enum : short { Apples, Pears, Bananas }

struct Foo {
  id:ulong;
  count:short;
  prefix:byte;
  length:uint;
}

struct Bar {
  parent:Foo;
  time:int;
  ratio:float;
  size:ushort;
}

table FooBar {
  sibling:Bar;
  name:string;
  rating:double;
  postfix:ubyte;
}

table FooBarContainer {
  list:[FooBar];  // 3 copies of the above
  initialized:bool;
  fruit:Enum;
  location:string;
}

root_type FooBarContainer;