• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?php
2// automatically generated by the FlatBuffers compiler, do not modify
3
4namespace NamespaceA;
5
6use \Google\FlatBuffers\Struct;
7use \Google\FlatBuffers\Table;
8use \Google\FlatBuffers\ByteBuffer;
9use \Google\FlatBuffers\FlatBufferBuilder;
10
11class SecondTableInA extends Table
12{
13    /**
14     * @param ByteBuffer $bb
15     * @return SecondTableInA
16     */
17    public static function getRootAsSecondTableInA(ByteBuffer $bb)
18    {
19        $obj = new SecondTableInA();
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 SecondTableInA
27     **/
28    public function init($_i, ByteBuffer $_bb)
29    {
30        $this->bb_pos = $_i;
31        $this->bb = $_bb;
32        return $this;
33    }
34
35    public function getReferToC()
36    {
37        $obj = new TableInC();
38        $o = $this->__offset(4);
39        return $o != 0 ? $obj->init($this->__indirect($o + $this->bb_pos), $this->bb) : 0;
40    }
41
42    /**
43     * @param FlatBufferBuilder $builder
44     * @return void
45     */
46    public static function startSecondTableInA(FlatBufferBuilder $builder)
47    {
48        $builder->StartObject(1);
49    }
50
51    /**
52     * @param FlatBufferBuilder $builder
53     * @return SecondTableInA
54     */
55    public static function createSecondTableInA(FlatBufferBuilder $builder, $refer_to_c)
56    {
57        $builder->startObject(1);
58        self::addReferToC($builder, $refer_to_c);
59        $o = $builder->endObject();
60        return $o;
61    }
62
63    /**
64     * @param FlatBufferBuilder $builder
65     * @param int
66     * @return void
67     */
68    public static function addReferToC(FlatBufferBuilder $builder, $referToC)
69    {
70        $builder->addOffsetX(0, $referToC, 0);
71    }
72
73    /**
74     * @param FlatBufferBuilder $builder
75     * @return int table offset
76     */
77    public static function endSecondTableInA(FlatBufferBuilder $builder)
78    {
79        $o = $builder->endObject();
80        return $o;
81    }
82}
83