Skip to content

Commit

Permalink
update goldens with namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaileychess committed Nov 19, 2023
1 parent 0dc5a75 commit d3055a9
Show file tree
Hide file tree
Showing 28 changed files with 158 additions and 92 deletions.
44 changes: 25 additions & 19 deletions goldens/cpp/basic_generated.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
// 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"

// Ensure the included flatbuffers.h is the same version as when this file was
// 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;

Expand Down Expand Up @@ -69,8 +72,8 @@ struct Universe FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
double age() const {
return GetField<double>(VT_AGE, 0.0);
}
const ::flatbuffers::Vector<::flatbuffers::Offset<Galaxy>> *galaxies() const {
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<Galaxy>> *>(VT_GALAXIES);
const ::flatbuffers::Vector<::flatbuffers::Offset<flatbuffers::goldens::Galaxy>> *galaxies() const {
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<flatbuffers::goldens::Galaxy>> *>(VT_GALAXIES);
}
bool Verify(::flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
Expand All @@ -89,7 +92,7 @@ struct UniverseBuilder {
void add_age(double age) {
fbb_.AddElement<double>(Universe::VT_AGE, age, 0.0);
}
void add_galaxies(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<Galaxy>>> galaxies) {
void add_galaxies(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<flatbuffers::goldens::Galaxy>>> galaxies) {
fbb_.AddOffset(Universe::VT_GALAXIES, galaxies);
}
explicit UniverseBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
Expand All @@ -106,7 +109,7 @@ struct UniverseBuilder {
inline ::flatbuffers::Offset<Universe> CreateUniverse(
::flatbuffers::FlatBufferBuilder &_fbb,
double age = 0.0,
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<Galaxy>>> galaxies = 0) {
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<flatbuffers::goldens::Galaxy>>> galaxies = 0) {
UniverseBuilder builder_(_fbb);
builder_.add_age(age);
builder_.add_galaxies(galaxies);
Expand All @@ -116,42 +119,45 @@ inline ::flatbuffers::Offset<Universe> CreateUniverse(
inline ::flatbuffers::Offset<Universe> CreateUniverseDirect(
::flatbuffers::FlatBufferBuilder &_fbb,
double age = 0.0,
const std::vector<::flatbuffers::Offset<Galaxy>> *galaxies = nullptr) {
auto galaxies__ = galaxies ? _fbb.CreateVector<::flatbuffers::Offset<Galaxy>>(*galaxies) : 0;
return CreateUniverse(
const std::vector<::flatbuffers::Offset<flatbuffers::goldens::Galaxy>> *galaxies = nullptr) {
auto galaxies__ = galaxies ? _fbb.CreateVector<::flatbuffers::Offset<flatbuffers::goldens::Galaxy>>(*galaxies) : 0;
return flatbuffers::goldens::CreateUniverse(
_fbb,
age,
galaxies__);
}

inline const Universe *GetUniverse(const void *buf) {
return ::flatbuffers::GetRoot<Universe>(buf);
inline const flatbuffers::goldens::Universe *GetUniverse(const void *buf) {
return ::flatbuffers::GetRoot<flatbuffers::goldens::Universe>(buf);
}

inline const Universe *GetSizePrefixedUniverse(const void *buf) {
return ::flatbuffers::GetSizePrefixedRoot<Universe>(buf);
inline const flatbuffers::goldens::Universe *GetSizePrefixedUniverse(const void *buf) {
return ::flatbuffers::GetSizePrefixedRoot<flatbuffers::goldens::Universe>(buf);
}

inline bool VerifyUniverseBuffer(
::flatbuffers::Verifier &verifier) {
return verifier.VerifyBuffer<Universe>(nullptr);
return verifier.VerifyBuffer<flatbuffers::goldens::Universe>(nullptr);
}

inline bool VerifySizePrefixedUniverseBuffer(
::flatbuffers::Verifier &verifier) {
return verifier.VerifySizePrefixedBuffer<Universe>(nullptr);
return verifier.VerifySizePrefixedBuffer<flatbuffers::goldens::Universe>(nullptr);
}

inline void FinishUniverseBuffer(
::flatbuffers::FlatBufferBuilder &fbb,
::flatbuffers::Offset<Universe> root) {
::flatbuffers::Offset<flatbuffers::goldens::Universe> root) {
fbb.Finish(root);
}

inline void FinishSizePrefixedUniverseBuffer(
::flatbuffers::FlatBufferBuilder &fbb,
::flatbuffers::Offset<Universe> root) {
::flatbuffers::Offset<flatbuffers::goldens::Universe> root) {
fbb.FinishSizePrefixed(root);
}

#endif // FLATBUFFERS_GENERATED_BASIC_H_
} // namespace goldens
} // namespace flatbuffers

#endif // FLATBUFFERS_GENERATED_BASIC_FLATBUFFERS_GOLDENS_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>

namespace flatbuffers.goldens
{

using global::System;
using global::System.Collections.Generic;
using global::Google.FlatBuffers;
Expand All @@ -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<Galaxy> CreateGalaxy(FlatBufferBuilder builder,
public static Offset<flatbuffers.goldens.Galaxy> CreateGalaxy(FlatBufferBuilder builder,
long num_stars = 0) {
builder.StartTable(1);
Galaxy.AddNumStars(builder, num_stars);
Expand All @@ -27,9 +30,9 @@ public static Offset<Galaxy> 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<Galaxy> EndGalaxy(FlatBufferBuilder builder) {
public static Offset<flatbuffers.goldens.Galaxy> EndGalaxy(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset<Galaxy>(o);
return new Offset<flatbuffers.goldens.Galaxy>(o);
}
}

Expand All @@ -43,3 +46,5 @@ static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
&& verifier.VerifyTableEnd(tablePos);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>

namespace flatbuffers.goldens
{

using global::System;
using global::System.Collections.Generic;
using global::Google.FlatBuffers;
Expand All @@ -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<Universe> CreateUniverse(FlatBufferBuilder builder,
public static Offset<flatbuffers.goldens.Universe> CreateUniverse(FlatBufferBuilder builder,
double age = 0.0,
VectorOffset galaxiesOffset = default(VectorOffset)) {
builder.StartTable(2);
Expand All @@ -33,17 +36,17 @@ public static Offset<Universe> 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<Galaxy>[] 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<Galaxy>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateGalaxiesVectorBlock(FlatBufferBuilder builder, ArraySegment<Offset<Galaxy>> 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<Offset<Galaxy>>(dataPtr, sizeInBytes); return builder.EndVector(); }
public static VectorOffset CreateGalaxiesVector(FlatBufferBuilder builder, Offset<flatbuffers.goldens.Galaxy>[] 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<flatbuffers.goldens.Galaxy>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateGalaxiesVectorBlock(FlatBufferBuilder builder, ArraySegment<Offset<flatbuffers.goldens.Galaxy>> 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<Offset<flatbuffers.goldens.Galaxy>>(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartGalaxiesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static Offset<Universe> EndUniverse(FlatBufferBuilder builder) {
public static Offset<flatbuffers.goldens.Universe> EndUniverse(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset<Universe>(o);
return new Offset<flatbuffers.goldens.Universe>(o);
}
public static void FinishUniverseBuffer(FlatBufferBuilder builder, Offset<Universe> offset) { builder.Finish(offset.Value); }
public static void FinishSizePrefixedUniverseBuffer(FlatBufferBuilder builder, Offset<Universe> offset) { builder.FinishSizePrefixed(offset.Value); }
public static void FinishUniverseBuffer(FlatBufferBuilder builder, Offset<flatbuffers.goldens.Universe> offset) { builder.Finish(offset.Value); }
public static void FinishSizePrefixedUniverseBuffer(FlatBufferBuilder builder, Offset<flatbuffers.goldens.Universe> offset) { builder.FinishSizePrefixed(offset.Value); }
}


Expand All @@ -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);
}
}

}
Original file line number Diff line number Diff line change
@@ -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;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down
30 changes: 16 additions & 14 deletions goldens/lobster/basic_generated.lobster
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion goldens/lua/Galaxy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion goldens/lua/Universe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion goldens/nim/Galaxy.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion goldens/nim/Universe.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit d3055a9

Please sign in to comment.