- Feb 10, 2017
-
-
Wouter van Oortmerssen authored
Change-Id: I288cda33345362f9aec5cbe309e590bf64f328e1 Tested: on Linux.
-
- Feb 09, 2017
-
-
Wouter van Oortmerssen authored
Change-Id: Iab8d66a8f34910029deb8a5ff5ec7ba50c5b3421
-
- Feb 01, 2017
-
-
Wouter van Oortmerssen authored
It passed all scalar ints thru a int64_t, which would truncate uint64_t values with the upper bit set. Change-Id: I38fb8c68c911ae44d9863f8e35c2429ca0ab51e5 Tested: on Linux.
-
- Jan 27, 2017
-
-
Wouter van Oortmerssen authored
Change-Id: Iade313c99f119dcf1619674260648a33f61dc030
-
- Jan 24, 2017
-
-
Bei Li authored
-
- Jan 19, 2017
-
-
Wouter van Oortmerssen authored
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
-
- Jan 14, 2017
-
-
Wouter van Oortmerssen authored
Helps simplify code generation code. Instead of this: code += "inline const " + cpp_qualified_name + " *Get"; code += name; code += "(const void *buf) {\n return flatbuffers::GetRoot<"; code += cpp_qualified_name + ">(buf);\n}\n\n"; You do this: code.SetValue("NAME", struct_def.name); code.SetValue("CPP_NAME", cpp_qualified_name); code += "inline const {{CPP_NAME}} *Get{{NAME}}(const void *buf) {"; code += " return flatbuffers::GetRoot<{{CPP_NAME}}>(buf);"; code += "}"; code += ""; Updated the CPP code generator to use the CodeWriter class. Most of the changes in the generated code are white-space changes, esp. around new lines (since the code generator class automatically appends new lines when appending a string). Actual code changes include: * Renamed "rehasher" to "_rehasher" for consistency with other args in Pack function. * Renamed "union_obj" to "obj: in UnPack function. * Always do "(void)_o;" to prevent unused variable warning in Create function (instead of only doing it if there are no fields) in order to avoid two-passes. * Renamed padding variables from __paddingX to paddingX__. "Each name that contains a double underscore (_ _) [...] is reserved to the implementation for any use." C++ standards 17.4.3.1.2. * Add braces around switch cases. * Calculate index as a separate statement in EnumName function, eg. const size_t index = ...; return EnumNamesX()[index]; vs. return EnumNamesX()[...]; * Stored end table offset in variable in Finish() functions, eg. const auto end = fbb_.EndTable(start_, ...); auto o = flatbuffers::Offset<T>(end); vs. auto o = flatbuffers::Offset<T>(fbb_.EndTable(start, ...)); * Separate reinterpret_cast calls from function calls in Union functions, eg. auto ptr = reinterpret_cast<const T *>(obj); return ptr->UnPack(resolver); vs. return reinterpret_cast<const T *>(obj)->UnPack(resolver); * Removed unecessary (void)(padding__X) no-ops from constructors, eg. Test(int16_t a, int8_t b) : ... { (void)__padding0; // <-- Removed this line. } In the idl_gen_cpp.cpp file itself, I refactored some code generation into new functions: GenParam, GenNativeTable, GenVerifyCall, GenBuilders, GenUnpackFieldStatement, and GenCreateParam. Change-Id: I727b1bd8719d05b7ce33cbce00eb58fda817b25d
-
- Dec 14, 2016
-
-
Wouter van Oortmerssen authored
Change-Id: I7d23fa3416feb78ea18d2c451e7b4e1d9be11bfc
-
- Dec 05, 2016
-
-
Ronak Jain authored
* support for grpc golang * refactored grpc go generator * added grpc-go test and refactored * refactored idl_gen_grpc.cpp * fixed grpc generate method name * refactored flatc and fixed line length issue * added codec to go lib and fixed formatting issues * fixed spacing issues
-
- Dec 02, 2016
-
-
Wouter van Oortmerssen authored
Introduce a "native_inline" attribute that can be applied on fields that are structs. This results in NativeTable code generation that sets the struct "inline" rather than storing it in a pointer. From cl/140527470. Change-Id: I208724f552b8b921b20923e0bf82f42cb3582416
-
- Oct 17, 2016
-
-
Wouter van Oortmerssen authored
Change-Id: I945890ce667a2f5a6c0495e78fd5326ed33b9914 Tested: on Linux. Bug: 30135763
-
- Oct 12, 2016
-
-
Wouter van Oortmerssen authored
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
-
- Aug 18, 2016
-
-
Ben Hamilton authored
-
- Aug 01, 2016
-
-
Ben Hamilton authored
-
- Jul 29, 2016
-
-
Wouter van Oortmerssen authored
Change-Id: Ia78dd3b0f213e9ffa49dcec699dcbb21fe6517da Tested: on Linux.
-
- Jul 21, 2016
-
-
Wouter van Oortmerssen authored
Change-Id: I1dfc867e6df5932ab61dad431eb3cb02f15d04df Tested: on Linux. Bug: 30202327
-
- Jul 20, 2016
-
-
Wouter van Oortmerssen authored
Change-Id: If927f3ea3fb3723088fa287f24bdd1ad43c8d1d1 Tested: on Linux.
-
- Jul 09, 2016
-
-
Raman authored
-
- Jul 04, 2016
-
-
Raman authored
-
- Jul 01, 2016
-
-
吴凡 authored
-
- Jun 29, 2016
-
-
Wouter van Oortmerssen authored
Also added simple (in-process) test. Change-Id: I38580d554dd52f590e3396ec4846e07546dcf07d Tested: on Linux.
-
- Jun 20, 2016
-
-
Wouter van Oortmerssen authored
This is useful because many JSON generators will sort the fields, cause X_type to follow X. Change-Id: I00ef3ac05418224fc05aee93e6b3b3597e73ffe3 Tested: on Linux. Bug: 29221752
-
- Apr 13, 2016
-
-
Wouter van Oortmerssen authored
Change-Id: I3730a6823d603982c4250d514e827e3f93d1f81e Tested: on Linux.
-
- Apr 12, 2016
-
-
Wouter van Oortmerssen authored
Tested: on Linux. Bug: 27923233 Change-Id: Ic16675650e4a8e138c163f1e2131a3aad7008ada
-
- Mar 29, 2016
-
-
Nnamdi authored
To support the use case described in issue google/flatbuffers#3826, a new command line option --gen-name-strings has been added, which will cause a static GetFullyQualifiedName function to be added to the C++ output for tables/structs.
-
- Mar 09, 2016
-
-
Wouter van Oortmerssen authored
Change-Id: Ia8651c1051808fdda0dc0ba52ec991777f868e88 Tested: on Linux.
-
Wouter van Oortmerssen authored
This is the first step in RPC support. Actual code generation to follow. Change-Id: I96c40fec3db671d100dd9eb509a71c5cbe55bfb2 Tested: on Linux. Bug: 20122696
-
- Mar 08, 2016
-
-
Wouter van Oortmerssen authored
Change-Id: I6a3fae1e71434a7384edc39b8602bd84a0432edb Tested: on Linux. Bug: 24140897
-
- Jan 21, 2016
-
-
Oli Wilkinson authored
Added support for C# partial class generation when the `csharp_partial` attribute is used on a table/struct.
-
- Jan 18, 2016
-
-
Oli Wilkinson authored
-
- Jan 09, 2016
-
-
Chandra Penke authored
- Removed uses of lambda expressions - Added custom defines for constexpr and nullptr - Removed trailing comma of last value from generated enums
-
- Dec 30, 2015
-
-
Wouter van Oortmerssen authored
Change-Id: Ieb252ce01446551699d935507bc95ee286fe1ddd Tested: on Linux.
-
- Dec 22, 2015
-
-
Nalinichandra Penke authored
-
- Dec 21, 2015
-
-
Wouter van Oortmerssen authored
This to allow the code to run on a greater range of build configurations (that don't allow exceptions/RTTI). If anyone ever doubts the usefulness of exception handling, please show them this commit. Change-Id: If7190babdde93c3f9cd97b8e1ab447bf0c81696d Tested: on Linux.
-
- Dec 04, 2015
-
-
Wouter van Oortmerssen authored
Also refactored the way options are stored. Change-Id: I709ac908cd2aba396c9c282725cf1d42ccce0882 Tested: on Linux.
-
- Dec 02, 2015
-
-
Wouter van Oortmerssen authored
Thanks @Chaosvex for reporting. Change-Id: I73f60ab0bf875a3e0849eaec5f42f6d036881094 Tested: on Linux.
-
- Nov 25, 2015
-
-
Wouter van Oortmerssen authored
Thanks @Chaosvex for reporting. Change-Id: I73f60ab0bf875a3e0849eaec5f42f6d036881094 Tested: on Linux.
-
- Nov 17, 2015
-
-
Shuhei Taunma authored
* codegen for all basic features: WIP (probably implemented all basic feature) * JSON parsing: NO * Simple mutation: NO * Reflection: NO * Buffer verifier: NO (will be add later) * Testing: basic: Yes * Testing: fuzz: Yes * Performance: Not bad * Platform: Supported Linux, OS X, Windows (has 32bit integer limitation) * Engine Unity: No flatc --php monster_test.fbs <?php //include neccessary files. $fbb = new Google\FlatBuffers\FlatBufferBuilder(1); $str = $fbb->createString("monster"); \MyGame\Example\Monster::startMonster($fbb); \MyGame\Example\Monster::addHp($fbb, 80); \MyGame\Example\Monster::addName($fbb, $str); $mon = \MyGame\Example\Monster::endMonster($fbb); $fbb->finish($mon); echo $fbb->sizedByteArray(); PHP 5.4 higher Currently, we do not register this library to packagist as still experimental and versioning problem. If you intended to use flatbuffers with composer. add repostiories section to composer.json like below. "repositories": [{ "type": "vcs", "url": "https://github.com/google/flatbuffers" }], and just put google/flatbuffers. "require": { "google/flatbuffers": "*" } * PHP's integer is platform dependant. we strongly recommend use 64bit machine and don't use uint, ulong types as prevent overflow issue. ref: http://php.net/manual/en/language.types.integer.php * php don't support float type. floating point numbers are always parsed as double precision internally. ref: http://php.net/manual/en/language.types.float.php * ByteBuffer is little bit slow implemnentation due to many chr/ord function calls. Especially encoding objects. This is expected performance as PHP5 has parsing arguments overhead. probably we'll add C-extension. Basically, PHP implementation respects Java and C# implementation. Note: ByteBuffer and FlatBuffersBuilder class are not intended to use other purposes. we may change internal API foreseeable future. PSR-2, PSR-4 standards. Implemented simple assertion class (respect JavaScript testcase implementation) as we prefer small code base. this also keeps CI iteration speed. we'll choose phpunit or something when the test cases grown.
-
- Oct 29, 2015
-
-
Wouter van Oortmerssen authored
Also simplified the code and made it faster. Change-Id: I1d83b1165a4a9a4380d1bfb5538769c012d2d367 Tested: on Linux.
-
- Oct 15, 2015
-
-
Evan Wallace authored
This adds a JavaScript language target. The generated JavaScript uses Google Closure Compiler type annotations and can be compiled using the advanced compilation mode, which performs type checking and optimizations such as inlining and dead code elimination. The generated JavaScript also exports all generated symbols for use with Node.js and RequireJS. This export behavior can be turned off with the --no-js-exports flag for use with Google Closure Compiler.
-