...

Text file src/github.com/google/flatbuffers/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.php

Documentation: github.com/google/flatbuffers/tests/namespace_test/NamespaceA/NamespaceB

     1<?php
     2// automatically generated by the FlatBuffers compiler, do not modify
     3
     4namespace NamespaceA\NamespaceB;
     5
     6use \Google\FlatBuffers\Struct;
     7use \Google\FlatBuffers\Table;
     8use \Google\FlatBuffers\ByteBuffer;
     9use \Google\FlatBuffers\FlatBufferBuilder;
    10
    11class TableInNestedNS extends Table
    12{
    13    /**
    14     * @param ByteBuffer $bb
    15     * @return TableInNestedNS
    16     */
    17    public static function getRootAsTableInNestedNS(ByteBuffer $bb)
    18    {
    19        $obj = new TableInNestedNS();
    20        return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb));
    21    }
    22
    23    /**
    24     * @param int $_i offset
    25     * @param ByteBuffer $_bb
    26     * @return TableInNestedNS
    27     **/
    28    public function init($_i, ByteBuffer $_bb)
    29    {
    30        $this->bb_pos = $_i;
    31        $this->bb = $_bb;
    32        return $this;
    33    }
    34
    35    /**
    36     * @return int
    37     */
    38    public function getFoo()
    39    {
    40        $o = $this->__offset(4);
    41        return $o != 0 ? $this->bb->getInt($o + $this->bb_pos) : 0;
    42    }
    43
    44    /**
    45     * @param FlatBufferBuilder $builder
    46     * @return void
    47     */
    48    public static function startTableInNestedNS(FlatBufferBuilder $builder)
    49    {
    50        $builder->StartObject(1);
    51    }
    52
    53    /**
    54     * @param FlatBufferBuilder $builder
    55     * @return TableInNestedNS
    56     */
    57    public static function createTableInNestedNS(FlatBufferBuilder $builder, $foo)
    58    {
    59        $builder->startObject(1);
    60        self::addFoo($builder, $foo);
    61        $o = $builder->endObject();
    62        return $o;
    63    }
    64
    65    /**
    66     * @param FlatBufferBuilder $builder
    67     * @param int
    68     * @return void
    69     */
    70    public static function addFoo(FlatBufferBuilder $builder, $foo)
    71    {
    72        $builder->addIntX(0, $foo, 0);
    73    }
    74
    75    /**
    76     * @param FlatBufferBuilder $builder
    77     * @return int table offset
    78     */
    79    public static function endTableInNestedNS(FlatBufferBuilder $builder)
    80    {
    81        $o = $builder->endObject();
    82        return $o;
    83    }
    84}

View as plain text