Commit Graph

143 Commits

Author SHA1 Message Date
Wouter van Oortmerssen 4b27c92910 Misc documentation fixes.
Change-Id: Id7be5baba7d8a11ca050e8d94d95857406690378
2017-08-10 11:25:13 -07:00
Wouter van Oortmerssen 8a2cc7cc4e Linked to Mikkel's binary format documentation.
Change-Id: I5054e37833d59bbe925cac2000a453fbee8ef54b
2017-08-07 14:53:54 -07:00
Kevin Rose 3282a84e30 [Python] (scalar) vector reading speedup via numpy (#4390)
* 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
2017-08-01 08:34:00 -07:00
Wouter van Oortmerssen dddd0865cb Added nested FlexBuffer parsing
Change-Id: I918b66eb5646d035e3aae675f745802eb54b03ea
2017-06-12 14:34:45 -07:00
Lawrence Chan da67c0a71f [C++] Improve flatbuffers + gRPC integration (#4310)
* 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
2017-06-07 13:56:49 -07:00
Wouter van Oortmerssen 398ae0cb6b Some code in the samples and docs still used old C# API.
Change-Id: I7914c88ad7b31baa7586771423069dc2b90d534f
Tested: on Linux.
2017-05-22 15:14:46 -07:00
Wouter van Oortmerssen 262e1d7bf9 Updated tutorial with a vector of structs example.
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
2017-05-15 13:41:27 -07:00
Wouter van Oortmerssen 93c0960c3a Added --keep-prefix to not strip schema include path in C++ includes.
Change-Id: I3c6356fc6664072796f273096df64829108b4a34
Tested: on Linux.
2017-05-10 13:21:20 -07:00
Wouter van Oortmerssen 8468ea1ab4 Fixed LookupByKey for Java & C#
Change-Id: I05c02223675dee241d1ae8cb466e5186444058c8
Tested: on Linux.
2017-05-10 12:55:27 -07:00
Wouter van Oortmerssen b0752e179b Added support for structs and strings in unions.
(C++ only for now).
Also fixed vector of union support in the object API.

Bug: 36902939
Change-Id: I935f4cc2c303a4728e26c7916a8ec0adcd6f84cb
Tested: on Linux.
2017-04-12 17:47:47 -07:00
Alexander Gallego f2071e4f80 Add arbitrary string type to the native object API (#4218)
* Custom strings are very common for optimizations around small objects
  or growth style optimizations, i.e.: grow at 1.57 times vs doubling vs..

  A second common strategy is to cooperate w/ the memory allocator
  see FBString[1] and seastar[2] string for examples.

[1] fbstring: https://github.com/facebook/folly/blob/master/folly/docs/FBString.md
[2] sstring: https://github.com/scylladb/seastar/blob/master/core/sstring.hh
2017-03-20 16:02:04 -07:00
Aaron Hudon d9bc5ec047 fixed flag for javascript (#4223)
--javascript flag does not work in the 1.6 flatc.exe, changed to --js
2017-03-15 15:16:43 -07:00
Dale Lukas Peterson bb22fb5756 Fix broken symlink to CONTRIBUTING.md (#4212) 2017-03-08 13:16:11 -08:00
Zarian Waheed ac106e835c Fixing broken link and added missing <map> header include. (#4199) 2017-03-03 09:47:52 -08:00
Wouter van Oortmerssen 1fb6b9ee6f Added doc comments to the binary schema.
Change-Id: I87f291ab6e07b1425850cae25ed500db594f17c8
Tested: on Linux.
2017-02-13 16:47:17 -08:00
Wouter van Oortmerssen 2272229983 Added --prefix-include option for generated includes.
Change-Id: I288cda33345362f9aec5cbe309e590bf64f328e1
Tested: on Linux.
2017-02-10 13:24:54 -08:00
Wouter van Oortmerssen d7ba17dfe5 Changes to make flatbuffers javascript compatible with the closure compiler.
Change-Id: Iab8d66a8f34910029deb8a5ff5ec7ba50c5b3421
2017-02-08 17:14:35 -08:00
Wouter van Oortmerssen 60b11435e6 Fixed missing '
Change-Id: I25110bbb171a27626ec6416b810399069d590279
2017-02-08 17:04:44 -08:00
Wouter van Oortmerssen aac6be1153 First attempt at SchemaLess FlatBuffers.
Change-Id: I86b9d002f3441ef9efdb70e059b8530ab2d74bb8
Tested: on Linux.
2017-02-08 15:13:56 -08:00
Bei Li 68bbe983e9 Union Vector 2017-01-24 11:52:36 -08:00
Wouter van Oortmerssen 3f936c5655 More native code gen functionality.
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
2017-01-18 16:23:35 -08:00
Wouter van Oortmerssen 81b6bacead Documentation improvements: style guide & guide lines.
Bug: 22346508
Change-Id: I3f6e6b2811adaaf9d79faca8cdd00af3927299b5
2016-12-19 16:04:08 -08:00
Wouter van Oortmerssen af21b9064d Change docs to not encourage use of 1 byte buffers.
Change-Id: Ib0b1692044f35e374a0f7c0359c94319f4a25619
2016-10-24 10:29:09 -07:00
Wouter van Oortmerssen dae513e0e7 Made nesting vs inline clearer in the docs.
Also fixed structs not being created inline in the tutorial,
which would actually have bad consequences if used.

Change-Id: Idce215c61a1b24a297cee76f625052bb2722e970
2016-10-21 15:22:14 -07:00
Wouter van Oortmerssen d9fe4e2769 Allow other pointer types than unique_ptr for object API.
Change-Id: I945890ce667a2f5a6c0495e78fd5326ed33b9914
Tested: on Linux.
Bug: 30135763
2016-10-17 09:54:52 -07:00
Wouter van Oortmerssen f9025eeb52 Clarified tutorial w.r.t reading/writing buffers.
Bug: 30736848

Signed-off-by: Wouter van Oortmerssen <wvo@google.com>
2016-10-12 14:30:31 -07:00
Wouter van Oortmerssen dc2fa215b8 External references for the object API thru a resolver function.
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
2016-10-12 11:22:20 -07:00
Wouter van Oortmerssen 49ee30a207 Merge pull request #3978 from TGIshib/key
Find by key on C# and Java (2)
2016-08-26 12:03:28 -07:00
TGIshib 9f16090f90 Improve `LookupByKey` , update docs 2016-08-22 18:10:52 +03:00
Wouter van Oortmerssen eba6b6f7c9 1.4 prep fixes
Change-Id: I001ad8dd5f95e6e5ad43daf956663218d19f5c96
2016-08-15 17:29:35 -07:00
Wouter van Oortmerssen 18d67ed83b Clarified in the docs how to get to the serialized bytes.
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
2016-08-10 17:53:40 -07:00
Caleb Epstein c9ee9fb99d Merge branch 'master' of https://github.com/google/flatbuffers
* 'master' of https://github.com/google/flatbuffers:
  Added AppVeyor CI.
  Removed pre-made VS2010 and XCode projects.
2016-07-28 08:33:35 -04:00
Caleb Epstein 50e13ef9c6 Need unique_ptr.get not pointee.get 2016-07-28 08:31:19 -04:00
Wouter van Oortmerssen 03adfa7b1a Merge branch 'master' of https://github.com/google/flatbuffers 2016-07-27 17:20:35 -07:00
Wouter van Oortmerssen 97a9a82324 Removed pre-made VS2010 and XCode projects.
CMake is now required on all platforms.

Change-Id: Iad81d9244a05ed70ce8b8860d6b729a873f137c1
Tested: on Windows and OS X.
2016-07-27 17:10:37 -07:00
Caleb Epstein 094f4d1bad Fix docs for object API usage 2016-07-27 16:15:55 -04:00
Wouter van Oortmerssen 05b00c50ad Added way to test two schemas for safe evolution.
Change-Id: I1dfc867e6df5932ab61dad431eb3cb02f15d04df
Tested: on Linux.
Bug: 30202327
2016-07-20 17:56:59 -07:00
Wouter van Oortmerssen 91f5cf357c Merge branch 'master' of https://github.com/google/flatbuffers into grpc2 2016-07-20 17:41:36 -07:00
Wouter van Oortmerssen 3101e327c0 Added optional object based API for C++.
Change-Id: If927f3ea3fb3723088fa287f24bdd1ad43c8d1d1
Tested: on Linux.
2016-07-20 14:58:57 -07:00
Muhammed Thanish 53e9606ea2 Implement mutators for Go 2016-07-20 22:58:22 +05:30
Yakir Buskilla 298dd21ec8 fixed ArrayOutOfBoundsException in java example 2016-07-20 10:46:43 +03:00
Louis Cognault c94cb6dae9 Fixed typo
is => it
2016-07-01 17:22:36 +02:00
Wouter van Oortmerssen 48f37f9e0a Added GRPC code generator to flatc.
Also added simple (in-process) test.

Change-Id: I38580d554dd52f590e3396ec4846e07546dcf07d
Tested: on Linux.
2016-06-29 15:51:44 -07:00
Wouter van Oortmerssen d3ac0bc149 Added conversion operations that can be used inline in JSON.
e.g.: { myfield: cos(rad(180)) } is equivalent to writing { myfield: -1.0 }

Bug: 29338398
Change-Id: I6fc4ef1fd10bda3ba78cba464414dd071a2f50ca
Tested: on Linux.
2016-06-15 14:54:44 -07:00
Wouter van Oortmerssen afa276288c Added additional convenience overloads to CreateVector().
Bug: 29337887, 29336299
Change-Id: Iad8b3b2263f6cea7ee7e45994369194960df293b
Tested: on Linux.
2016-06-15 14:31:34 -07:00
Wouter van Oortmerssen a82dbb6e01 Fixed Google Groups link in documentation.
Change-Id: I64307ccd0a6f23a7c3860d602813e637415e7c91
2016-05-23 14:08:21 -07:00
Mahmut Ali ÖZKURAN 747a8c628e Fixed Library Location in CppUsage.md
Fixed Library Location 
"https://github.com/google/flatbuffers/tree/master/include/flatbuffers"
in CppUsage.md
2016-05-18 12:02:32 +03:00
Wouter van Oortmerssen ec1daef858 Merge pull request #3832 from mikkelfj/c_docs
Documentation for C bindings
2016-04-08 10:54:27 -07:00
Mikkel Fahnøe Jørgensen 7d396bc2e7 Update C documentation with supported MSVC versions, and other minor updates. 2016-04-07 18:52:00 +02:00
Wouter van Oortmerssen 5e3f9d5175 Merge branch 'master' of https://github.com/google/flatbuffers 2016-04-04 16:55:25 -07:00