xref: /aosp_15_r20/external/flatbuffers/tests/union_vector/HandFan.php (revision 890232f25432b36107d06881e0a25aaa6b473652)
1<?php
2// automatically generated by the FlatBuffers compiler, do not modify
3
4use \Google\FlatBuffers\Struct;
5use \Google\FlatBuffers\Table;
6use \Google\FlatBuffers\ByteBuffer;
7use \Google\FlatBuffers\FlatBufferBuilder;
8
9class HandFan extends Table
10{
11    /**
12     * @param ByteBuffer $bb
13     * @return HandFan
14     */
15    public static function getRootAsHandFan(ByteBuffer $bb)
16    {
17        $obj = new HandFan();
18        return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb));
19    }
20
21    public static function HandFanIdentifier()
22    {
23        return "MOVI";
24    }
25
26    public static function HandFanBufferHasIdentifier(ByteBuffer $buf)
27    {
28        return self::__has_identifier($buf, self::HandFanIdentifier());
29    }
30
31    /**
32     * @param int $_i offset
33     * @param ByteBuffer $_bb
34     * @return HandFan
35     **/
36    public function init($_i, ByteBuffer $_bb)
37    {
38        $this->bb_pos = $_i;
39        $this->bb = $_bb;
40        return $this;
41    }
42
43    /**
44     * @return int
45     */
46    public function getLength()
47    {
48        $o = $this->__offset(4);
49        return $o != 0 ? $this->bb->getInt($o + $this->bb_pos) : 0;
50    }
51
52    /**
53     * @param FlatBufferBuilder $builder
54     * @return void
55     */
56    public static function startHandFan(FlatBufferBuilder $builder)
57    {
58        $builder->StartObject(1);
59    }
60
61    /**
62     * @param FlatBufferBuilder $builder
63     * @return HandFan
64     */
65    public static function createHandFan(FlatBufferBuilder $builder, $length)
66    {
67        $builder->startObject(1);
68        self::addLength($builder, $length);
69        $o = $builder->endObject();
70        return $o;
71    }
72
73    /**
74     * @param FlatBufferBuilder $builder
75     * @param int
76     * @return void
77     */
78    public static function addLength(FlatBufferBuilder $builder, $length)
79    {
80        $builder->addIntX(0, $length, 0);
81    }
82
83    /**
84     * @param FlatBufferBuilder $builder
85     * @return int table offset
86     */
87    public static function endHandFan(FlatBufferBuilder $builder)
88    {
89        $o = $builder->endObject();
90        return $o;
91    }
92}
93