blob: 9fb29c37052af0de59c48d07b0a1144c7f209a0c [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001<?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 TableInFirstNS extends Table
12{
13 /**
14 * @param ByteBuffer $bb
15 * @return TableInFirstNS
16 */
17 public static function getRootAsTableInFirstNS(ByteBuffer $bb)
18 {
19 $obj = new TableInFirstNS();
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 TableInFirstNS
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 getFooTable()
36 {
37 $obj = new TableInNestedNS();
38 $o = $this->__offset(4);
39 return $o != 0 ? $obj->init($this->__indirect($o + $this->bb_pos), $this->bb) : 0;
40 }
41
42 /**
43 * @return sbyte
44 */
45 public function getFooEnum()
46 {
47 $o = $this->__offset(6);
48 return $o != 0 ? $this->bb->getSbyte($o + $this->bb_pos) : \NamespaceA\NamespaceB\EnumInNestedNS::A;
49 }
50
51 public function getFooStruct()
52 {
53 $obj = new StructInNestedNS();
54 $o = $this->__offset(8);
55 return $o != 0 ? $obj->init($o + $this->bb_pos, $this->bb) : 0;
56 }
57
58 /**
59 * @param FlatBufferBuilder $builder
60 * @return void
61 */
62 public static function startTableInFirstNS(FlatBufferBuilder $builder)
63 {
64 $builder->StartObject(3);
65 }
66
67 /**
68 * @param FlatBufferBuilder $builder
69 * @return TableInFirstNS
70 */
71 public static function createTableInFirstNS(FlatBufferBuilder $builder, $foo_table, $foo_enum, $foo_struct)
72 {
73 $builder->startObject(3);
74 self::addFooTable($builder, $foo_table);
75 self::addFooEnum($builder, $foo_enum);
76 self::addFooStruct($builder, $foo_struct);
77 $o = $builder->endObject();
78 return $o;
79 }
80
81 /**
82 * @param FlatBufferBuilder $builder
83 * @param int
84 * @return void
85 */
86 public static function addFooTable(FlatBufferBuilder $builder, $fooTable)
87 {
88 $builder->addOffsetX(0, $fooTable, 0);
89 }
90
91 /**
92 * @param FlatBufferBuilder $builder
93 * @param sbyte
94 * @return void
95 */
96 public static function addFooEnum(FlatBufferBuilder $builder, $fooEnum)
97 {
98 $builder->addSbyteX(1, $fooEnum, 0);
99 }
100
101 /**
102 * @param FlatBufferBuilder $builder
103 * @param int
104 * @return void
105 */
106 public static function addFooStruct(FlatBufferBuilder $builder, $fooStruct)
107 {
108 $builder->addStructX(2, $fooStruct, 0);
109 }
110
111 /**
112 * @param FlatBufferBuilder $builder
113 * @return int table offset
114 */
115 public static function endTableInFirstNS(FlatBufferBuilder $builder)
116 {
117 $o = $builder->endObject();
118 return $o;
119 }
120}