Skip to content

Instantly share code, notes, and snippets.

@ennerf

ennerf/bench.fbs Secret

Created December 11, 2015 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ennerf/cb7999bd30973acaf794 to your computer and use it in GitHub Desktop.
Save ennerf/cb7999bd30973acaf794 to your computer and use it in GitHub Desktop.
// 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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment