...

Text file src/github.com/google/flatbuffers/goldens/php/Galaxy.php

Documentation: github.com/google/flatbuffers/goldens/php

     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 Galaxy extends Table
    10{
    11    /**
    12     * @param ByteBuffer $bb
    13     * @return Galaxy
    14     */
    15    public static function getRootAsGalaxy(ByteBuffer $bb)
    16    {
    17        $obj = new Galaxy();
    18        return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb));
    19    }
    20
    21    /**
    22     * @param int $_i offset
    23     * @param ByteBuffer $_bb
    24     * @return Galaxy
    25     **/
    26    public function init($_i, ByteBuffer $_bb)
    27    {
    28        $this->bb_pos = $_i;
    29        $this->bb = $_bb;
    30        return $this;
    31    }
    32
    33    /**
    34     * @return long
    35     */
    36    public function getNumStars()
    37    {
    38        $o = $this->__offset(4);
    39        return $o != 0 ? $this->bb->getLong($o + $this->bb_pos) : 0;
    40    }
    41
    42    /**
    43     * @param FlatBufferBuilder $builder
    44     * @return void
    45     */
    46    public static function startGalaxy(FlatBufferBuilder $builder)
    47    {
    48        $builder->StartObject(1);
    49    }
    50
    51    /**
    52     * @param FlatBufferBuilder $builder
    53     * @return Galaxy
    54     */
    55    public static function createGalaxy(FlatBufferBuilder $builder, $num_stars)
    56    {
    57        $builder->startObject(1);
    58        self::addNumStars($builder, $num_stars);
    59        $o = $builder->endObject();
    60        return $o;
    61    }
    62
    63    /**
    64     * @param FlatBufferBuilder $builder
    65     * @param long
    66     * @return void
    67     */
    68    public static function addNumStars(FlatBufferBuilder $builder, $numStars)
    69    {
    70        $builder->addLongX(0, $numStars, 0);
    71    }
    72
    73    /**
    74     * @param FlatBufferBuilder $builder
    75     * @return int table offset
    76     */
    77    public static function endGalaxy(FlatBufferBuilder $builder)
    78    {
    79        $o = $builder->endObject();
    80        return $o;
    81    }
    82}

View as plain text