blob: 637ead543384769f1f08ec436e0b3627403893ff [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
James Kuszmaul8e62b022022-03-22 09:33:25 -070051 /**
52 * @return byte
53 */
54 public function getFooUnionType()
55 {
56 $o = $this->__offset(8);
57 return $o != 0 ? $this->bb->getByte($o + $this->bb_pos) : \NamespaceA\NamespaceB\UnionInNestedNS::NONE;
58 }
59
60 /**
61 * @returnint
62 */
63 public function getFooUnion($obj)
64 {
65 $o = $this->__offset(10);
66 return $o != 0 ? $this->__union($obj, $o) : null;
67 }
68
Austin Schuhe89fa2d2019-08-14 20:24:23 -070069 public function getFooStruct()
70 {
71 $obj = new StructInNestedNS();
James Kuszmaul8e62b022022-03-22 09:33:25 -070072 $o = $this->__offset(12);
Austin Schuhe89fa2d2019-08-14 20:24:23 -070073 return $o != 0 ? $obj->init($o + $this->bb_pos, $this->bb) : 0;
74 }
75
76 /**
77 * @param FlatBufferBuilder $builder
78 * @return void
79 */
80 public static function startTableInFirstNS(FlatBufferBuilder $builder)
81 {
James Kuszmaul8e62b022022-03-22 09:33:25 -070082 $builder->StartObject(5);
Austin Schuhe89fa2d2019-08-14 20:24:23 -070083 }
84
85 /**
86 * @param FlatBufferBuilder $builder
87 * @return TableInFirstNS
88 */
James Kuszmaul8e62b022022-03-22 09:33:25 -070089 public static function createTableInFirstNS(FlatBufferBuilder $builder, $foo_table, $foo_enum, $foo_union_type, $foo_union, $foo_struct)
Austin Schuhe89fa2d2019-08-14 20:24:23 -070090 {
James Kuszmaul8e62b022022-03-22 09:33:25 -070091 $builder->startObject(5);
Austin Schuhe89fa2d2019-08-14 20:24:23 -070092 self::addFooTable($builder, $foo_table);
93 self::addFooEnum($builder, $foo_enum);
James Kuszmaul8e62b022022-03-22 09:33:25 -070094 self::addFooUnionType($builder, $foo_union_type);
95 self::addFooUnion($builder, $foo_union);
Austin Schuhe89fa2d2019-08-14 20:24:23 -070096 self::addFooStruct($builder, $foo_struct);
97 $o = $builder->endObject();
98 return $o;
99 }
100
101 /**
102 * @param FlatBufferBuilder $builder
103 * @param int
104 * @return void
105 */
106 public static function addFooTable(FlatBufferBuilder $builder, $fooTable)
107 {
108 $builder->addOffsetX(0, $fooTable, 0);
109 }
110
111 /**
112 * @param FlatBufferBuilder $builder
113 * @param sbyte
114 * @return void
115 */
116 public static function addFooEnum(FlatBufferBuilder $builder, $fooEnum)
117 {
118 $builder->addSbyteX(1, $fooEnum, 0);
119 }
120
121 /**
122 * @param FlatBufferBuilder $builder
James Kuszmaul8e62b022022-03-22 09:33:25 -0700123 * @param byte
124 * @return void
125 */
126 public static function addFooUnionType(FlatBufferBuilder $builder, $fooUnionType)
127 {
128 $builder->addByteX(2, $fooUnionType, 0);
129 }
130
131 public static function addFooUnion(FlatBufferBuilder $builder, $offset)
132 {
133 $builder->addOffsetX(3, $offset, 0);
134 }
135
136 /**
137 * @param FlatBufferBuilder $builder
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700138 * @param int
139 * @return void
140 */
141 public static function addFooStruct(FlatBufferBuilder $builder, $fooStruct)
142 {
James Kuszmaul8e62b022022-03-22 09:33:25 -0700143 $builder->addStructX(4, $fooStruct, 0);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700144 }
145
146 /**
147 * @param FlatBufferBuilder $builder
148 * @return int table offset
149 */
150 public static function endTableInFirstNS(FlatBufferBuilder $builder)
151 {
152 $o = $builder->endObject();
153 return $o;
154 }
155}