diff --git a/goldens/cpp/basic_generated.h b/goldens/cpp/basic_generated.h index 5d2369603bb..22a28e1f1b4 100644 --- a/goldens/cpp/basic_generated.h +++ b/goldens/cpp/basic_generated.h @@ -1,8 +1,8 @@ // automatically generated by the FlatBuffers compiler, do not modify -#ifndef FLATBUFFERS_GENERATED_BASIC_H_ -#define FLATBUFFERS_GENERATED_BASIC_H_ +#ifndef FLATBUFFERS_GENERATED_BASIC_FLATBUFFERS_GOLDENS_H_ +#define FLATBUFFERS_GENERATED_BASIC_FLATBUFFERS_GOLDENS_H_ #include "flatbuffers/flatbuffers.h" @@ -10,9 +10,12 @@ // generated, otherwise it may not be compatible. static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 9, + FLATBUFFERS_VERSION_REVISION == 26, "Non-compatible flatbuffers version included"); +namespace flatbuffers { +namespace goldens { + struct Galaxy; struct GalaxyBuilder; @@ -69,8 +72,8 @@ struct Universe FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { double age() const { return GetField(VT_AGE, 0.0); } - const ::flatbuffers::Vector<::flatbuffers::Offset> *galaxies() const { - return GetPointer> *>(VT_GALAXIES); + const ::flatbuffers::Vector<::flatbuffers::Offset> *galaxies() const { + return GetPointer> *>(VT_GALAXIES); } bool Verify(::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && @@ -89,7 +92,7 @@ struct UniverseBuilder { void add_age(double age) { fbb_.AddElement(Universe::VT_AGE, age, 0.0); } - void add_galaxies(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset>> galaxies) { + void add_galaxies(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset>> galaxies) { fbb_.AddOffset(Universe::VT_GALAXIES, galaxies); } explicit UniverseBuilder(::flatbuffers::FlatBufferBuilder &_fbb) @@ -106,7 +109,7 @@ struct UniverseBuilder { inline ::flatbuffers::Offset CreateUniverse( ::flatbuffers::FlatBufferBuilder &_fbb, double age = 0.0, - ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset>> galaxies = 0) { + ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset>> galaxies = 0) { UniverseBuilder builder_(_fbb); builder_.add_age(age); builder_.add_galaxies(galaxies); @@ -116,42 +119,45 @@ inline ::flatbuffers::Offset CreateUniverse( inline ::flatbuffers::Offset CreateUniverseDirect( ::flatbuffers::FlatBufferBuilder &_fbb, double age = 0.0, - const std::vector<::flatbuffers::Offset> *galaxies = nullptr) { - auto galaxies__ = galaxies ? _fbb.CreateVector<::flatbuffers::Offset>(*galaxies) : 0; - return CreateUniverse( + const std::vector<::flatbuffers::Offset> *galaxies = nullptr) { + auto galaxies__ = galaxies ? _fbb.CreateVector<::flatbuffers::Offset>(*galaxies) : 0; + return flatbuffers::goldens::CreateUniverse( _fbb, age, galaxies__); } -inline const Universe *GetUniverse(const void *buf) { - return ::flatbuffers::GetRoot(buf); +inline const flatbuffers::goldens::Universe *GetUniverse(const void *buf) { + return ::flatbuffers::GetRoot(buf); } -inline const Universe *GetSizePrefixedUniverse(const void *buf) { - return ::flatbuffers::GetSizePrefixedRoot(buf); +inline const flatbuffers::goldens::Universe *GetSizePrefixedUniverse(const void *buf) { + return ::flatbuffers::GetSizePrefixedRoot(buf); } inline bool VerifyUniverseBuffer( ::flatbuffers::Verifier &verifier) { - return verifier.VerifyBuffer(nullptr); + return verifier.VerifyBuffer(nullptr); } inline bool VerifySizePrefixedUniverseBuffer( ::flatbuffers::Verifier &verifier) { - return verifier.VerifySizePrefixedBuffer(nullptr); + return verifier.VerifySizePrefixedBuffer(nullptr); } inline void FinishUniverseBuffer( ::flatbuffers::FlatBufferBuilder &fbb, - ::flatbuffers::Offset root) { + ::flatbuffers::Offset root) { fbb.Finish(root); } inline void FinishSizePrefixedUniverseBuffer( ::flatbuffers::FlatBufferBuilder &fbb, - ::flatbuffers::Offset root) { + ::flatbuffers::Offset root) { fbb.FinishSizePrefixed(root); } -#endif // FLATBUFFERS_GENERATED_BASIC_H_ +} // namespace goldens +} // namespace flatbuffers + +#endif // FLATBUFFERS_GENERATED_BASIC_FLATBUFFERS_GOLDENS_H_ diff --git a/goldens/csharp/Galaxy.cs b/goldens/csharp/flatbuffers/goldens/Galaxy.cs similarity index 85% rename from goldens/csharp/Galaxy.cs rename to goldens/csharp/flatbuffers/goldens/Galaxy.cs index 7925ce573fd..26d311da9bc 100644 --- a/goldens/csharp/Galaxy.cs +++ b/goldens/csharp/flatbuffers/goldens/Galaxy.cs @@ -2,6 +2,9 @@ // automatically generated by the FlatBuffers compiler, do not modify // +namespace flatbuffers.goldens +{ + using global::System; using global::System.Collections.Generic; using global::Google.FlatBuffers; @@ -18,7 +21,7 @@ public struct Galaxy : IFlatbufferObject public long NumStars { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } - public static Offset CreateGalaxy(FlatBufferBuilder builder, + public static Offset CreateGalaxy(FlatBufferBuilder builder, long num_stars = 0) { builder.StartTable(1); Galaxy.AddNumStars(builder, num_stars); @@ -27,9 +30,9 @@ public static Offset CreateGalaxy(FlatBufferBuilder builder, public static void StartGalaxy(FlatBufferBuilder builder) { builder.StartTable(1); } public static void AddNumStars(FlatBufferBuilder builder, long numStars) { builder.AddLong(0, numStars, 0); } - public static Offset EndGalaxy(FlatBufferBuilder builder) { + public static Offset EndGalaxy(FlatBufferBuilder builder) { int o = builder.EndTable(); - return new Offset(o); + return new Offset(o); } } @@ -43,3 +46,5 @@ static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos) && verifier.VerifyTableEnd(tablePos); } } + +} diff --git a/goldens/csharp/Universe.cs b/goldens/csharp/flatbuffers/goldens/Universe.cs similarity index 66% rename from goldens/csharp/Universe.cs rename to goldens/csharp/flatbuffers/goldens/Universe.cs index 16b5b9c87cd..134fbb06899 100644 --- a/goldens/csharp/Universe.cs +++ b/goldens/csharp/flatbuffers/goldens/Universe.cs @@ -2,6 +2,9 @@ // automatically generated by the FlatBuffers compiler, do not modify // +namespace flatbuffers.goldens +{ + using global::System; using global::System.Collections.Generic; using global::Google.FlatBuffers; @@ -18,10 +21,10 @@ public struct Universe : IFlatbufferObject public Universe __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } public double Age { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetDouble(o + __p.bb_pos) : (double)0.0; } } - public Galaxy? Galaxies(int j) { int o = __p.__offset(6); return o != 0 ? (Galaxy?)(new Galaxy()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; } + public flatbuffers.goldens.Galaxy? Galaxies(int j) { int o = __p.__offset(6); return o != 0 ? (flatbuffers.goldens.Galaxy?)(new flatbuffers.goldens.Galaxy()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; } public int GalaxiesLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } } - public static Offset CreateUniverse(FlatBufferBuilder builder, + public static Offset CreateUniverse(FlatBufferBuilder builder, double age = 0.0, VectorOffset galaxiesOffset = default(VectorOffset)) { builder.StartTable(2); @@ -33,17 +36,17 @@ public static Offset CreateUniverse(FlatBufferBuilder builder, public static void StartUniverse(FlatBufferBuilder builder) { builder.StartTable(2); } public static void AddAge(FlatBufferBuilder builder, double age) { builder.AddDouble(0, age, 0.0); } public static void AddGalaxies(FlatBufferBuilder builder, VectorOffset galaxiesOffset) { builder.AddOffset(1, galaxiesOffset.Value, 0); } - public static VectorOffset CreateGalaxiesVector(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); } - public static VectorOffset CreateGalaxiesVectorBlock(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); } - public static VectorOffset CreateGalaxiesVectorBlock(FlatBufferBuilder builder, ArraySegment> data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); } - public static VectorOffset CreateGalaxiesVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add>(dataPtr, sizeInBytes); return builder.EndVector(); } + public static VectorOffset CreateGalaxiesVector(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); } + public static VectorOffset CreateGalaxiesVectorBlock(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); } + public static VectorOffset CreateGalaxiesVectorBlock(FlatBufferBuilder builder, ArraySegment> data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); } + public static VectorOffset CreateGalaxiesVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add>(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartGalaxiesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); } - public static Offset EndUniverse(FlatBufferBuilder builder) { + public static Offset EndUniverse(FlatBufferBuilder builder) { int o = builder.EndTable(); - return new Offset(o); + return new Offset(o); } - public static void FinishUniverseBuffer(FlatBufferBuilder builder, Offset offset) { builder.Finish(offset.Value); } - public static void FinishSizePrefixedUniverseBuffer(FlatBufferBuilder builder, Offset offset) { builder.FinishSizePrefixed(offset.Value); } + public static void FinishUniverseBuffer(FlatBufferBuilder builder, Offset offset) { builder.Finish(offset.Value); } + public static void FinishSizePrefixedUniverseBuffer(FlatBufferBuilder builder, Offset offset) { builder.FinishSizePrefixed(offset.Value); } } @@ -53,7 +56,9 @@ static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos) { return verifier.VerifyTableStart(tablePos) && verifier.VerifyField(tablePos, 4 /*Age*/, 8 /*double*/, 8, false) - && verifier.VerifyVectorOfTables(tablePos, 6 /*Galaxies*/, GalaxyVerify.Verify, false) + && verifier.VerifyVectorOfTables(tablePos, 6 /*Galaxies*/, flatbuffers.goldens.GalaxyVerify.Verify, false) && verifier.VerifyTableEnd(tablePos); } } + +} diff --git a/goldens/dart/basic_generated.dart b/goldens/dart/basic_flatbuffers.goldens_generated.dart similarity index 99% rename from goldens/dart/basic_generated.dart rename to goldens/dart/basic_flatbuffers.goldens_generated.dart index dabd5960195..08c1fa77398 100644 --- a/goldens/dart/basic_generated.dart +++ b/goldens/dart/basic_flatbuffers.goldens_generated.dart @@ -1,6 +1,8 @@ // automatically generated by the FlatBuffers compiler, do not modify // ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable +library flatbuffers.goldens; + import 'dart:typed_data' show Uint8List; import 'package:flat_buffers/flat_buffers.dart' as fb; diff --git a/goldens/go/Galaxy.go b/goldens/go/flatbuffers/goldens/Galaxy.go similarity index 98% rename from goldens/go/Galaxy.go rename to goldens/go/flatbuffers/goldens/Galaxy.go index 870490518d7..a0cd0ae719f 100644 --- a/goldens/go/Galaxy.go +++ b/goldens/go/flatbuffers/goldens/Galaxy.go @@ -1,6 +1,6 @@ // Code generated by the FlatBuffers compiler. DO NOT EDIT. -package Galaxy +package goldens import ( flatbuffers "github.com/google/flatbuffers/go" diff --git a/goldens/go/Universe.go b/goldens/go/flatbuffers/goldens/Universe.go similarity index 99% rename from goldens/go/Universe.go rename to goldens/go/flatbuffers/goldens/Universe.go index 0f07f16933c..d8fd83327af 100644 --- a/goldens/go/Universe.go +++ b/goldens/go/flatbuffers/goldens/Universe.go @@ -1,6 +1,6 @@ // Code generated by the FlatBuffers compiler. DO NOT EDIT. -package Universe +package goldens import ( flatbuffers "github.com/google/flatbuffers/go" diff --git a/goldens/java/Galaxy.java b/goldens/java/flatbuffers/goldens/Galaxy.java similarity index 98% rename from goldens/java/Galaxy.java rename to goldens/java/flatbuffers/goldens/Galaxy.java index bcf139f3daa..22b2a4e38c3 100644 --- a/goldens/java/Galaxy.java +++ b/goldens/java/flatbuffers/goldens/Galaxy.java @@ -1,5 +1,7 @@ // automatically generated by the FlatBuffers compiler, do not modify +package flatbuffers.goldens; + import com.google.flatbuffers.BaseVector; import com.google.flatbuffers.BooleanVector; import com.google.flatbuffers.ByteVector; diff --git a/goldens/java/Universe.java b/goldens/java/flatbuffers/goldens/Universe.java similarity index 83% rename from goldens/java/Universe.java rename to goldens/java/flatbuffers/goldens/Universe.java index 400c91a694b..4850e6782f5 100644 --- a/goldens/java/Universe.java +++ b/goldens/java/flatbuffers/goldens/Universe.java @@ -1,5 +1,7 @@ // automatically generated by the FlatBuffers compiler, do not modify +package flatbuffers.goldens; + import com.google.flatbuffers.BaseVector; import com.google.flatbuffers.BooleanVector; import com.google.flatbuffers.ByteVector; @@ -26,11 +28,11 @@ public final class Universe extends Table { public Universe __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } public double age() { int o = __offset(4); return o != 0 ? bb.getDouble(o + bb_pos) : 0.0; } - public Galaxy galaxies(int j) { return galaxies(new Galaxy(), j); } - public Galaxy galaxies(Galaxy obj, int j) { int o = __offset(6); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; } + public flatbuffers.goldens.Galaxy galaxies(int j) { return galaxies(new flatbuffers.goldens.Galaxy(), j); } + public flatbuffers.goldens.Galaxy galaxies(flatbuffers.goldens.Galaxy obj, int j) { int o = __offset(6); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; } public int galaxiesLength() { int o = __offset(6); return o != 0 ? __vector_len(o) : 0; } - public Galaxy.Vector galaxiesVector() { return galaxiesVector(new Galaxy.Vector()); } - public Galaxy.Vector galaxiesVector(Galaxy.Vector obj) { int o = __offset(6); return o != 0 ? obj.__assign(__vector(o), 4, bb) : null; } + public flatbuffers.goldens.Galaxy.Vector galaxiesVector() { return galaxiesVector(new flatbuffers.goldens.Galaxy.Vector()); } + public flatbuffers.goldens.Galaxy.Vector galaxiesVector(flatbuffers.goldens.Galaxy.Vector obj) { int o = __offset(6); return o != 0 ? obj.__assign(__vector(o), 4, bb) : null; } public static int createUniverse(FlatBufferBuilder builder, double age, diff --git a/goldens/kotlin/Galaxy.kt b/goldens/kotlin/flatbuffers/goldens/Galaxy.kt similarity index 98% rename from goldens/kotlin/Galaxy.kt rename to goldens/kotlin/flatbuffers/goldens/Galaxy.kt index 5f2228d8472..04a27d00627 100644 --- a/goldens/kotlin/Galaxy.kt +++ b/goldens/kotlin/flatbuffers/goldens/Galaxy.kt @@ -1,5 +1,7 @@ // automatically generated by the FlatBuffers compiler, do not modify +package flatbuffers.goldens + import com.google.flatbuffers.BaseVector import com.google.flatbuffers.BooleanVector import com.google.flatbuffers.ByteVector diff --git a/goldens/kotlin/Universe.kt b/goldens/kotlin/flatbuffers/goldens/Universe.kt similarity index 93% rename from goldens/kotlin/Universe.kt rename to goldens/kotlin/flatbuffers/goldens/Universe.kt index 3438171795e..140e35ea4cc 100644 --- a/goldens/kotlin/Universe.kt +++ b/goldens/kotlin/flatbuffers/goldens/Universe.kt @@ -1,5 +1,7 @@ // automatically generated by the FlatBuffers compiler, do not modify +package flatbuffers.goldens + import com.google.flatbuffers.BaseVector import com.google.flatbuffers.BooleanVector import com.google.flatbuffers.ByteVector @@ -31,8 +33,8 @@ class Universe : Table() { val o = __offset(4) return if(o != 0) bb.getDouble(o + bb_pos) else 0.0 } - fun galaxies(j: Int) : Galaxy? = galaxies(Galaxy(), j) - fun galaxies(obj: Galaxy, j: Int) : Galaxy? { + fun galaxies(j: Int) : flatbuffers.goldens.Galaxy? = galaxies(flatbuffers.goldens.Galaxy(), j) + fun galaxies(obj: flatbuffers.goldens.Galaxy, j: Int) : flatbuffers.goldens.Galaxy? { val o = __offset(6) return if (o != 0) { obj.__assign(__indirect(__vector(o) + j * 4), bb) diff --git a/goldens/lobster/basic_generated.lobster b/goldens/lobster/basic_generated.lobster index 5d4fd25b87b..ade4b824d49 100644 --- a/goldens/lobster/basic_generated.lobster +++ b/goldens/lobster/basic_generated.lobster @@ -1,18 +1,20 @@ // automatically generated by the FlatBuffers compiler, do not modify import flatbuffers +namespace flatbuffers.goldens + class Galaxy class Universe -class Galaxy : flatbuffers_handle +class Galaxy : flatbuffers.handle def num_stars() -> int: - return buf_.flatbuffers_field_int64(pos_, 4, 0) + return flatbuffers.field_int64(buf_, pos_, 4, 0) -def GetRootAsGalaxy(buf:string): return Galaxy { buf, buf.flatbuffers_indirect(0) } +def GetRootAsGalaxy(buf:string): return Galaxy { buf, flatbuffers.indirect(buf, 0) } struct GalaxyBuilder: - b_:flatbuffers_builder + b_:flatbuffers.builder def start(): b_.StartObject(1) return this @@ -22,33 +24,33 @@ struct GalaxyBuilder: def end(): return b_.EndObject() -class Universe : flatbuffers_handle +class Universe : flatbuffers.handle def age() -> float: - return buf_.flatbuffers_field_float64(pos_, 4, 0.0) - def galaxies(i:int) -> Galaxy: - return Galaxy { buf_, buf_.flatbuffers_indirect(buf_.flatbuffers_field_vector(pos_, 6) + i * 4) } + return flatbuffers.field_float64(buf_, pos_, 4, 0.0) + def galaxies(i:int) -> flatbuffers.goldens.Galaxy: + return flatbuffers.goldens.Galaxy { buf_, flatbuffers.indirect(buf_, flatbuffers.field_vector(buf_, pos_, 6) + i * 4) } def galaxies_length() -> int: - return buf_.flatbuffers_field_vector_len(pos_, 6) + return flatbuffers.field_vector_len(buf_, pos_, 6) -def GetRootAsUniverse(buf:string): return Universe { buf, buf.flatbuffers_indirect(0) } +def GetRootAsUniverse(buf:string): return Universe { buf, flatbuffers.indirect(buf, 0) } struct UniverseBuilder: - b_:flatbuffers_builder + b_:flatbuffers.builder def start(): b_.StartObject(2) return this def add_age(age:float): b_.PrependFloat64Slot(0, age, 0.0) return this - def add_galaxies(galaxies:flatbuffers_offset): + def add_galaxies(galaxies:flatbuffers.offset): b_.PrependUOffsetTRelativeSlot(1, galaxies) return this def end(): return b_.EndObject() -def UniverseStartGalaxiesVector(b_:flatbuffers_builder, n_:int): +def UniverseStartGalaxiesVector(b_:flatbuffers.builder, n_:int): b_.StartVector(4, n_, 4) -def UniverseCreateGalaxiesVector(b_:flatbuffers_builder, v_:[flatbuffers_offset]): +def UniverseCreateGalaxiesVector(b_:flatbuffers.builder, v_:[flatbuffers.offset]): b_.StartVector(4, v_.length, 4) reverse(v_) e_: b_.PrependUOffsetTRelative(e_) return b_.EndVector(v_.length) diff --git a/goldens/lua/Galaxy.lua b/goldens/lua/Galaxy.lua index 071a1c80a1e..fd346081921 100644 --- a/goldens/lua/Galaxy.lua +++ b/goldens/lua/Galaxy.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.9 + flatc version: 23.5.26 Declared by : //basic.fbs Rooting type : Universe (//basic.fbs) diff --git a/goldens/lua/Universe.lua b/goldens/lua/Universe.lua index d7ef085ebcb..74a7761e0fd 100644 --- a/goldens/lua/Universe.lua +++ b/goldens/lua/Universe.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.9 + flatc version: 23.5.26 Declared by : //basic.fbs Rooting type : Universe (//basic.fbs) diff --git a/goldens/nim/Galaxy.nim b/goldens/nim/Galaxy.nim index 7728c3677ae..76b1e4a2e03 100644 --- a/goldens/nim/Galaxy.nim +++ b/goldens/nim/Galaxy.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.9 + flatc version: 23.5.26 Declared by : //basic.fbs Rooting type : Universe (//basic.fbs) diff --git a/goldens/nim/Universe.nim b/goldens/nim/Universe.nim index 3a4e43d2b07..a3e8a9114f8 100644 --- a/goldens/nim/Universe.nim +++ b/goldens/nim/Universe.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.9 + flatc version: 23.5.26 Declared by : //basic.fbs Rooting type : Universe (//basic.fbs) diff --git a/goldens/php/Galaxy.php b/goldens/php/flatbuffers/goldens/Galaxy.php similarity index 98% rename from goldens/php/Galaxy.php rename to goldens/php/flatbuffers/goldens/Galaxy.php index 256a72e4bf3..d29a09a7665 100644 --- a/goldens/php/Galaxy.php +++ b/goldens/php/flatbuffers/goldens/Galaxy.php @@ -1,6 +1,8 @@ Galaxy<'a> { Galaxy { _tab: table } } #[allow(unused_mut)] - pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( - _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, + pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>( + _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>, args: &'args GalaxyArgs ) -> flatbuffers::WIPOffset> { let mut builder = GalaxyBuilder::new(_fbb); @@ -75,17 +92,17 @@ impl<'a> Default for GalaxyArgs { } } -pub struct GalaxyBuilder<'a: 'b, 'b> { - fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, +pub struct GalaxyBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> { + fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, start_: flatbuffers::WIPOffset, } -impl<'a: 'b, 'b> GalaxyBuilder<'a, 'b> { +impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GalaxyBuilder<'a, 'b, A> { #[inline] pub fn add_num_stars(&mut self, num_stars: i64) { self.fbb_.push_slot::(Galaxy::VT_NUM_STARS, num_stars, 0); } #[inline] - pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> GalaxyBuilder<'a, 'b> { + pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> GalaxyBuilder<'a, 'b, A> { let start = _fbb.start_table(); GalaxyBuilder { fbb_: _fbb, @@ -130,8 +147,8 @@ impl<'a> Universe<'a> { Universe { _tab: table } } #[allow(unused_mut)] - pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( - _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, + pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>( + _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>, args: &'args UniverseArgs<'args> ) -> flatbuffers::WIPOffset> { let mut builder = UniverseBuilder::new(_fbb); @@ -184,11 +201,11 @@ impl<'a> Default for UniverseArgs<'a> { } } -pub struct UniverseBuilder<'a: 'b, 'b> { - fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, +pub struct UniverseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> { + fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, start_: flatbuffers::WIPOffset, } -impl<'a: 'b, 'b> UniverseBuilder<'a, 'b> { +impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UniverseBuilder<'a, 'b, A> { #[inline] pub fn add_age(&mut self, age: f64) { self.fbb_.push_slot::(Universe::VT_AGE, age, 0.0); @@ -198,7 +215,7 @@ impl<'a: 'b, 'b> UniverseBuilder<'a, 'b> { self.fbb_.push_slot_always::>(Universe::VT_GALAXIES, galaxies); } #[inline] - pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> UniverseBuilder<'a, 'b> { + pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> UniverseBuilder<'a, 'b, A> { let start = _fbb.start_table(); UniverseBuilder { fbb_: _fbb, @@ -281,13 +298,16 @@ pub unsafe fn size_prefixed_root_as_universe_unchecked(buf: &[u8]) -> Universe { flatbuffers::size_prefixed_root_unchecked::(buf) } #[inline] -pub fn finish_universe_buffer<'a, 'b>( - fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, +pub fn finish_universe_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>( + fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, root: flatbuffers::WIPOffset>) { fbb.finish(root, None); } #[inline] -pub fn finish_size_prefixed_universe_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset>) { +pub fn finish_size_prefixed_universe_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, root: flatbuffers::WIPOffset>) { fbb.finish_size_prefixed(root, None); } +} // pub mod goldens +} // pub mod flatbuffers + diff --git a/goldens/schema/basic.fbs b/goldens/schema/basic.fbs index 8034599c7d2..b4574a1c1f3 100644 --- a/goldens/schema/basic.fbs +++ b/goldens/schema/basic.fbs @@ -1,6 +1,8 @@ // This file should contain the basics of flatbuffers that all languages should // support. +namespace flatbuffers.goldens; + table Galaxy { num_stars:long; } diff --git a/goldens/swift/basic_generated.swift b/goldens/swift/basic_generated.swift index 7ea2d68b680..3943c37ab8b 100644 --- a/goldens/swift/basic_generated.swift +++ b/goldens/swift/basic_generated.swift @@ -4,7 +4,7 @@ import FlatBuffers -public struct Galaxy: FlatBufferObject, Verifiable { +public struct flatbuffers_goldens_Galaxy: FlatBufferObject, Verifiable { static func validateVersion() { FlatBuffersVersion_23_5_26() } public var __buffer: ByteBuffer! { return _accessor.bb } @@ -27,9 +27,9 @@ public struct Galaxy: FlatBufferObject, Verifiable { _ fbb: inout FlatBufferBuilder, numStars: Int64 = 0 ) -> Offset { - let __start = Galaxy.startGalaxy(&fbb) - Galaxy.add(numStars: numStars, &fbb) - return Galaxy.endGalaxy(&fbb, start: __start) + let __start = flatbuffers_goldens_Galaxy.startGalaxy(&fbb) + flatbuffers_goldens_Galaxy.add(numStars: numStars, &fbb) + return flatbuffers_goldens_Galaxy.endGalaxy(&fbb, start: __start) } public static func verify(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable { @@ -39,7 +39,7 @@ public struct Galaxy: FlatBufferObject, Verifiable { } } -public struct Universe: FlatBufferObject, Verifiable { +public struct flatbuffers_goldens_Universe: FlatBufferObject, Verifiable { static func validateVersion() { FlatBuffersVersion_23_5_26() } public var __buffer: ByteBuffer! { return _accessor.bb } @@ -58,7 +58,7 @@ public struct Universe: FlatBufferObject, Verifiable { public var age: Double { let o = _accessor.offset(VTOFFSET.age.v); return o == 0 ? 0.0 : _accessor.readBuffer(of: Double.self, at: o) } public var hasGalaxies: Bool { let o = _accessor.offset(VTOFFSET.galaxies.v); return o == 0 ? false : true } public var galaxiesCount: Int32 { let o = _accessor.offset(VTOFFSET.galaxies.v); return o == 0 ? 0 : _accessor.vector(count: o) } - public func galaxies(at index: Int32) -> Galaxy? { let o = _accessor.offset(VTOFFSET.galaxies.v); return o == 0 ? nil : Galaxy(_accessor.bb, o: _accessor.indirect(_accessor.vector(at: o) + index * 4)) } + public func galaxies(at index: Int32) -> flatbuffers_goldens_Galaxy? { let o = _accessor.offset(VTOFFSET.galaxies.v); return o == 0 ? nil : flatbuffers_goldens_Galaxy(_accessor.bb, o: _accessor.indirect(_accessor.vector(at: o) + index * 4)) } public static func startUniverse(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 2) } public static func add(age: Double, _ fbb: inout FlatBufferBuilder) { fbb.add(element: age, def: 0.0, at: VTOFFSET.age.p) } public static func addVectorOf(galaxies: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: galaxies, at: VTOFFSET.galaxies.p) } @@ -68,16 +68,16 @@ public struct Universe: FlatBufferObject, Verifiable { age: Double = 0.0, galaxiesVectorOffset galaxies: Offset = Offset() ) -> Offset { - let __start = Universe.startUniverse(&fbb) - Universe.add(age: age, &fbb) - Universe.addVectorOf(galaxies: galaxies, &fbb) - return Universe.endUniverse(&fbb, start: __start) + let __start = flatbuffers_goldens_Universe.startUniverse(&fbb) + flatbuffers_goldens_Universe.add(age: age, &fbb) + flatbuffers_goldens_Universe.addVectorOf(galaxies: galaxies, &fbb) + return flatbuffers_goldens_Universe.endUniverse(&fbb, start: __start) } public static func verify(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable { var _v = try verifier.visitTable(at: position) try _v.visit(field: VTOFFSET.age.p, fieldName: "age", required: false, type: Double.self) - try _v.visit(field: VTOFFSET.galaxies.p, fieldName: "galaxies", required: false, type: ForwardOffset, Galaxy>>.self) + try _v.visit(field: VTOFFSET.galaxies.p, fieldName: "galaxies", required: false, type: ForwardOffset, flatbuffers_goldens_Galaxy>>.self) _v.finish() } } diff --git a/goldens/ts/basic.ts b/goldens/ts/basic.ts index 76af441a942..bf563a0b8d8 100644 --- a/goldens/ts/basic.ts +++ b/goldens/ts/basic.ts @@ -1,4 +1,6 @@ // automatically generated by the FlatBuffers compiler, do not modify +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ + export { Galaxy } from './galaxy.js'; export { Universe } from './universe.js'; diff --git a/goldens/ts/flatbuffers/goldens.ts b/goldens/ts/flatbuffers/goldens.ts new file mode 100644 index 00000000000..0d2097f7816 --- /dev/null +++ b/goldens/ts/flatbuffers/goldens.ts @@ -0,0 +1,6 @@ +// automatically generated by the FlatBuffers compiler, do not modify + +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ + +export { Galaxy } from './goldens/galaxy.js'; +export { Universe } from './goldens/universe.js'; diff --git a/goldens/ts/galaxy.ts b/goldens/ts/flatbuffers/goldens/galaxy.ts similarity index 91% rename from goldens/ts/galaxy.ts rename to goldens/ts/flatbuffers/goldens/galaxy.ts index 8576cbf8320..1d3c50d68bd 100644 --- a/goldens/ts/galaxy.ts +++ b/goldens/ts/flatbuffers/goldens/galaxy.ts @@ -1,5 +1,7 @@ // automatically generated by the FlatBuffers compiler, do not modify +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ + import * as flatbuffers from 'flatbuffers'; export class Galaxy { diff --git a/goldens/ts/universe.ts b/goldens/ts/flatbuffers/goldens/universe.ts similarity index 93% rename from goldens/ts/universe.ts rename to goldens/ts/flatbuffers/goldens/universe.ts index 2f8c26cffc7..5634d78314a 100644 --- a/goldens/ts/universe.ts +++ b/goldens/ts/flatbuffers/goldens/universe.ts @@ -1,8 +1,10 @@ // automatically generated by the FlatBuffers compiler, do not modify +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ + import * as flatbuffers from 'flatbuffers'; -import { Galaxy } from './galaxy.js'; +import { Galaxy } from '../../flatbuffers/goldens/galaxy.js'; export class Universe {