Added functionality to assign field ids manually in a schema
authorWouter van Oortmerssen <wvo@google.com>
Tue, 8 Jul 2014 00:34:23 +0000 (17:34 -0700)
committerWouter van Oortmerssen <wvo@google.com>
Tue, 8 Jul 2014 18:12:33 +0000 (11:12 -0700)
commit9140144d5161124623a27cf8b8038f6e7c9bb74d
tree6de4711541f7032d17a1f6e473ed92dda55a3011
parenta5f50019bc979c352bb7e0c08b8bbfd8ab06af4d
Added functionality to assign field ids manually in a schema

New attribute:

-   `id: n` (on a table field): manually set the field identifier to `n`.
    If you use this attribute, you must use it on ALL fields of this table,
    and the numbers must be a contiguous range from 0 onwards.
    Additionally, since a union type effectively adds two fields, its
    id must be that of the second field (the first field is the type
    field and not explicitly declared in the schema).
    For example, if the last field before the union field had id 6,
    the union field should have id 8, and the unions type field will
    implicitly be 7.
    IDs allow the fields to be placed in any order in the schema.
    When a new field is added to the schema is must use the next available ID.

Change-Id: I8690f105f3a2d31fdcb75a4fab4130692b12c62f
Tested: on Windows
docs/html/md__cpp_usage.html
docs/html/md__schemas.html
docs/source/Schemas.md
src/flatc.cpp
src/idl_parser.cpp
tests/MyGame/Example/Monster.java
tests/monster_test.fbs
tests/monster_test_generated.h