Compare commits

...

8 Commits

Author SHA1 Message Date
Derek Bailey
203241ed32 FlatBuffers Version 22.10.26 (#7607) 2022-10-26 16:02:38 -07:00
Derek Bailey
ac485609c4 setup.py: Define version directly
Define the version directly instead of loading from an environment variable and writing to a file.
2022-10-26 15:31:02 -07:00
Derek Bailey
de5b85aa66 release.yml: Switch to python directory 2022-10-26 15:29:02 -07:00
Derek Bailey
de3df2d88b release.yml: Add publishing to PyPi 2022-10-26 15:17:21 -07:00
Joshua Smith
043a24f2e4 [Python] Fixed the issue with nested unions relying on InitFromBuf. (#7576)
* feat: Fixed the issue with nested unions relying on InitFromBuf.
Problem: Issue #7569
Nested Unions were broken with the introduction of parsing buffers with an initial encoding offset.

Fix:
Revert the InitFromBuf method to the previous version and introduction of InitFromPackedBuf that allows
users to read types from packed buffers applying the offset automatically.

Test:
Added in TestNestedUnionTables to test the encoding and decoding ability using a nested table with a
union field.

* fix: Uncommented generate code command
2022-10-26 14:56:52 -07:00
Derek Bailey
5a48b0d7d6 release.yml: Typo 2022-10-26 00:40:43 -07:00
Derek Bailey
ce307556fb release.yml: Remove npm ci
This command [was suggested](https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry) in the github docs, but not in our release steps.
2022-10-26 00:35:11 -07:00
Derek Bailey
cb616e27cb Create release.yml (#7605)
Create a new `release.yml` for defining automatic publishing to package managers on releases.

Adds the NPM publishing steps as it is the most straightforward.
2022-10-26 00:30:16 -07:00
189 changed files with 1038 additions and 318 deletions

54
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: Release
permissions: read-all
on:
# For manual tests.
workflow_dispatch:
release:
types: [created]
jobs:
publish-npm:
name: Publish NPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-pypi:
name: Publish PyPi
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./python
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install setuptools wheel twine
- name: Build
run: |
python3 setup.py sdist bdist_wheel
- name: Upload to PyPi
run: |
python3 -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}

View File

@@ -1,6 +1,6 @@
set(VERSION_MAJOR 22) set(VERSION_MAJOR 22)
set(VERSION_MINOR 10) set(VERSION_MINOR 10)
set(VERSION_PATCH 25) set(VERSION_PATCH 26)
set(VERSION_COMMIT 0) set(VERSION_COMMIT 0)
find_program(GIT git) find_program(GIT git)

View File

@@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'FlatBuffers' s.name = 'FlatBuffers'
s.version = '22.10.25' s.version = '22.10.26'
s.summary = 'FlatBuffers: Memory Efficient Serialization Library' s.summary = 'FlatBuffers: Memory Efficient Serialization Library'
s.description = "FlatBuffers is a cross platform serialization library architected for s.description = "FlatBuffers is a cross platform serialization library architected for

View File

@@ -36,7 +36,7 @@ class Animal : Table() {
return if(o != 0) bb.getShort(o + bb_pos).toUShort() else 0u return if(o != 0) bb.getShort(o + bb_pos).toUShort() else 0u
} }
companion object { companion object {
fun validateVersion() = Constants.FLATBUFFERS_22_10_25() fun validateVersion() = Constants.FLATBUFFERS_22_10_26()
fun getRootAsAnimal(_bb: ByteBuffer): Animal = getRootAsAnimal(_bb, Animal()) fun getRootAsAnimal(_bb: ByteBuffer): Animal = getRootAsAnimal(_bb, Animal())
fun getRootAsAnimal(_bb: ByteBuffer, obj: Animal): Animal { fun getRootAsAnimal(_bb: ByteBuffer, obj: Animal): Animal {
_bb.order(ByteOrder.LITTLE_ENDIAN) _bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -1,5 +1,5 @@
name: flat_buffers name: flat_buffers
version: 22.10.25 version: 22.10.26
description: FlatBuffers reading and writing library for Dart. Based on original work by Konstantin Scheglov and Paul Berry of the Dart SDK team. description: FlatBuffers reading and writing library for Dart. Based on original work by Konstantin Scheglov and Paul Berry of the Dart SDK team.
homepage: https://github.com/google/flatbuffers homepage: https://github.com/google/flatbuffers
documentation: https://google.github.io/flatbuffers/index.html documentation: https://google.github.io/flatbuffers/index.html

View File

@@ -6,7 +6,7 @@ import FlatBuffers
public struct models_HelloReply: FlatBufferObject, Verifiable { public struct models_HelloReply: FlatBufferObject, Verifiable {
static func validateVersion() { FlatBuffersVersion_22_10_25() } static func validateVersion() { FlatBuffersVersion_22_10_26() }
public var __buffer: ByteBuffer! { return _accessor.bb } public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table private var _accessor: Table
@@ -55,7 +55,7 @@ extension models_HelloReply: Encodable {
public struct models_HelloRequest: FlatBufferObject, Verifiable { public struct models_HelloRequest: FlatBufferObject, Verifiable {
static func validateVersion() { FlatBuffersVersion_22_10_25() } static func validateVersion() { FlatBuffersVersion_22_10_26() }
public var __buffer: ByteBuffer! { return _accessor.bb } public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table private var _accessor: Table

View File

@@ -140,7 +140,7 @@
#define FLATBUFFERS_VERSION_MAJOR 22 #define FLATBUFFERS_VERSION_MAJOR 22
#define FLATBUFFERS_VERSION_MINOR 10 #define FLATBUFFERS_VERSION_MINOR 10
#define FLATBUFFERS_VERSION_REVISION 25 #define FLATBUFFERS_VERSION_REVISION 26
#define FLATBUFFERS_STRING_EXPAND(X) #X #define FLATBUFFERS_STRING_EXPAND(X) #X
#define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X) #define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X)
namespace flatbuffers { namespace flatbuffers {

View File

@@ -10,7 +10,7 @@
// generated, otherwise it may not be compatible. // generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 22 && static_assert(FLATBUFFERS_VERSION_MAJOR == 22 &&
FLATBUFFERS_VERSION_MINOR == 10 && FLATBUFFERS_VERSION_MINOR == 10 &&
FLATBUFFERS_VERSION_REVISION == 25, FLATBUFFERS_VERSION_REVISION == 26,
"Non-compatible flatbuffers version included"); "Non-compatible flatbuffers version included");
namespace reflection { namespace reflection {

View File

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.google.flatbuffers</groupId> <groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers-java</artifactId> <artifactId>flatbuffers-java</artifactId>
<version>22.10.25</version> <version>22.10.26</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>FlatBuffers Java API</name> <name>FlatBuffers Java API</name>
<description> <description>

View File

@@ -46,7 +46,7 @@ public class Constants {
Changes to the Java implementation need to be sure to change Changes to the Java implementation need to be sure to change
the version here and in the code generator on every possible the version here and in the code generator on every possible
incompatible change */ incompatible change */
public static void FLATBUFFERS_22_10_25() {} public static void FLATBUFFERS_22_10_26() {}
} }
/// @endcond /// @endcond

View File

@@ -32,6 +32,6 @@ namespace Google.FlatBuffers
Changes to the C# implementation need to be sure to change Changes to the C# implementation need to be sure to change
the version here and in the code generator on every possible the version here and in the code generator on every possible
incompatible change */ incompatible change */
public static void FLATBUFFERS_22_10_25() {} public static void FLATBUFFERS_22_10_26() {}
} }
} }

View File

@@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netstandard2.1;netstandard2.0;net46</TargetFrameworks> <TargetFrameworks>netstandard2.1;netstandard2.0;net46</TargetFrameworks>
<Description>A cross-platform memory efficient serialization library</Description> <Description>A cross-platform memory efficient serialization library</Description>
<PackageVersion>22.10.25</PackageVersion> <PackageVersion>22.10.26</PackageVersion>
<Authors>Google LLC</Authors> <Authors>Google LLC</Authors>
<PackageProjectUrl>https://github.com/google/flatbuffers</PackageProjectUrl> <PackageProjectUrl>https://github.com/google/flatbuffers</PackageProjectUrl>
<RepositoryUrl>https://github.com/google/flatbuffers</RepositoryUrl> <RepositoryUrl>https://github.com/google/flatbuffers</RepositoryUrl>

View File

@@ -1,6 +1,6 @@
{ {
"name": "flatbuffers", "name": "flatbuffers",
"version": "22.10.25", "version": "22.10.26",
"description": "Memory Efficient Serialization Library", "description": "Memory Efficient Serialization Library",
"files": [ "files": [
"js/**/*.js", "js/**/*.js",

View File

@@ -14,4 +14,4 @@
# Placeholder, to be updated during the release process # Placeholder, to be updated during the release process
# by the setup.py # by the setup.py
__version__ = u"22.10.25" __version__ = u"22.10.26"

View File

@@ -12,54 +12,14 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import fileinput
import os
import re
import sys
from datetime import datetime
from setuptools import setup from setuptools import setup
def _update_version_attr(new_version):
for line in fileinput.input('flatbuffers/_version.py', inplace=True):
if line.startswith('__version__'):
line = re.sub(r'".*"', '"{}"'.format(new_version), line)
sys.stdout.write(line)
def version():
version = os.getenv('VERSION', None)
if version:
# Most git tags are prefixed with 'v' (example: v1.2.3) this is
# never desirable for artifact repositories, so we strip the
# leading 'v' if it's present.
version = version[1:] if version.startswith('v') else version
else:
# Default version is an ISO8601 compiliant datetime. PyPI doesn't allow
# the colon ':' character in its versions, and time is required to allow
# for multiple publications to master in one day. This datetime string
# uses the "basic" ISO8601 format for both its date and time components
# to avoid issues with the colon character (ISO requires that date and
# time components of a date-time string must be uniformly basic or
# extended, which is why the date component does not have dashes.
#
# Publications using datetime versions should only be made from master
# to represent the HEAD moving forward.
version = datetime.utcnow().strftime('%Y%m%d%H%M%S')
print("VERSION environment variable not set, using datetime instead: {}"
.format(version))
_update_version_attr(version)
return version
setup( setup(
name='flatbuffers', name='flatbuffers',
version=version(), version='22.10.26',
license='Apache 2.0', license='Apache 2.0',
author='FlatBuffers Contributors', author='Derek Bailey',
author_email='me@rwinslow.com', author_email='derekbailey@google.com',
url='https://google.github.io/flatbuffers/', url='https://google.github.io/flatbuffers/',
long_description=('Python runtime library for use with the ' long_description=('Python runtime library for use with the '
'`Flatbuffers <https://google.github.io/flatbuffers/>`_ ' '`Flatbuffers <https://google.github.io/flatbuffers/>`_ '
@@ -81,4 +41,4 @@ setup(
'Documentation': 'https://google.github.io/flatbuffers/', 'Documentation': 'https://google.github.io/flatbuffers/',
'Source': 'https://github.com/google/flatbuffers', 'Source': 'https://github.com/google/flatbuffers',
}, },
) )

View File

@@ -10,7 +10,7 @@
// generated, otherwise it may not be compatible. // generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 22 && static_assert(FLATBUFFERS_VERSION_MAJOR == 22 &&
FLATBUFFERS_VERSION_MINOR == 10 && FLATBUFFERS_VERSION_MINOR == 10 &&
FLATBUFFERS_VERSION_REVISION == 25, FLATBUFFERS_VERSION_REVISION == 26,
"Non-compatible flatbuffers version included"); "Non-compatible flatbuffers version included");
namespace MyGame { namespace MyGame {

View File

@@ -31,7 +31,7 @@ public enum MyGame_Sample_Equipment: UInt8, Enum {
public struct MyGame_Sample_Vec3: NativeStruct { public struct MyGame_Sample_Vec3: NativeStruct {
static func validateVersion() { FlatBuffersVersion_22_10_25() } static func validateVersion() { FlatBuffersVersion_22_10_26() }
private var _x: Float32 private var _x: Float32
private var _y: Float32 private var _y: Float32
@@ -56,7 +56,7 @@ public struct MyGame_Sample_Vec3: NativeStruct {
public struct MyGame_Sample_Vec3_Mutable: FlatBufferObject { public struct MyGame_Sample_Vec3_Mutable: FlatBufferObject {
static func validateVersion() { FlatBuffersVersion_22_10_25() } static func validateVersion() { FlatBuffersVersion_22_10_26() }
public var __buffer: ByteBuffer! { return _accessor.bb } public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Struct private var _accessor: Struct
@@ -72,7 +72,7 @@ public struct MyGame_Sample_Vec3_Mutable: FlatBufferObject {
public struct MyGame_Sample_Monster: FlatBufferObject { public struct MyGame_Sample_Monster: FlatBufferObject {
static func validateVersion() { FlatBuffersVersion_22_10_25() } static func validateVersion() { FlatBuffersVersion_22_10_26() }
public var __buffer: ByteBuffer! { return _accessor.bb } public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table private var _accessor: Table
@@ -162,7 +162,7 @@ public struct MyGame_Sample_Monster: FlatBufferObject {
public struct MyGame_Sample_Weapon: FlatBufferObject { public struct MyGame_Sample_Weapon: FlatBufferObject {
static func validateVersion() { FlatBuffersVersion_22_10_25() } static func validateVersion() { FlatBuffersVersion_22_10_26() }
public var __buffer: ByteBuffer! { return _accessor.bb } public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table private var _accessor: Table

View File

@@ -147,7 +147,7 @@ TS_OPTS = ["--ts", "--gen-name-strings"]
LOBSTER_OPTS = ["--lobster"] LOBSTER_OPTS = ["--lobster"]
SWIFT_OPTS = ["--swift", "--gen-json-emit", "--bfbs-filenames", str(tests_path)] SWIFT_OPTS = ["--swift", "--gen-json-emit", "--bfbs-filenames", str(tests_path)]
SWIFT_OPTS_CODE_GEN = [ SWIFT_OPTS_CODE_GEN = [
"--swift", "--swift",
"--gen-json-emit", "--gen-json-emit",
"--bfbs-filenames", "--bfbs-filenames",
swift_code_gen swift_code_gen
@@ -305,14 +305,14 @@ flatc(
# Generate the annotated binary of the monster_test binary schema. # Generate the annotated binary of the monster_test binary schema.
flatc_annotate( flatc_annotate(
schema="../reflection/reflection.fbs", schema="../reflection/reflection.fbs",
file="monster_test.bfbs", file="monster_test.bfbs",
include="include_test" include="include_test"
) )
flatc_annotate( flatc_annotate(
schema="monster_test.fbs", schema="monster_test.fbs",
file="monsterdata_test.mon", file="monsterdata_test.mon",
include="include_test" include="include_test"
) )
@@ -371,6 +371,12 @@ flatc(
) )
flatc(
BASE_OPTS + PYTHON_OPTS,
schema="nested_union_test.fbs",
)
# Optional Scalars # Optional Scalars
optional_scalars_schema = "optional_scalars.fbs" optional_scalars_schema = "optional_scalars.fbs"
flatc(["--java", "--kotlin", "--lobster"], schema=optional_scalars_schema) flatc(["--java", "--kotlin", "--lobster"], schema=optional_scalars_schema)

View File

@@ -58,6 +58,11 @@ sed -i \
-e "s/\(__version__ = u\).*/\1\"$version\"/" \ -e "s/\(__version__ = u\).*/\1\"$version\"/" \
python/flatbuffers/_version.py python/flatbuffers/_version.py
echo "Updating python/setup.py..."
sed -i \
-e "s/\(version='\).*/\1$version',/" \
python/setup.py
echo "Updating FlatBuffers.podspec..." echo "Updating FlatBuffers.podspec..."
sed -i \ sed -i \
-e "s/\(s.version\s*= \).*/\1'$version'/" \ -e "s/\(s.version\s*= \).*/\1'$version'/" \

View File

@@ -655,7 +655,7 @@ class CSharpGenerator : public BaseGenerator {
// Force compile time error if not using the same version runtime. // Force compile time error if not using the same version runtime.
code += " public static void ValidateVersion() {"; code += " public static void ValidateVersion() {";
code += " FlatBufferConstants."; code += " FlatBufferConstants.";
code += "FLATBUFFERS_22_10_25(); "; code += "FLATBUFFERS_22_10_26(); ";
code += "}\n"; code += "}\n";
// Generate a special accessor for the table that when used as the root // Generate a special accessor for the table that when used as the root

View File

@@ -669,7 +669,7 @@ class JavaGenerator : public BaseGenerator {
// Force compile time error if not using the same version runtime. // Force compile time error if not using the same version runtime.
code += " public static void ValidateVersion() {"; code += " public static void ValidateVersion() {";
code += " Constants."; code += " Constants.";
code += "FLATBUFFERS_22_10_25(); "; code += "FLATBUFFERS_22_10_26(); ";
code += "}\n"; code += "}\n";
// Generate a special accessor for the table that when used as the root // Generate a special accessor for the table that when used as the root

View File

@@ -505,7 +505,7 @@ class KotlinGenerator : public BaseGenerator {
// runtime. // runtime.
GenerateFunOneLine( GenerateFunOneLine(
writer, "validateVersion", "", "", writer, "validateVersion", "", "",
[&]() { writer += "Constants.FLATBUFFERS_22_10_25()"; }, [&]() { writer += "Constants.FLATBUFFERS_22_10_26()"; },
options.gen_jvmstatic); options.gen_jvmstatic);
GenerateGetRootAsAccessors(namer_.Type(struct_def), writer, options); GenerateGetRootAsAccessors(namer_.Type(struct_def), writer, options);

View File

@@ -1108,13 +1108,25 @@ class PythonGenerator : public BaseGenerator {
code += GenIndents(1) + "@classmethod"; code += GenIndents(1) + "@classmethod";
code += GenIndents(1) + "def InitFromBuf(cls, buf, pos):"; code += GenIndents(1) + "def InitFromBuf(cls, buf, pos):";
code += GenIndents(2) + "n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, 0)";
code += GenIndents(2) + struct_var + " = " + struct_type + "()"; code += GenIndents(2) + struct_var + " = " + struct_type + "()";
code += GenIndents(2) + struct_var + ".Init(buf, pos+n)"; code += GenIndents(2) + struct_var + ".Init(buf, pos)";
code += GenIndents(2) + "return cls.InitFromObj(" + struct_var + ")"; code += GenIndents(2) + "return cls.InitFromObj(" + struct_var + ")";
code += "\n"; code += "\n";
} }
void InitializeFromPackedBuf(const StructDef &struct_def,
std::string *code_ptr) const {
auto &code = *code_ptr;
const auto struct_var = namer_.Variable(struct_def);
const auto struct_type = namer_.Type(struct_def);
code += GenIndents(1) + "@classmethod";
code += GenIndents(1) + "def InitFromPackedBuf(cls, buf, pos=0):";
code += GenIndents(2) + "n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)";
code += GenIndents(2) + "return cls.InitFromBuf(buf, pos+n)";
code += "\n";
}
void InitializeFromObjForObject(const StructDef &struct_def, void InitializeFromObjForObject(const StructDef &struct_def,
std::string *code_ptr) const { std::string *code_ptr) const {
auto &code = *code_ptr; auto &code = *code_ptr;
@@ -1607,6 +1619,8 @@ class PythonGenerator : public BaseGenerator {
InitializeFromBuf(struct_def, &code); InitializeFromBuf(struct_def, &code);
InitializeFromPackedBuf(struct_def, &code);
InitializeFromObjForObject(struct_def, &code); InitializeFromObjForObject(struct_def, &code);
GenUnPack(struct_def, &code); GenUnPack(struct_def, &code);

View File

@@ -1874,7 +1874,7 @@ class SwiftGenerator : public BaseGenerator {
} }
std::string ValidateFunc() { std::string ValidateFunc() {
return "static func validateVersion() { FlatBuffersVersion_22_10_25() }"; return "static func validateVersion() { FlatBuffersVersion_22_10_26() }";
} }
std::string GenType(const Type &type, std::string GenType(const Type &type,

View File

@@ -119,4 +119,4 @@ extension UInt64: Scalar, Verifiable {
public typealias NumericValue = UInt64 public typealias NumericValue = UInt64
} }
public func FlatBuffersVersion_22_10_25() {} public func FlatBuffersVersion_22_10_26() {}

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
]# ]#

View File

@@ -9,7 +9,7 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public final class LongFloatEntry extends Table { public final class LongFloatEntry extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_26(); }
public static LongFloatEntry getRootAsLongFloatEntry(ByteBuffer _bb) { return getRootAsLongFloatEntry(_bb, new LongFloatEntry()); } public static LongFloatEntry getRootAsLongFloatEntry(ByteBuffer _bb) { return getRootAsLongFloatEntry(_bb, new LongFloatEntry()); }
public static LongFloatEntry getRootAsLongFloatEntry(ByteBuffer _bb, LongFloatEntry obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static LongFloatEntry getRootAsLongFloatEntry(ByteBuffer _bb, LongFloatEntry obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -32,7 +32,7 @@ class LongFloatEntry : Table() {
return (val_1 - val_2).sign return (val_1 - val_2).sign
} }
companion object { companion object {
fun validateVersion() = Constants.FLATBUFFERS_22_10_25() fun validateVersion() = Constants.FLATBUFFERS_22_10_26()
fun getRootAsLongFloatEntry(_bb: ByteBuffer): LongFloatEntry = getRootAsLongFloatEntry(_bb, LongFloatEntry()) fun getRootAsLongFloatEntry(_bb: ByteBuffer): LongFloatEntry = getRootAsLongFloatEntry(_bb, LongFloatEntry())
fun getRootAsLongFloatEntry(_bb: ByteBuffer, obj: LongFloatEntry): LongFloatEntry { fun getRootAsLongFloatEntry(_bb: ByteBuffer, obj: LongFloatEntry): LongFloatEntry {
_bb.order(ByteOrder.LITTLE_ENDIAN) _bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -9,7 +9,7 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public final class LongFloatMap extends Table { public final class LongFloatMap extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_26(); }
public static LongFloatMap getRootAsLongFloatMap(ByteBuffer _bb) { return getRootAsLongFloatMap(_bb, new LongFloatMap()); } public static LongFloatMap getRootAsLongFloatMap(ByteBuffer _bb) { return getRootAsLongFloatMap(_bb, new LongFloatMap()); }
public static LongFloatMap getRootAsLongFloatMap(ByteBuffer _bb, LongFloatMap obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static LongFloatMap getRootAsLongFloatMap(ByteBuffer _bb, LongFloatMap obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -46,7 +46,7 @@ class LongFloatMap : Table() {
} }
} }
companion object { companion object {
fun validateVersion() = Constants.FLATBUFFERS_22_10_25() fun validateVersion() = Constants.FLATBUFFERS_22_10_26()
fun getRootAsLongFloatMap(_bb: ByteBuffer): LongFloatMap = getRootAsLongFloatMap(_bb, LongFloatMap()) fun getRootAsLongFloatMap(_bb: ByteBuffer): LongFloatMap = getRootAsLongFloatMap(_bb, LongFloatMap())
fun getRootAsLongFloatMap(_bb: ByteBuffer, obj: LongFloatMap): LongFloatMap { fun getRootAsLongFloatMap(_bb: ByteBuffer, obj: LongFloatMap): LongFloatMap {
_bb.order(ByteOrder.LITTLE_ENDIAN) _bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -13,7 +13,7 @@ public struct KeywordsInTable : IFlatbufferObject
{ {
private Table __p; private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } } public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_26(); }
public static KeywordsInTable GetRootAsKeywordsInTable(ByteBuffer _bb) { return GetRootAsKeywordsInTable(_bb, new KeywordsInTable()); } public static KeywordsInTable GetRootAsKeywordsInTable(ByteBuffer _bb) { return GetRootAsKeywordsInTable(_bb, new KeywordsInTable()); }
public static KeywordsInTable GetRootAsKeywordsInTable(ByteBuffer _bb, KeywordsInTable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static KeywordsInTable GetRootAsKeywordsInTable(ByteBuffer _bb, KeywordsInTable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
]# ]#

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -38,11 +38,15 @@ class AbilityT(object):
@classmethod @classmethod
def InitFromBuf(cls, buf, pos): def InitFromBuf(cls, buf, pos):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, 0)
ability = Ability() ability = Ability()
ability.Init(buf, pos+n) ability.Init(buf, pos)
return cls.InitFromObj(ability) return cls.InitFromObj(ability)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod @classmethod
def InitFromObj(cls, ability): def InitFromObj(cls, ability):
x = AbilityT() x = AbilityT()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -123,11 +123,15 @@ class ArrayStructT(object):
@classmethod @classmethod
def InitFromBuf(cls, buf, pos): def InitFromBuf(cls, buf, pos):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, 0)
arrayStruct = ArrayStruct() arrayStruct = ArrayStruct()
arrayStruct.Init(buf, pos+n) arrayStruct.Init(buf, pos)
return cls.InitFromObj(arrayStruct) return cls.InitFromObj(arrayStruct)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod @classmethod
def InitFromObj(cls, arrayStruct): def InitFromObj(cls, arrayStruct):
x = ArrayStructT() x = ArrayStructT()

View File

@@ -13,7 +13,7 @@ public struct ArrayTable : IFlatbufferObject
{ {
private Table __p; private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } } public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_26(); }
public static ArrayTable GetRootAsArrayTable(ByteBuffer _bb) { return GetRootAsArrayTable(_bb, new ArrayTable()); } public static ArrayTable GetRootAsArrayTable(ByteBuffer _bb) { return GetRootAsArrayTable(_bb, new ArrayTable()); }
public static ArrayTable GetRootAsArrayTable(ByteBuffer _bb, ArrayTable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static ArrayTable GetRootAsArrayTable(ByteBuffer _bb, ArrayTable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public static bool ArrayTableBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "ARRT"); } public static bool ArrayTableBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "ARRT"); }

View File

@@ -9,7 +9,7 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public final class ArrayTable extends Table { public final class ArrayTable extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_26(); }
public static ArrayTable getRootAsArrayTable(ByteBuffer _bb) { return getRootAsArrayTable(_bb, new ArrayTable()); } public static ArrayTable getRootAsArrayTable(ByteBuffer _bb) { return getRootAsArrayTable(_bb, new ArrayTable()); }
public static ArrayTable getRootAsArrayTable(ByteBuffer _bb, ArrayTable obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static ArrayTable getRootAsArrayTable(ByteBuffer _bb, ArrayTable obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public static boolean ArrayTableBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "ARRT"); } public static boolean ArrayTableBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "ARRT"); }

View File

@@ -62,11 +62,15 @@ class ArrayTableT(object):
@classmethod @classmethod
def InitFromBuf(cls, buf, pos): def InitFromBuf(cls, buf, pos):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, 0)
arrayTable = ArrayTable() arrayTable = ArrayTable()
arrayTable.Init(buf, pos+n) arrayTable.Init(buf, pos)
return cls.InitFromObj(arrayTable) return cls.InitFromObj(arrayTable)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod @classmethod
def InitFromObj(cls, arrayTable): def InitFromObj(cls, arrayTable):
x = ArrayTableT() x = ArrayTableT()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -14,7 +14,7 @@ public struct Monster : IFlatbufferObject
{ {
private Table __p; private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } } public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_26(); }
public static Monster GetRootAsMonster(ByteBuffer _bb) { return GetRootAsMonster(_bb, new Monster()); } public static Monster GetRootAsMonster(ByteBuffer _bb) { return GetRootAsMonster(_bb, new Monster()); }
public static Monster GetRootAsMonster(ByteBuffer _bb, Monster obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static Monster GetRootAsMonster(ByteBuffer _bb, Monster obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public static bool MonsterBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "MONS"); } public static bool MonsterBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "MONS"); }

View File

@@ -12,7 +12,7 @@ import com.google.flatbuffers.*;
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
public final class Monster extends Table { public final class Monster extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_26(); }
public static Monster getRootAsMonster(ByteBuffer _bb) { return getRootAsMonster(_bb, new Monster()); } public static Monster getRootAsMonster(ByteBuffer _bb) { return getRootAsMonster(_bb, new Monster()); }
public static Monster getRootAsMonster(ByteBuffer _bb, Monster obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static Monster getRootAsMonster(ByteBuffer _bb, Monster obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public static boolean MonsterBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "MONS"); } public static boolean MonsterBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "MONS"); }

View File

@@ -874,7 +874,7 @@ class Monster : Table() {
return compareStrings(__offset(10, o1, _bb), __offset(10, o2, _bb), _bb) return compareStrings(__offset(10, o1, _bb), __offset(10, o2, _bb), _bb)
} }
companion object { companion object {
fun validateVersion() = Constants.FLATBUFFERS_22_10_25() fun validateVersion() = Constants.FLATBUFFERS_22_10_26()
fun getRootAsMonster(_bb: ByteBuffer): Monster = getRootAsMonster(_bb, Monster()) fun getRootAsMonster(_bb: ByteBuffer): Monster = getRootAsMonster(_bb, Monster())
fun getRootAsMonster(_bb: ByteBuffer, obj: Monster): Monster { fun getRootAsMonster(_bb: ByteBuffer, obj: Monster): Monster {
_bb.order(ByteOrder.LITTLE_ENDIAN) _bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -1131,11 +1131,15 @@ class MonsterT(object):
@classmethod @classmethod
def InitFromBuf(cls, buf, pos): def InitFromBuf(cls, buf, pos):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, 0)
monster = Monster() monster = Monster()
monster.Init(buf, pos+n) monster.Init(buf, pos)
return cls.InitFromObj(monster) return cls.InitFromObj(monster)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod @classmethod
def InitFromObj(cls, monster): def InitFromObj(cls, monster):
x = MonsterT() x = MonsterT()

View File

@@ -111,11 +111,15 @@ class NestedStructT(object):
@classmethod @classmethod
def InitFromBuf(cls, buf, pos): def InitFromBuf(cls, buf, pos):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, 0)
nestedStruct = NestedStruct() nestedStruct = NestedStruct()
nestedStruct.Init(buf, pos+n) nestedStruct.Init(buf, pos)
return cls.InitFromObj(nestedStruct) return cls.InitFromObj(nestedStruct)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod @classmethod
def InitFromObj(cls, nestedStruct): def InitFromObj(cls, nestedStruct):
x = NestedStructT() x = NestedStructT()

View File

@@ -0,0 +1,20 @@
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NestedUnion
class Any(object):
NONE = 0
Vec3 = 1
TestSimpleTableWithEnum = 2
def AnyCreator(unionType, table):
from flatbuffers.table import Table
if not isinstance(table, Table):
return None
if unionType == Any().Vec3:
import MyGame.Example.NestedUnion.Vec3
return MyGame.Example.NestedUnion.Vec3.Vec3T.InitFromBuf(table.Bytes, table.Pos)
if unionType == Any().TestSimpleTableWithEnum:
import MyGame.Example.NestedUnion.TestSimpleTableWithEnum
return MyGame.Example.NestedUnion.TestSimpleTableWithEnum.TestSimpleTableWithEnumT.InitFromBuf(table.Bytes, table.Pos)
return None

View File

@@ -0,0 +1,12 @@
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NestedUnion
# Composite components of Monster color.
class Color(object):
Red = 1
# \brief color Green
# Green is bit_flag with value (1u << 1)
Green = 2
# \brief color Blue (1u << 3)
Blue = 8

View File

@@ -0,0 +1,133 @@
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NestedUnion
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class NestedUnionTest(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = NestedUnionTest()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsNestedUnionTest(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
# NestedUnionTest
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# NestedUnionTest
def Name(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# NestedUnionTest
def DataType(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
return 0
# NestedUnionTest
def Data(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
from flatbuffers.table import Table
obj = Table(bytearray(), 0)
self._tab.Union(obj, o)
return obj
return None
# NestedUnionTest
def Id(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
return 0
def NestedUnionTestStart(builder): builder.StartObject(4)
def Start(builder):
return NestedUnionTestStart(builder)
def NestedUnionTestAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
def AddName(builder, name):
return NestedUnionTestAddName(builder, name)
def NestedUnionTestAddDataType(builder, dataType): builder.PrependUint8Slot(1, dataType, 0)
def AddDataType(builder, dataType):
return NestedUnionTestAddDataType(builder, dataType)
def NestedUnionTestAddData(builder, data): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(data), 0)
def AddData(builder, data):
return NestedUnionTestAddData(builder, data)
def NestedUnionTestAddId(builder, id): builder.PrependInt16Slot(3, id, 0)
def AddId(builder, id):
return NestedUnionTestAddId(builder, id)
def NestedUnionTestEnd(builder): return builder.EndObject()
def End(builder):
return NestedUnionTestEnd(builder)
import MyGame.Example.NestedUnion.Any
import MyGame.Example.NestedUnion.TestSimpleTableWithEnum
import MyGame.Example.NestedUnion.Vec3
try:
from typing import Union
except:
pass
class NestedUnionTestT(object):
# NestedUnionTestT
def __init__(self):
self.name = None # type: str
self.dataType = 0 # type: int
self.data = None # type: Union[None, MyGame.Example.NestedUnion.Vec3.Vec3T, MyGame.Example.NestedUnion.TestSimpleTableWithEnum.TestSimpleTableWithEnumT]
self.id = 0 # type: int
@classmethod
def InitFromBuf(cls, buf, pos):
nestedUnionTest = NestedUnionTest()
nestedUnionTest.Init(buf, pos)
return cls.InitFromObj(nestedUnionTest)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod
def InitFromObj(cls, nestedUnionTest):
x = NestedUnionTestT()
x._UnPack(nestedUnionTest)
return x
# NestedUnionTestT
def _UnPack(self, nestedUnionTest):
if nestedUnionTest is None:
return
self.name = nestedUnionTest.Name()
self.dataType = nestedUnionTest.DataType()
self.data = MyGame.Example.NestedUnion.Any.AnyCreator(self.dataType, nestedUnionTest.Data())
self.id = nestedUnionTest.Id()
# NestedUnionTestT
def Pack(self, builder):
if self.name is not None:
name = builder.CreateString(self.name)
if self.data is not None:
data = self.data.Pack(builder)
NestedUnionTestStart(builder)
if self.name is not None:
NestedUnionTestAddName(builder, name)
NestedUnionTestAddDataType(builder, self.dataType)
if self.data is not None:
NestedUnionTestAddData(builder, data)
NestedUnionTestAddId(builder, self.id)
nestedUnionTest = NestedUnionTestEnd(builder)
return nestedUnionTest

View File

@@ -0,0 +1,66 @@
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NestedUnion
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class Test(object):
__slots__ = ['_tab']
@classmethod
def SizeOf(cls):
return 4
# Test
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# Test
def A(self): return self._tab.Get(flatbuffers.number_types.Int16Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0))
# Test
def B(self): return self._tab.Get(flatbuffers.number_types.Int8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(2))
def CreateTest(builder, a, b):
builder.Prep(2, 4)
builder.Pad(1)
builder.PrependInt8(b)
builder.PrependInt16(a)
return builder.Offset()
class TestT(object):
# TestT
def __init__(self):
self.a = 0 # type: int
self.b = 0 # type: int
@classmethod
def InitFromBuf(cls, buf, pos):
test = Test()
test.Init(buf, pos)
return cls.InitFromObj(test)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod
def InitFromObj(cls, test):
x = TestT()
x._UnPack(test)
return x
# TestT
def _UnPack(self, test):
if test is None:
return
self.a = test.A()
self.b = test.B()
# TestT
def Pack(self, builder):
return CreateTest(builder, self.a, self.b)

View File

@@ -0,0 +1,78 @@
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NestedUnion
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class TestSimpleTableWithEnum(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = TestSimpleTableWithEnum()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsTestSimpleTableWithEnum(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
# TestSimpleTableWithEnum
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# TestSimpleTableWithEnum
def Color(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
return 2
def TestSimpleTableWithEnumStart(builder): builder.StartObject(1)
def Start(builder):
return TestSimpleTableWithEnumStart(builder)
def TestSimpleTableWithEnumAddColor(builder, color): builder.PrependUint8Slot(0, color, 2)
def AddColor(builder, color):
return TestSimpleTableWithEnumAddColor(builder, color)
def TestSimpleTableWithEnumEnd(builder): return builder.EndObject()
def End(builder):
return TestSimpleTableWithEnumEnd(builder)
class TestSimpleTableWithEnumT(object):
# TestSimpleTableWithEnumT
def __init__(self):
self.color = 2 # type: int
@classmethod
def InitFromBuf(cls, buf, pos):
testSimpleTableWithEnum = TestSimpleTableWithEnum()
testSimpleTableWithEnum.Init(buf, pos)
return cls.InitFromObj(testSimpleTableWithEnum)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod
def InitFromObj(cls, testSimpleTableWithEnum):
x = TestSimpleTableWithEnumT()
x._UnPack(testSimpleTableWithEnum)
return x
# TestSimpleTableWithEnumT
def _UnPack(self, testSimpleTableWithEnum):
if testSimpleTableWithEnum is None:
return
self.color = testSimpleTableWithEnum.Color()
# TestSimpleTableWithEnumT
def Pack(self, builder):
TestSimpleTableWithEnumStart(builder)
TestSimpleTableWithEnumAddColor(builder, self.color)
testSimpleTableWithEnum = TestSimpleTableWithEnumEnd(builder)
return testSimpleTableWithEnum

View File

@@ -0,0 +1,155 @@
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NestedUnion
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class Vec3(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Vec3()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsVec3(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
# Vec3
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# Vec3
def X(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
return 0.0
# Vec3
def Y(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
return 0.0
# Vec3
def Z(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
return 0.0
# Vec3
def Test1(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
return 0.0
# Vec3
def Test2(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
return 0
# Vec3
def Test3(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
if o != 0:
x = o + self._tab.Pos
from MyGame.Example.NestedUnion.Test import Test
obj = Test()
obj.Init(self._tab.Bytes, x)
return obj
return None
def Vec3Start(builder): builder.StartObject(6)
def Start(builder):
return Vec3Start(builder)
def Vec3AddX(builder, x): builder.PrependFloat64Slot(0, x, 0.0)
def AddX(builder, x):
return Vec3AddX(builder, x)
def Vec3AddY(builder, y): builder.PrependFloat64Slot(1, y, 0.0)
def AddY(builder, y):
return Vec3AddY(builder, y)
def Vec3AddZ(builder, z): builder.PrependFloat64Slot(2, z, 0.0)
def AddZ(builder, z):
return Vec3AddZ(builder, z)
def Vec3AddTest1(builder, test1): builder.PrependFloat64Slot(3, test1, 0.0)
def AddTest1(builder, test1):
return Vec3AddTest1(builder, test1)
def Vec3AddTest2(builder, test2): builder.PrependUint8Slot(4, test2, 0)
def AddTest2(builder, test2):
return Vec3AddTest2(builder, test2)
def Vec3AddTest3(builder, test3): builder.PrependStructSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(test3), 0)
def AddTest3(builder, test3):
return Vec3AddTest3(builder, test3)
def Vec3End(builder): return builder.EndObject()
def End(builder):
return Vec3End(builder)
import MyGame.Example.NestedUnion.Test
try:
from typing import Optional
except:
pass
class Vec3T(object):
# Vec3T
def __init__(self):
self.x = 0.0 # type: float
self.y = 0.0 # type: float
self.z = 0.0 # type: float
self.test1 = 0.0 # type: float
self.test2 = 0 # type: int
self.test3 = None # type: Optional[MyGame.Example.NestedUnion.Test.TestT]
@classmethod
def InitFromBuf(cls, buf, pos):
vec3 = Vec3()
vec3.Init(buf, pos)
return cls.InitFromObj(vec3)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod
def InitFromObj(cls, vec3):
x = Vec3T()
x._UnPack(vec3)
return x
# Vec3T
def _UnPack(self, vec3):
if vec3 is None:
return
self.x = vec3.X()
self.y = vec3.Y()
self.z = vec3.Z()
self.test1 = vec3.Test1()
self.test2 = vec3.Test2()
if vec3.Test3() is not None:
self.test3 = MyGame.Example.NestedUnion.Test.TestT.InitFromObj(vec3.Test3())
# Vec3T
def Pack(self, builder):
Vec3Start(builder)
Vec3AddX(builder, self.x)
Vec3AddY(builder, self.y)
Vec3AddZ(builder, self.z)
Vec3AddTest1(builder, self.test1)
Vec3AddTest2(builder, self.test2)
if self.test3 is not None:
test3 = self.test3.Pack(builder)
Vec3AddTest3(builder, test3)
vec3 = Vec3End(builder)
return vec3

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -13,7 +13,7 @@ public struct Referrable : IFlatbufferObject
{ {
private Table __p; private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } } public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_26(); }
public static Referrable GetRootAsReferrable(ByteBuffer _bb) { return GetRootAsReferrable(_bb, new Referrable()); } public static Referrable GetRootAsReferrable(ByteBuffer _bb) { return GetRootAsReferrable(_bb, new Referrable()); }
public static Referrable GetRootAsReferrable(ByteBuffer _bb, Referrable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static Referrable GetRootAsReferrable(ByteBuffer _bb, Referrable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }

View File

@@ -9,7 +9,7 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public final class Referrable extends Table { public final class Referrable extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_26(); }
public static Referrable getRootAsReferrable(ByteBuffer _bb) { return getRootAsReferrable(_bb, new Referrable()); } public static Referrable getRootAsReferrable(ByteBuffer _bb) { return getRootAsReferrable(_bb, new Referrable()); }
public static Referrable getRootAsReferrable(ByteBuffer _bb, Referrable obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static Referrable getRootAsReferrable(ByteBuffer _bb, Referrable obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -36,7 +36,7 @@ class Referrable : Table() {
return (val_1 - val_2).sign return (val_1 - val_2).sign
} }
companion object { companion object {
fun validateVersion() = Constants.FLATBUFFERS_22_10_25() fun validateVersion() = Constants.FLATBUFFERS_22_10_26()
fun getRootAsReferrable(_bb: ByteBuffer): Referrable = getRootAsReferrable(_bb, Referrable()) fun getRootAsReferrable(_bb: ByteBuffer): Referrable = getRootAsReferrable(_bb, Referrable())
fun getRootAsReferrable(_bb: ByteBuffer, obj: Referrable): Referrable { fun getRootAsReferrable(_bb: ByteBuffer, obj: Referrable): Referrable {
_bb.order(ByteOrder.LITTLE_ENDIAN) _bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -53,11 +53,15 @@ class ReferrableT(object):
@classmethod @classmethod
def InitFromBuf(cls, buf, pos): def InitFromBuf(cls, buf, pos):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, 0)
referrable = Referrable() referrable = Referrable()
referrable.Init(buf, pos+n) referrable.Init(buf, pos)
return cls.InitFromObj(referrable) return cls.InitFromObj(referrable)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod @classmethod
def InitFromObj(cls, referrable): def InitFromObj(cls, referrable):
x = ReferrableT() x = ReferrableT()

View File

@@ -13,7 +13,7 @@ public struct Stat : IFlatbufferObject
{ {
private Table __p; private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } } public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_26(); }
public static Stat GetRootAsStat(ByteBuffer _bb) { return GetRootAsStat(_bb, new Stat()); } public static Stat GetRootAsStat(ByteBuffer _bb) { return GetRootAsStat(_bb, new Stat()); }
public static Stat GetRootAsStat(ByteBuffer _bb, Stat obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static Stat GetRootAsStat(ByteBuffer _bb, Stat obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }

View File

@@ -9,7 +9,7 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public final class Stat extends Table { public final class Stat extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_26(); }
public static Stat getRootAsStat(ByteBuffer _bb) { return getRootAsStat(_bb, new Stat()); } public static Stat getRootAsStat(ByteBuffer _bb) { return getRootAsStat(_bb, new Stat()); }
public static Stat getRootAsStat(ByteBuffer _bb, Stat obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static Stat getRootAsStat(ByteBuffer _bb, Stat obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -57,7 +57,7 @@ class Stat : Table() {
return (val_1 - val_2).sign return (val_1 - val_2).sign
} }
companion object { companion object {
fun validateVersion() = Constants.FLATBUFFERS_22_10_25() fun validateVersion() = Constants.FLATBUFFERS_22_10_26()
fun getRootAsStat(_bb: ByteBuffer): Stat = getRootAsStat(_bb, Stat()) fun getRootAsStat(_bb: ByteBuffer): Stat = getRootAsStat(_bb, Stat())
fun getRootAsStat(_bb: ByteBuffer, obj: Stat): Stat { fun getRootAsStat(_bb: ByteBuffer, obj: Stat): Stat {
_bb.order(ByteOrder.LITTLE_ENDIAN) _bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -75,11 +75,15 @@ class StatT(object):
@classmethod @classmethod
def InitFromBuf(cls, buf, pos): def InitFromBuf(cls, buf, pos):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, 0)
stat = Stat() stat = Stat()
stat.Init(buf, pos+n) stat.Init(buf, pos)
return cls.InitFromObj(stat) return cls.InitFromObj(stat)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod @classmethod
def InitFromObj(cls, stat): def InitFromObj(cls, stat):
x = StatT() x = StatT()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -64,11 +64,15 @@ class StructOfStructsT(object):
@classmethod @classmethod
def InitFromBuf(cls, buf, pos): def InitFromBuf(cls, buf, pos):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, 0)
structOfStructs = StructOfStructs() structOfStructs = StructOfStructs()
structOfStructs.Init(buf, pos+n) structOfStructs.Init(buf, pos)
return cls.InitFromObj(structOfStructs) return cls.InitFromObj(structOfStructs)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod @classmethod
def InitFromObj(cls, structOfStructs): def InitFromObj(cls, structOfStructs):
x = StructOfStructsT() x = StructOfStructsT()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -52,11 +52,15 @@ class StructOfStructsOfStructsT(object):
@classmethod @classmethod
def InitFromBuf(cls, buf, pos): def InitFromBuf(cls, buf, pos):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, 0)
structOfStructsOfStructs = StructOfStructsOfStructs() structOfStructsOfStructs = StructOfStructsOfStructs()
structOfStructsOfStructs.Init(buf, pos+n) structOfStructsOfStructs.Init(buf, pos)
return cls.InitFromObj(structOfStructsOfStructs) return cls.InitFromObj(structOfStructsOfStructs)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod @classmethod
def InitFromObj(cls, structOfStructsOfStructs): def InitFromObj(cls, structOfStructsOfStructs):
x = StructOfStructsOfStructsT() x = StructOfStructsOfStructsT()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -39,11 +39,15 @@ class TestT(object):
@classmethod @classmethod
def InitFromBuf(cls, buf, pos): def InitFromBuf(cls, buf, pos):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, 0)
test = Test() test = Test()
test.Init(buf, pos+n) test.Init(buf, pos)
return cls.InitFromObj(test) return cls.InitFromObj(test)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod @classmethod
def InitFromObj(cls, test): def InitFromObj(cls, test):
x = TestT() x = TestT()

View File

@@ -13,7 +13,7 @@ internal partial struct TestSimpleTableWithEnum : IFlatbufferObject
{ {
private Table __p; private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } } public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_26(); }
public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb) { return GetRootAsTestSimpleTableWithEnum(_bb, new TestSimpleTableWithEnum()); } public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb) { return GetRootAsTestSimpleTableWithEnum(_bb, new TestSimpleTableWithEnum()); }
public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }

View File

@@ -9,7 +9,7 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused") @SuppressWarnings("unused")
final class TestSimpleTableWithEnum extends Table { final class TestSimpleTableWithEnum extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_26(); }
public static TestSimpleTableWithEnum getRootAsTestSimpleTableWithEnum(ByteBuffer _bb) { return getRootAsTestSimpleTableWithEnum(_bb, new TestSimpleTableWithEnum()); } public static TestSimpleTableWithEnum getRootAsTestSimpleTableWithEnum(ByteBuffer _bb) { return getRootAsTestSimpleTableWithEnum(_bb, new TestSimpleTableWithEnum()); }
public static TestSimpleTableWithEnum getRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static TestSimpleTableWithEnum getRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -31,7 +31,7 @@ class TestSimpleTableWithEnum : Table() {
} }
} }
companion object { companion object {
fun validateVersion() = Constants.FLATBUFFERS_22_10_25() fun validateVersion() = Constants.FLATBUFFERS_22_10_26()
fun getRootAsTestSimpleTableWithEnum(_bb: ByteBuffer): TestSimpleTableWithEnum = getRootAsTestSimpleTableWithEnum(_bb, TestSimpleTableWithEnum()) fun getRootAsTestSimpleTableWithEnum(_bb: ByteBuffer): TestSimpleTableWithEnum = getRootAsTestSimpleTableWithEnum(_bb, TestSimpleTableWithEnum())
fun getRootAsTestSimpleTableWithEnum(_bb: ByteBuffer, obj: TestSimpleTableWithEnum): TestSimpleTableWithEnum { fun getRootAsTestSimpleTableWithEnum(_bb: ByteBuffer, obj: TestSimpleTableWithEnum): TestSimpleTableWithEnum {
_bb.order(ByteOrder.LITTLE_ENDIAN) _bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -53,11 +53,15 @@ class TestSimpleTableWithEnumT(object):
@classmethod @classmethod
def InitFromBuf(cls, buf, pos): def InitFromBuf(cls, buf, pos):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, 0)
testSimpleTableWithEnum = TestSimpleTableWithEnum() testSimpleTableWithEnum = TestSimpleTableWithEnum()
testSimpleTableWithEnum.Init(buf, pos+n) testSimpleTableWithEnum.Init(buf, pos)
return cls.InitFromObj(testSimpleTableWithEnum) return cls.InitFromObj(testSimpleTableWithEnum)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod @classmethod
def InitFromObj(cls, testSimpleTableWithEnum): def InitFromObj(cls, testSimpleTableWithEnum):
x = TestSimpleTableWithEnumT() x = TestSimpleTableWithEnumT()

View File

@@ -13,7 +13,7 @@ public struct TypeAliases : IFlatbufferObject
{ {
private Table __p; private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } } public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_26(); }
public static TypeAliases GetRootAsTypeAliases(ByteBuffer _bb) { return GetRootAsTypeAliases(_bb, new TypeAliases()); } public static TypeAliases GetRootAsTypeAliases(ByteBuffer _bb) { return GetRootAsTypeAliases(_bb, new TypeAliases()); }
public static TypeAliases GetRootAsTypeAliases(ByteBuffer _bb, TypeAliases obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static TypeAliases GetRootAsTypeAliases(ByteBuffer _bb, TypeAliases obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }

View File

@@ -9,7 +9,7 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public final class TypeAliases extends Table { public final class TypeAliases extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_25(); } public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_26(); }
public static TypeAliases getRootAsTypeAliases(ByteBuffer _bb) { return getRootAsTypeAliases(_bb, new TypeAliases()); } public static TypeAliases getRootAsTypeAliases(ByteBuffer _bb) { return getRootAsTypeAliases(_bb, new TypeAliases()); }
public static TypeAliases getRootAsTypeAliases(ByteBuffer _bb, TypeAliases obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static TypeAliases getRootAsTypeAliases(ByteBuffer _bb, TypeAliases obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }

View File

@@ -203,7 +203,7 @@ class TypeAliases : Table() {
} }
} }
companion object { companion object {
fun validateVersion() = Constants.FLATBUFFERS_22_10_25() fun validateVersion() = Constants.FLATBUFFERS_22_10_26()
fun getRootAsTypeAliases(_bb: ByteBuffer): TypeAliases = getRootAsTypeAliases(_bb, TypeAliases()) fun getRootAsTypeAliases(_bb: ByteBuffer): TypeAliases = getRootAsTypeAliases(_bb, TypeAliases())
fun getRootAsTypeAliases(_bb: ByteBuffer, obj: TypeAliases): TypeAliases { fun getRootAsTypeAliases(_bb: ByteBuffer, obj: TypeAliases): TypeAliases {
_bb.order(ByteOrder.LITTLE_ENDIAN) _bb.order(ByteOrder.LITTLE_ENDIAN)

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

View File

@@ -224,11 +224,15 @@ class TypeAliasesT(object):
@classmethod @classmethod
def InitFromBuf(cls, buf, pos): def InitFromBuf(cls, buf, pos):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, 0)
typeAliases = TypeAliases() typeAliases = TypeAliases()
typeAliases.Init(buf, pos+n) typeAliases.Init(buf, pos)
return cls.InitFromObj(typeAliases) return cls.InitFromObj(typeAliases)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod @classmethod
def InitFromObj(cls, typeAliases): def InitFromObj(cls, typeAliases):
x = TypeAliasesT() x = TypeAliasesT()

View File

@@ -3,7 +3,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : //monster_test.fbs Declared by : //monster_test.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs) Rooting type : MyGame.Example.Monster (//monster_test.fbs)

View File

@@ -2,7 +2,7 @@
Automatically generated by the FlatBuffers compiler, do not modify. Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop. Or modify. I'm a message, not a cop.
flatc version: 22.10.25 flatc version: 22.10.26
Declared by : Declared by :
Rooting type : MyGame.Example.Monster () Rooting type : MyGame.Example.Monster ()

Some files were not shown because too many files have changed in this diff Show More