FlatBuffers.jl
FlatBuffers.jl copied to clipboard
Additional convenience macros for flatbuffer schema definition
trafficstars
Tracking issue for a few extra convenience macros that would make flatbuffer schema translation a little more straightforward:
- [x]
@enumtype T UInt8: sinceEnumin Julia isInt32by 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
We could also potentially subsume the @default macro into the @table macro to allow declaring defaults inline with the table definition.
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.
In the flatc branch I have coopted the Parameters.jl way of specifying defaults inline.