* Add numpy accessor to python flatbuffers scalar vectors
* Update python tests to test numpy vector accessor
* Update appveyor CI to run Python tests, save generated code as artifact
* Update example generated python code
* Add numpy info to python usage docs
* Update test schema and python tests w/ multi-byte vector
* did not mean to push profiling code
* adding float64 numpy tests
* Rework flatbuffers + gRPC integration
- Introduce `flatbuffers::grpc::Message<T>`, a `grpc_slice`-backed
message buffer that handles refcounting and allows flatbuffers to
transfer ownership to gRPC efficiently. This replaces
`flatbuffers::BufferRef<T>`, which required a copy call and was also
unsafe w.r.t. buffer lifetime.
- Introduce `flatbuffers::grpc::MessageBuilder`, a gRPC-specific builder
that forces a `grpc_slice`-backed allocator and also adds some helpful
`Message<T>`-related methods.
- Update serializers accordingly (now zero-copy between flatbuffers and
gRPC).
* gRPC: verify messages by default, but allow user to override
* gRPC: fix some formatting issues
* Disable verification by default, but add helper method
* Make FlatBufferBuilder fields protected + remove vec accessor
* Use bool add_ref parameter to toggle refcount incr
* Remove unnecessary inline specifiers
* Fix formatting
* Use auto
* Remove empty lines
* Use grpc_slice helper macros
* Simplify reset code
* Disable Message copy ctor and assignment by default
* Remove unused member
* Enable gRPC verification by default
* Use auto
* Bake in message verification (remove template specialization)
* Add RoundUp func
* Consolidate gRPC message copy flag
* Make vector_downward allocations fully lazy
* Test message verification failure code/message
* Add grpctest verification test comments
* Simplify reallocate implementation
* Make initial_size a size_t
* Use ternary op for growth_policy
* Use truthiness rather than dont explicit nullptr check
* Indent preprocessor directives
* Remove grpc message copy/assignment
* Fix a few bugs
* Add gRPC example
* Add basic gRPC docs
* Use doxygen EXAMPLE_PATH + @include
* Reference example fbs in grpc docs
* Move gRPC examples into grpc/samples
* Fix pointer/reference formatting
* Use std::function rather than templated callback func
* Create fresh message builder for each request
* Use Clear() in Reset() impl
* Use FLATBUFFERS_CONSTEXPR
Since it wasn't documented and very different from a vector of
tables, this has caused a lot of confusion in the past.
Change-Id: Iab47c61b55c19abe5c4f25c86d71335a6b6321ca
(C++ only for now).
Also fixed vector of union support in the object API.
Bug: 36902939
Change-Id: I935f4cc2c303a4728e26c7916a8ec0adcd6f84cb
Tested: on Linux.
Allow tables to be mapped to native types directly. For example, a table
representing a vector3 (eg. table Vec3 { x:float; y:float; z:float; }) can
be mapped to a "mathfu::vec3" native type in NativeTables. This requires
users to provide Pack and UnPack functions that convert between the
Table and native types. This is done by adding the "native_type" attribute
to the table definition.
To support user-defined flatbuffers::Pack and flatbuffers::UnPack functions,
support a "native_include" markup that will generate a corresponding
Also add an UnPackTo function which allows users to pass in a pointer to
a NativeTable object into which to UnPack the Table. The existing UnPack
function is now simply:
NativeTable* UnPack() {
NativeTable* obj = new NativeTable();
Table::UnPackTo(obj);
return obj;
}
Finally, allow native types to be given a default value as well which are
set in the NativeTable constructor. This is done by providing a
"native_default" attribute to the member of a table.
Change-Id: Ic45cb48b0e6d7cfa5734b24819e54aa96d847cfd
Also fixed structs not being created inline in the tutorial,
which would actually have bad consequences if used.
Change-Id: Idce215c61a1b24a297cee76f625052bb2722e970
This allows hashed string fields to be used for lookup of any
C++ objects, a pointer to which are then stored in the object
besides the original hash for easy access.
Change-Id: I2247a13c349b905f1c54660becde2c818ad23e97
Tested: on Linux.
Bug: 30204449
This was a frequent source of confusion, since in all implementations
the data doesn't start at offset 0 in the buffer.
Change-Id: I045966e65928e9acd9def84e215914ecb5510653