1. 07 Dec, 2015 5 commits
  2. 05 Dec, 2015 3 commits
    • Armen Baghumian's avatar
      Optimize get* operation · f622e599
      Armen Baghumian authored
      It's slightly faster to convert the value to signed value in PHP as
      opposed to use pack and unpack.
      
      For 1M get operation the difference is:
      
          getShort in 3.3272678852081 seconds
          getInt in 3.8338589668274 seconds
          getLong in 5.6381590366364 seconds
          getLong (neg) in 5.6149101257324 seconds
      
      vs
      
          getShort in 2.7564418315887 seconds
          getInt in 3.1612701416016 seconds
          getLong in 3.1369340419769 seconds
          getLong (neg) in 3.1478710174561 seconds
      
      And since pack("P") and unpack("q") has been removed now ByteBuffer
      works for PHP >= 5.4
      f622e599
    • Armen Baghumian's avatar
      Correct the max/min signed/unsigned 32-bit int · 77fbdd28
      Armen Baghumian authored
      The test was trying to pack an unsigned int which couldn't fit as a
      signed int and putInt() wasn't doing the validation in the correct range
      77fbdd28
    • Oli Wilkinson's avatar
      Fix to #360 - Updated the general generator (Java/C#) to emit fully qualified… · c9ad6d54
      Oli Wilkinson authored
      Fix to #360 - Updated the general generator (Java/C#) to emit fully qualified names where the referenced object isn't directly in this namespace. Added test fbs files to verify compilation.
      c9ad6d54
  3. 04 Dec, 2015 2 commits
  4. 02 Dec, 2015 12 commits
  5. 25 Nov, 2015 2 commits
  6. 23 Nov, 2015 1 commit
    • Donnell's avatar
      Fix C# vector of enum code generation · 644bcbde
      Donnell authored
      Fixes a bug where the logic to determine when to use a C# enum flags
      both enums and vectors of enums.  This causes the C# generator to
      generate code that doesn't compile for tables that contain vectors of
      enums.
      
      The fix also consolidates type generation functions a bit and adds
      some additional casting functions for clarity.
      644bcbde
  7. 20 Nov, 2015 3 commits
  8. 19 Nov, 2015 3 commits
  9. 18 Nov, 2015 3 commits
  10. 17 Nov, 2015 3 commits
    • Johan Euphrosine's avatar
      flatbuffers/cmake: move build_flatbuffers to a standalone file · 331d2d83
      Johan Euphrosine authored
      So that it could be included from both flatbuffers CMakeLists.txt and
      FindFlatBuffers.cmake.
      
      Change-Id: Ie16a879beef9367cd6fd9b2d2157044841a7cdbc
      331d2d83
    • Shuhei Taunma's avatar
      (PHP) add experimental support for PHP language. · 5ce86826
      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.
      5ce86826
    • Shuhei Tanuma's avatar
      C# Unity can't cast integer represented enum value. · 37e28d98
      Shuhei Tanuma authored
      ```
      namespace MyGame;
      
      enum CommandType : byte {
      	None = 0,
      }
      
      table Command {
      	id:int;
      	type:CommandType;
      }
      ```
      
      then generate c# files. it'll output compile error like these.
      
      ```
      Assets/MyGame/Command.cs(18,39): error CS1041: Identifier expected
      Assets/MyGame/Command.cs(18,39): error CS1737: Optional parameter cannot precede required parameters
      
      16:   public static Offset<Command> CreateCommand(FlatBufferBuilder builder,
      17:   int id = 0,
      18:   CommandType type = (CommandType)0) {
      ```
      37e28d98
  11. 16 Nov, 2015 3 commits