FlatBuffers.jl icon indicating copy to clipboard operation
FlatBuffers.jl copied to clipboard

Additional convenience macros for flatbuffer schema definition

Open quinnj opened this issue 9 years ago • 3 comments
trafficstars

Tracking issue for a few extra convenience macros that would make flatbuffer schema translation a little more straightforward:

  • [x] @enumtype T UInt8: since Enum in Julia is Int32 by default and flatbuffers allows declaring an enums size
  • [ ] @table type Foo ...: would detect if any union fields are included in the table and add the additional union_type field, as well as provide additional constructors to detect the union_type automatically
  • [x] @struct immutable Bar ...: would detect any additional padding fields needed to ensure the struct is aligned according to the largest field member size

quinnj avatar Jun 08 '16 16:06 quinnj

We could also potentially subsume the @default macro into the @table macro to allow declaring defaults inline with the table definition.

quinnj avatar Jun 08 '16 16:06 quinnj

Also as a breadcrumb, after a conversation with @yuyichao, I'm pretty sure we can just declare these macros inside the package itself and export instead of needing them in the src/header.jl file to be included.

quinnj avatar Jun 08 '16 16:06 quinnj

In the flatc branch I have coopted the Parameters.jl way of specifying defaults inline.

rjkat avatar Nov 22 '18 01:11 rjkat