...

Text file src/github.com/google/flatbuffers/tests/union_vector/FallingTub.php

Documentation: github.com/google/flatbuffers/tests/union_vector

     1<?php
     2// automatically generated by the FlatBuffers compiler, do not modify
     3
     4use \Google\FlatBuffers\Struct;
     5use \Google\FlatBuffers\Table;
     6use \Google\FlatBuffers\ByteBuffer;
     7use \Google\FlatBuffers\FlatBufferBuilder;
     8
     9class FallingTub extends Struct
    10{
    11    /**
    12     * @param int $_i offset
    13     * @param ByteBuffer $_bb
    14     * @return FallingTub
    15     **/
    16    public function init($_i, ByteBuffer $_bb)
    17    {
    18        $this->bb_pos = $_i;
    19        $this->bb = $_bb;
    20        return $this;
    21    }
    22
    23    /**
    24     * @return int
    25     */
    26    public function GetWeight()
    27    {
    28        return $this->bb->getInt($this->bb_pos + 0);
    29    }
    30
    31
    32    /**
    33     * @return int offset
    34     */
    35    public static function createFallingTub(FlatBufferBuilder $builder, $weight)
    36    {
    37        $builder->prep(4, 4);
    38        $builder->putInt($weight);
    39        return $builder->offset();
    40    }
    41}

View as plain text