FlatBuffers
An open source project by FPL.
|
Public Member Functions | |
__construct ($initial_size) | |
Create a FlatBufferBuilder with a given initial size. More... | |
addBool ($x) | |
Add a bool to the buffer, properly aligned, and grows the buffer (if necessary). More... | |
addByte ($x) | |
Add a byte to the buffer, properly aligned, and grows the buffer (if necessary). More... | |
addDouble ($x) | |
Add a double to the buffer, properly aligned, and grows the buffer (if necessary). More... | |
addFloat ($x) | |
Add a float to the buffer, properly aligned, and grows the buffer (if necessary). More... | |
addInt ($x) | |
Add an int to the buffer, properly aligned, and grows the buffer (if necessary). More... | |
addLong ($x) | |
Add a long to the buffer, properly aligned, and grows the buffer (if necessary). More... | |
addOffset ($off) | |
Adds on offset, relative to where it will be written. More... | |
addSbyte ($x) | |
Add a signed byte to the buffer, properly aligned, and grows the buffer (if necessary). More... | |
addShort ($x) | |
Add a short to the buffer, properly aligned, and grows the buffer (if necessary). More... | |
addUint ($x) | |
Add an unsigned int to the buffer, properly aligned, and grows the buffer (if necessary). More... | |
addUlong ($x) | |
Add an unsigned long to the buffer, properly aligned, and grows the buffer (if necessary). More... | |
addUshort ($x) | |
Add an unsigned short to the buffer, properly aligned, and grows the buffer (if necessary). More... | |
createString ($s) | |
Encode the string $s in the buffer using UTF-8. More... | |
dataBuffer () | |
Get the ByteBuffer representing the FlatBuffer. More... | |
finish ($root_table, $identifier=null) | |
Finalize a buffer, pointing to the given $root_table . More... | |
forceDefaults ($forceDefaults) | |
In order to save space, fields that are set to their default value don't get serialized into the buffer. More... | |
sizedByteArray () | |
Utility function to copy and return the FlatBuffer data from the underlying ByteBuffer. More... | |
Public Attributes | |
$bb | |
Internal ByteBuffer for the FlatBuffer data. | |
Google\FlatBuffers\FlatbufferBuilder::__construct | ( | $initial_size | ) |
Create a FlatBufferBuilder with a given initial size.
$initial_size | initial byte buffer size. |
Google\FlatBuffers\FlatbufferBuilder::addBool | ( | $x | ) |
Add a bool
to the buffer, properly aligned, and grows the buffer (if necessary).
$x | The bool to add to the buffer. |
Google\FlatBuffers\FlatbufferBuilder::addByte | ( | $x | ) |
Add a byte
to the buffer, properly aligned, and grows the buffer (if necessary).
$x | The byte to add to the buffer. |
Google\FlatBuffers\FlatbufferBuilder::addDouble | ( | $x | ) |
Add a double
to the buffer, properly aligned, and grows the buffer (if necessary).
$x | The double to add to the buffer. |
Google\FlatBuffers\FlatbufferBuilder::addFloat | ( | $x | ) |
Add a float
to the buffer, properly aligned, and grows the buffer (if necessary).
$x | The float to add to the buffer. |
Google\FlatBuffers\FlatbufferBuilder::addInt | ( | $x | ) |
Add an int
to the buffer, properly aligned, and grows the buffer (if necessary).
$x | The int to add to the buffer. |
Google\FlatBuffers\FlatbufferBuilder::addLong | ( | $x | ) |
Add a long
to the buffer, properly aligned, and grows the buffer (if necessary).
$x | The long to add to the buffer. |
Google\FlatBuffers\FlatbufferBuilder::addOffset | ( | $off | ) |
Adds on offset, relative to where it will be written.
$off | The offset to add to the buffer. |
Google\FlatBuffers\FlatbufferBuilder::addSbyte | ( | $x | ) |
Add a signed byte
to the buffer, properly aligned, and grows the buffer (if necessary).
$x | The signed byte to add to the buffer. |
Google\FlatBuffers\FlatbufferBuilder::addShort | ( | $x | ) |
Add a short
to the buffer, properly aligned, and grows the buffer (if necessary).
$x | The short to add to the buffer. |
Google\FlatBuffers\FlatbufferBuilder::addUint | ( | $x | ) |
Add an unsigned int
to the buffer, properly aligned, and grows the buffer (if necessary).
$x | The unsigned int to add to the buffer. |
Google\FlatBuffers\FlatbufferBuilder::addUlong | ( | $x | ) |
Add an unsigned long
to the buffer, properly aligned, and grows the buffer (if necessary).
$x | The unsigned long to add to the buffer. |
Google\FlatBuffers\FlatbufferBuilder::addUshort | ( | $x | ) |
Add an unsigned short
to the buffer, properly aligned, and grows the buffer (if necessary).
$x | The unsigned short to add to the buffer. |
Google\FlatBuffers\FlatbufferBuilder::createString | ( | $s | ) |
Encode the string $s
in the buffer using UTF-8.
string | $s | The string to encode. |
InvalidArgumentException | Thrown if the input string $s is not UTF-8. |
Google\FlatBuffers\FlatbufferBuilder::dataBuffer | ( | ) |
Get the ByteBuffer representing the FlatBuffer.
Google\FlatBuffers\FlatbufferBuilder::finish | ( | $root_table, | |
$identifier = null |
|||
) |
Finalize a buffer, pointing to the given $root_table
.
$root_table | An offest to be added to the buffer. |
$file_identifier | A FlatBuffer file identifier to be added to the buffer before $root_table . This defaults to null . |
InvalidArgumentException | Thrown if an invalid $identifier is given, where its length is not equal to Constants::FILE_IDENTIFIER_LENGTH . |
Google\FlatBuffers\FlatbufferBuilder::forceDefaults | ( | $forceDefaults | ) |
In order to save space, fields that are set to their default value don't get serialized into the buffer.
bool | $forceDefaults | When set to true , always serializes default values. |
Google\FlatBuffers\FlatbufferBuilder::sizedByteArray | ( | ) |
Utility function to copy and return the FlatBuffer data from the underlying ByteBuffer.