1struct LeafStruct { 2 a:int; 3 b:double; 4} 5 6table WrapperTable { 7 // A normal 32-bit sized vector that could be very far away (64-bit address). 8 vector:[int8] (offset64); 9} 10 11table RootTable { 12 // A normal 32-bit sized vector, that could be very far away (64-bit address). 13 far_vector:[ubyte] (offset64); 14 15 // An inplace value just to check that vtable offsets are correct. 16 a:int; 17 18 // A normal 32-bit sized string, that could be very far away (64-bit address). 19 far_string:string (offset64); 20 21 // A big 64-bit sized vector, that could be very far away (64-bit address). 22 big_vector:[ubyte] (vector64); 23 24 // A normal 32-bit sized string that is no far away (32-bit address). 25 near_string:string; 26 27 // A big 64-bit sized vector that is a nested flatbuffers (64-bit address). 28 nested_root:[ubyte] (vector64, nested_flatbuffer: "RootTable"); 29 30 // A normal 32-bit size vector of structs, that could be very far away 31 // (64-bit address) 32 far_struct_vector:[LeafStruct] (offset64); 33 34 // A big 64-bit size vector of structs that could be very far away 35 // (64-bit address) 36 big_struct_vector:[LeafStruct] (vector64); 37 38 // A normal 32-bit size vector of tables. Currently 64-bit vectors don't 39 // support tables as it would require serializing a table (32-bit) before the 40 // vector (64-bit), which is not allowed. 41 // 42 // This demonstrates how you could have many vectors in the buffer, by 43 // effectively having a vector of 64-bit vectors. The IDL doesn't support 44 // nested vecotrs (e.g.: [[type]] ), so going through a wrapper table allows 45 // this. 46 many_vectors:[WrapperTable]; 47 48 // A vector that has force_align to test that the 32/64 bit region of the 49 // builder is respected. 50 forced_aligned_vector:[ubyte] (vector64, force_align:32); 51} 52 53root_type RootTable; 54