File: TableInFirstNS.php

package info (click to toggle)
flatbuffers 1.12.1~git20200711.33e2d80%2Bdfsg1-0.6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,240 kB
  • sloc: cpp: 34,954; python: 5,085; java: 4,080; cs: 4,036; php: 1,455; ansic: 1,323; javascript: 1,074; sh: 733; xml: 727; makefile: 35
file content (120 lines) | stat: -rw-r--r-- 3,007 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
// automatically generated by the FlatBuffers compiler, do not modify

namespace NamespaceA;

use \Google\FlatBuffers\Struct;
use \Google\FlatBuffers\Table;
use \Google\FlatBuffers\ByteBuffer;
use \Google\FlatBuffers\FlatBufferBuilder;

class TableInFirstNS extends Table
{
    /**
     * @param ByteBuffer $bb
     * @return TableInFirstNS
     */
    public static function getRootAsTableInFirstNS(ByteBuffer $bb)
    {
        $obj = new TableInFirstNS();
        return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb));
    }

    /**
     * @param int $_i offset
     * @param ByteBuffer $_bb
     * @return TableInFirstNS
     **/
    public function init($_i, ByteBuffer $_bb)
    {
        $this->bb_pos = $_i;
        $this->bb = $_bb;
        return $this;
    }

    public function getFooTable()
    {
        $obj = new TableInNestedNS();
        $o = $this->__offset(4);
        return $o != 0 ? $obj->init($this->__indirect($o + $this->bb_pos), $this->bb) : 0;
    }

    /**
     * @return sbyte
     */
    public function getFooEnum()
    {
        $o = $this->__offset(6);
        return $o != 0 ? $this->bb->getSbyte($o + $this->bb_pos) : \NamespaceA\NamespaceB\EnumInNestedNS::A;
    }

    public function getFooStruct()
    {
        $obj = new StructInNestedNS();
        $o = $this->__offset(8);
        return $o != 0 ? $obj->init($o + $this->bb_pos, $this->bb) : 0;
    }

    /**
     * @param FlatBufferBuilder $builder
     * @return void
     */
    public static function startTableInFirstNS(FlatBufferBuilder $builder)
    {
        $builder->StartObject(3);
    }

    /**
     * @param FlatBufferBuilder $builder
     * @return TableInFirstNS
     */
    public static function createTableInFirstNS(FlatBufferBuilder $builder, $foo_table, $foo_enum, $foo_struct)
    {
        $builder->startObject(3);
        self::addFooTable($builder, $foo_table);
        self::addFooEnum($builder, $foo_enum);
        self::addFooStruct($builder, $foo_struct);
        $o = $builder->endObject();
        return $o;
    }

    /**
     * @param FlatBufferBuilder $builder
     * @param int
     * @return void
     */
    public static function addFooTable(FlatBufferBuilder $builder, $fooTable)
    {
        $builder->addOffsetX(0, $fooTable, 0);
    }

    /**
     * @param FlatBufferBuilder $builder
     * @param sbyte
     * @return void
     */
    public static function addFooEnum(FlatBufferBuilder $builder, $fooEnum)
    {
        $builder->addSbyteX(1, $fooEnum, 0);
    }

    /**
     * @param FlatBufferBuilder $builder
     * @param int
     * @return void
     */
    public static function addFooStruct(FlatBufferBuilder $builder, $fooStruct)
    {
        $builder->addStructX(2, $fooStruct, 0);
    }

    /**
     * @param FlatBufferBuilder $builder
     * @return int table offset
     */
    public static function endTableInFirstNS(FlatBufferBuilder $builder)
    {
        $o = $builder->endObject();
        return $o;
    }
}