summaryrefslogtreecommitdiffstats
path: root/flatbuffers.7.md
diff options
context:
space:
mode:
Diffstat (limited to 'flatbuffers.7.md')
-rw-r--r--flatbuffers.7.md24
1 files changed, 22 insertions, 2 deletions
diff --git a/flatbuffers.7.md b/flatbuffers.7.md
index 5cde2d2..7f13b0b 100644
--- a/flatbuffers.7.md
+++ b/flatbuffers.7.md
@@ -1,4 +1,4 @@
-FLATBUFFERS 7 "JUNE 2017" Linux "User Manuals"
+FLATBUFFERS 7 "NOVEMBER 2017" Linux "User Manuals"
==============================================
NAME
@@ -192,6 +192,26 @@ DESCRIPTION
And example of usage, for the time being, can be found in `test.cpp/ReflectionTest()`.
+**Mini Reflection**
+
+ A more limited form of reflection is available for direct inclusion in generated code, which doesn't any (binary)
+ schema access at all. It was designed to keep the overhead of reflection as low as possible (on the order of 2-6
+ bytes per field added to your executable), but doesn't contain all the information the (binary) schema contains.
+
+ You add this information to your generated code by specifying `--reflect-types` (or instead `--reflect-names` if you
+ also want field / enum names).
+
+ You can now use this information, for example to print a FlatBuffer to text:
+
+ auto s = flatbuffers::FlatBufferToString(flatbuf, MonsterTypeTable());
+
+ `MonsterTypeTable()` is declared in the generated code for each type. The string produced is very similar to the JSON
+ produced by the `Parser` based text generator.
+
+ You'll need `flatbuffers/minireflect.h` for this functionality. In there is also a convenient visitor/iterator so you
+ can write your own output / functionality based on the mini reflection tables without having to know the FlatBuffers
+ or reflection encoding.
+
**Storing maps / dictionaries in a FlatBuffer**
FlatBuffers doesn't support maps natively, but there is support to emulate their behavior with vectors and binary
search, which means you can have fast lookups directly from a FlatBuffer without having to unpack your data into a
@@ -245,7 +265,7 @@ DESCRIPTION
Each root type will have a verification function generated for it, e.g. for `Monster`, you can call:
- bool ok = VerifyMonsterBuffer(Verifier(buf, len));
+ bool ok = VerifyMonsterBuffer(Verifier(buf, len));
if `ok` is true, the buffer is safe to read.