Skip to content
Snippets Groups Projects
  1. Feb 15, 2018
  2. Feb 12, 2018
    • Kamil Rojewski's avatar
      Fix for aligned new for gcc >= 7.1 (#4621) · 474ba68b
      Kamil Rojewski authored
      * Eclipse ignore
      
      * TypeScript support
      
      * Prefixing enums
      
      * Test results
      
      * Merged JS and TS generators
      
      * Fixed AppVeyor build problems
      
      * Fixed more AppVeyor build problems
      
      * Fixed more AppVeyor build problems
      
      * Changed TS flag to options struct
      
      * Storing options by value
      
      * Removed unneeded const
      
      * Re-export support for unions
      
      * Uint support
      
      * Casting bools to numbers for mutation
      
      * TS shell tests
      
      * Reverted generates js test file to original version
      
      * Backing up js tests and properly generating test data
      
      * Not importing flatbuffers for TS test generation
      
      * Not overwriting generated js for tests
      
      * AppVeyor test fixes
      
      * Generating the most strict TS code possible
      
      * Not returning null when creating vectors
      
      * Not returning null from struct contructors
      
      * Vector of unions for ts/js
      
      * Sanity check for languages
      
      * Indentation fix + output test files
      
      * Vectors of unions for php
      
      * Fixes to union vector handling + tests
      
      * Fix for strictPropertyInitialization
      
      * Fix for new aligned operator new for gcc >= 7.1
      474ba68b
  3. Dec 21, 2017
  4. Nov 30, 2017
  5. Nov 20, 2017
  6. Nov 16, 2017
  7. Nov 09, 2017
  8. Nov 06, 2017
  9. Oct 20, 2017
  10. Sep 22, 2017
  11. Jul 20, 2017
    • Stewart Miles's avatar
      C++98 (stlport) support for core FlatBuffers and FlexBuffers. · a8923222
      Stewart Miles authored
      * Added internal - limited - implementation of flatbuffers::unique_ptr
        for STLs that don't ship with std::unique_ptr.  In C++11 and beyond
        this is just an alias for std::unique_ptr.
      * Aliased used type traits structs is_scalar is_floating_point is_unsigned
        into flatbuffers namespace so they can be replaced in C++98 implementations.
        Right now these point at stlport's TR1 implementations.
      * Wrapped vector::data() in vector_data().
      * Wrapped vector::emplace_back() in vector_emplace_back().
      * Wrapper string::back() in string_back().
      * Added variants of FlatBufferBuilder::CreateVector() and
        FlatBufferBuilder::CreateVectorOfStructs() that allow the use of plain
        function pointers.
        Generated code has also been modified to use plain functions to build objects
        rather than std::function() so all generated code will work in C++98
        applications.
      * Added flexbuffers::Builder::Vector(), flexbuffers::Builder::TypedVector()
        and flexbuffers::Builder::Map() methods that allow the use of plain function
        pointers.
      * Changed Parser to internally use plain function pointers when parsing table
        and vector delimiters.
      * Added specializations of NumToString() for 64-bit types that aren't supported
        by stringstream in stlport.
      * Overloaded numeric_limits for 64-bit types not supported by stlport.
      * Replaced build_apk.sh (which was broken by deprecation of the
        "android" tool in the Android SDK) with build.gradle and the
        appropriate gradle wrapper to build an APK.
      * Switched Android build to build against all STL variants.
      * Updated travis configuration to build Android test and sample.
      
      Tested:
      * Verified all tests continue to work on Linux, OSX and Android.
      * Verified Travis build is green.
      
      Change-Id: I9e634363793f85b9f141d21454b10686020a2065
      a8923222
  12. Jul 10, 2017
    • schoetbi's avatar
      Json schema (#4369) · f2020418
      schoetbi authored
      * Added empty generator for json schema (idl_gen_json_schema.cpp)
      #4360
      
      * JsonSchemaGenerator: output of tables implemented
      
      current problems:
      - typenames are not correct
      - array types need to be deduced
      
      #4360
      
      * JsonSchemaGenerator: Corrected generation of typenames
      Current problems: enum types not written correctly
      #4360
      
      * JsonSchemaGenerator: Added generation of enum types
      #4360
      
      * idl_gen_json_schema.cpp: Write required properties to schema
      #4360
      
      * idl_gen_json_schema.cpp: Export Types including namespace
      #4360
      
      * idl_gen_json_schema.cpp: Fixed Json format
      #4360
      
      * idl_gen_json_schema.cpp: Formatted according to google code style
      #4360
      
      * Checked in monster_test.bfbs with changes from master
      
      * Added idl_gen_json_schema.cpp in CMakeLists.txt
      
      * generate_code.bat: Added generation of json schema
      
      * Added todo.md
      
      * generate_code.sh: Added generation of json schema
      
      * Addressed some review issues
      - removed command line arg -S
      - removed new lines
      - fixed codestyle in template functions
      - removed usage of stringstream
      - idented json schema
      #4360
      
      * removed auto in idl_gen_json_schema.cpp
      
      * idl_gen_json_schema.cpp: changed iterator declarations to auto
      #4360
      
      * deleted todo.md
      
      * idl_gen_json_schema.cpp: Removed keyword "override" so that vs2010 can compile
      
      * idl_gen_json_schema.cpp: switch statement in GenType handeles all enum-members
      
      * idl_gen_json_schema.cpp: Removed cerr output
      
      * idl_gen_json_schema.cpp: Avoid vector copying
      
      * idl_gen_json_schema.cpp: Fixed identation of json schema output
      
      * idl_gen_json_schema.cpp: Do not output empty descriptions
      f2020418
  13. Jun 16, 2017
  14. Jun 07, 2017
    • Lawrence Chan's avatar
      [C++] Improve flatbuffers + gRPC integration (#4310) · da67c0a7
      Lawrence Chan authored
      * 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
      da67c0a7
  15. May 24, 2017
    • Wouter van Oortmerssen's avatar
      Fixed --keep-prefix functionality. · 22743ca4
      Wouter van Oortmerssen authored
      Changing to keep include prefixes had two side effects: the main
      file being parsed wasn't filtered out anymore, and include directory
      paths would be added to the path in the include statement.
      
      Also moved the include_test*.fbs files to sub directories so we
      can actually test the handling of -I etc.
      
      tested: on Linux.
      
      Change-Id: Ibae095cea7ab0cccbac15cfb5171719f6b5cad8c
      22743ca4
  16. May 12, 2017
    • Per Grön's avatar
      C++/Go: Update gRPC related code to work with gRPC 1.3+ (#4305) · 9aeeddf5
      Per Grön authored
      * Don't fail the build on unused parameters
      
      gRPC headers have unused parameters so this breaks the test build.
      
      * Pull in updated compiler files from gRPC
      
      There have been some API breaks in gRPC lately. This commit
      pulls in the most recent version of the files in this repo
      that are just copied from gRPC.
      
      * Modify the gRPC files so that they can work with Flatbuffers
      
      The files taken from gRPC do not work out-of-the-box with Flatbuffers.
      This commit modifies them so that they work. Hopefully this commit
      will be able to serve as a guide or maybe even be cherry-picked on
      top of new versions of those files as newer versions from gRPC are
      pulled in.
      
      * Adjust the rest of Flatbuffers to work with the new gRPC
      
      * Change idl_gen_grpc.cpp to work with the new API
      * Add missing #include in flatbuffers/grpc.h
      * Run tests/generate_code.sh and check in the results
      * Don't link with grpc++_unsecure and (secure) grpc. That's just weird
      
      * Revert unrelated JS/TS test changes
      
      * Simplify compiler/config.h
      
      There is no need to import this file from gRPC. In fact, it probably
      makes sense to not do so, since it seems to be intended to have
      project specific configuration in it.
      
      * Don't emit C++ types in the Go gRPC code generator
      
      * Don't emit C++ #includes in generated gRPC code
      
      Before this PR, there was a Go-specific additional_includes method
      in schema_interface.h, which is shared with the gRPC repo. The
      additional parameter to FlatBufFile in idl_gen_grpc.cpp makes that
      unnecessary, which means we need less Flatbuffer-specific changes
      in gRPC.
      9aeeddf5
  17. May 10, 2017
  18. Apr 24, 2017
  19. Mar 29, 2017
  20. Mar 10, 2017
    • chronoxor's avatar
      Pedantic Visual Studio build (/W4 /WX) (#4214) · f5387387
      chronoxor authored
      * Pedantic Visual Studio build (/W4 /WX)
      
      * Pedantic Visual Studio build (/W4 /WX)
      
      * Pedantic Visual Studio build (/W4 /WX)
      
      * Remove /wd4512 from CMakeLists.txt
      
      * Suppress Visual Studio 4512 warning ('class' : assignment operator could not be generated)
      f5387387
  21. Feb 26, 2017
  22. Feb 16, 2017
  23. Feb 08, 2017
  24. Jan 25, 2017
  25. Jan 14, 2017
    • Wouter van Oortmerssen's avatar
      Add CodeWriter utility class. · 7b94eab2
      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
      7b94eab2
  26. Dec 16, 2016
    • Zarian Waheed's avatar
      Changes for verifying a buffer dynamically using reflection. (#4102) · 6d6271db
      Zarian Waheed authored
      * Changes for verifying a buffer dynamically using reflection.
      
      * Fixing build issues on linux and applied code reformatting.
      
      * Fixing the file order in cmake file that was messing up the macro based code inclusion.
      
      Added tests for reflection based verification.
      
      * Changes for verifying a buffer dynamically using reflection.
      
      Fixing build issues on linux and applied code reformatting.
      
      Fixing the file order in cmake file that was messing up the macro based code inclusion.
      
      Added tests for reflection based verification.
      
      * Incorporated the code review changes that were requested:
      
      1. Changed the Verify function signature.
      2. Changed the variable names to use snake_case.
      3. Added better comments.
      4. Refactored duplicate code.
      5. Changed the verifier class so that it has the same size when compiled with or without FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE macro.
      
      * Setting FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE and FLATBUFFERS_DEBUG_VERIFICATION_FAILURE through cmake for flattests so that it gets propagted to all translation units of flattests.
      
      * Making the Verifier struct fields the same in all cases. Also reverting the target_compile_definitions change in cmake file because build machine on travis does not have cmake version 3.0 or higher which was the version when target_compile_definitions was added in cmake.
      
      * Defining macros through cmake in a portable way using functions that are available in cmake 2.8.
      6d6271db
  27. Dec 05, 2016
    • Ronak Jain's avatar
      Support for Golang GRPC (Experimental) (#4082) · a31ddd2b
      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
      a31ddd2b
  28. Oct 17, 2016
  29. Oct 05, 2016
  30. Sep 09, 2016
    • Jason Sanmiya's avatar
      Fix Windows warnings. · 985de211
      Jason Sanmiya authored
      Cmake issued a warning when the variable is in quotation marks
      in an if statement.
      
      Visual Studio upgrades constants to int and issues a truncation
      warning, so inserted a cast.
      
      Change-Id: I60cdcb5c2565cd5e97f80b9c2ff1e6abc32b1deb
      Tested: Builds without warning on VS2015.
      985de211
  31. Sep 06, 2016
  32. Aug 24, 2016
  33. Jul 26, 2016
    • Jason Sanmiya's avatar
      Fix Mac build. · 30c07f4e
      Jason Sanmiya authored
      The new line in the set(CMAKE_CXX_FLAGS...) line was getting insert
      verbatim into the Makefile. Makefiles don't like new lines in their
      assignment operators.
      
      The newline escape fix works for CMake 3.0 and above, but since
      we support 2.x, we need to use the legacy solution, which is to
      split into two separate statements.
      
      Tested: cmake -G"Unix Makefiles" works now on Mac.
      Change-Id: I6f4655981b85087c4760c3d26ed0c97c4469ba93
      30c07f4e
  34. Jul 22, 2016
  35. Jul 20, 2016
  36. Jul 01, 2016
  37. Jun 29, 2016
Loading