Implement (shared) attribute for C++ (#5157)

* Implement native_shared attribute for C++.

Fixes #5141. See also #5145.

* Refine comment in idl.h

* Also refine docs

* Revert "Also refine docs"

This reverts commit 09dab7b45c.

* Also refine docs again.

* grumble
This commit is contained in:
iceboy
2019-02-11 11:53:45 -08:00
committed by Wouter van Oortmerssen
parent cf47f27164
commit 60e94cf083
4 changed files with 31 additions and 3 deletions

View File

@@ -258,6 +258,7 @@ struct FieldDef : public Definition {
: deprecated(false),
required(false),
key(false),
shared(false),
native_inline(false),
flexbuffer(false),
nested_flatbuffer(NULL),
@@ -273,6 +274,8 @@ struct FieldDef : public Definition {
// written in new data nor accessed in new code.
bool required; // Field must always be present.
bool key; // Field functions as a key for creating sorted vectors.
bool shared; // Field will be using string pooling (i.e. CreateSharedString)
// as default serialization behavior if field is a string.
bool native_inline; // Field will be defined inline (instead of as a pointer)
// for native tables if field is a struct.
bool flexbuffer; // This field contains FlexBuffer data.
@@ -608,6 +611,7 @@ class Parser : public ParserState {
known_attributes_["deprecated"] = true;
known_attributes_["required"] = true;
known_attributes_["key"] = true;
known_attributes_["shared"] = true;
known_attributes_["hash"] = true;
known_attributes_["id"] = true;
known_attributes_["force_align"] = true;