native_include "native_type_test_impl.h";

namespace Geometry;

struct Vector3D (native_type:"Native::Vector3D") {
  x:float;
  y:float;
  z:float;
}

struct Vector3DAlt (native_type:"Native::Vector3D", native_type_pack_name:"Vector3DAlt") {
  a:float;
  b:float;
  c:float;
}

table Matrix (native_type:"Native::Matrix") {
  rows:int32;
  columns:int32;
  values:[float];
}

// A struct whose native type is a template, instantiated differently per
// field via `native_type_template_arg` instead of needing one flatbuffers
// struct declaration per specialization (compare to Vector3D/Vector3DAlt
// above).
struct Tagged (native_type_template: "Native::Tagged<{{T}}>") {
  value:int32;
}

// A native type template that takes more than one argument.
struct Pair (native_type_template: "Native::Pair<{{T0}}, {{T1}}>") {
  value:int32;
}

table ApplicationData {
  vectors:[Vector3D];
  vectors_alt:[Vector3DAlt];
  position:Vector3D;
  position_inline:Vector3D (native_inline);
  matrix:Matrix;
  matrices:[Matrix];
  tagged_a:Tagged (native_inline, native_type_template_arg: "Native::TagA");
  tagged_b:Tagged (native_inline, native_type_template_arg: "Native::TagB");
  pair_ab:Pair (native_inline, native_type_template_arg: "Native::TagA, Native::TagB");
}

root_type ApplicationData;
