...

Text file src/github.com/google/flatbuffers/tests/MyGame/Example/Test.php

Documentation: github.com/google/flatbuffers/tests/MyGame/Example

     1<?php
     2// automatically generated by the FlatBuffers compiler, do not modify
     3
     4namespace MyGame\Example;
     5
     6use \Google\FlatBuffers\Struct;
     7use \Google\FlatBuffers\Table;
     8use \Google\FlatBuffers\ByteBuffer;
     9use \Google\FlatBuffers\FlatBufferBuilder;
    10
    11class Test extends Struct
    12{
    13    /**
    14     * @param int $_i offset
    15     * @param ByteBuffer $_bb
    16     * @return Test
    17     **/
    18    public function init($_i, ByteBuffer $_bb)
    19    {
    20        $this->bb_pos = $_i;
    21        $this->bb = $_bb;
    22        return $this;
    23    }
    24
    25    /**
    26     * @return short
    27     */
    28    public function GetA()
    29    {
    30        return $this->bb->getShort($this->bb_pos + 0);
    31    }
    32
    33    /**
    34     * @return sbyte
    35     */
    36    public function GetB()
    37    {
    38        return $this->bb->getSbyte($this->bb_pos + 2);
    39    }
    40
    41
    42    /**
    43     * @return int offset
    44     */
    45    public static function createTest(FlatBufferBuilder $builder, $a, $b)
    46    {
    47        $builder->prep(2, 4);
    48        $builder->pad(1);
    49        $builder->putSbyte($b);
    50        $builder->putShort($a);
    51        return $builder->offset();
    52    }
    53}

View as plain text