mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-09 14:46:26 +00:00
Add scalar type aliases for int8, uint8, ..., f32, f64 (#4400)
* Add type aliases * Add generated code * Rebase master
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
3282a84e30
commit
f2b3705c2c
102
tests/MyGame/Example/TypeAliases.cs
Normal file
102
tests/MyGame/Example/TypeAliases.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace MyGame.Example
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct TypeAliases : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
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 void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public TypeAliases __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public sbyte I8 { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetSbyte(o + __p.bb_pos) : (sbyte)0; } }
|
||||
public bool MutateI8(sbyte i8) { int o = __p.__offset(4); if (o != 0) { __p.bb.PutSbyte(o + __p.bb_pos, i8); return true; } else { return false; } }
|
||||
public byte U8 { get { int o = __p.__offset(6); return o != 0 ? __p.bb.Get(o + __p.bb_pos) : (byte)0; } }
|
||||
public bool MutateU8(byte u8) { int o = __p.__offset(6); if (o != 0) { __p.bb.Put(o + __p.bb_pos, u8); return true; } else { return false; } }
|
||||
public short I16 { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetShort(o + __p.bb_pos) : (short)0; } }
|
||||
public bool MutateI16(short i16) { int o = __p.__offset(8); if (o != 0) { __p.bb.PutShort(o + __p.bb_pos, i16); return true; } else { return false; } }
|
||||
public ushort U16 { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } }
|
||||
public bool MutateU16(ushort u16) { int o = __p.__offset(10); if (o != 0) { __p.bb.PutUshort(o + __p.bb_pos, u16); return true; } else { return false; } }
|
||||
public int I32 { get { int o = __p.__offset(12); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public bool MutateI32(int i32) { int o = __p.__offset(12); if (o != 0) { __p.bb.PutInt(o + __p.bb_pos, i32); return true; } else { return false; } }
|
||||
public uint U32 { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } }
|
||||
public bool MutateU32(uint u32) { int o = __p.__offset(14); if (o != 0) { __p.bb.PutUint(o + __p.bb_pos, u32); return true; } else { return false; } }
|
||||
public long I64 { get { int o = __p.__offset(16); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
public bool MutateI64(long i64) { int o = __p.__offset(16); if (o != 0) { __p.bb.PutLong(o + __p.bb_pos, i64); return true; } else { return false; } }
|
||||
public ulong U64 { get { int o = __p.__offset(18); return o != 0 ? __p.bb.GetUlong(o + __p.bb_pos) : (ulong)0; } }
|
||||
public bool MutateU64(ulong u64) { int o = __p.__offset(18); if (o != 0) { __p.bb.PutUlong(o + __p.bb_pos, u64); return true; } else { return false; } }
|
||||
public float F32 { get { int o = __p.__offset(20); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)0.0f; } }
|
||||
public bool MutateF32(float f32) { int o = __p.__offset(20); if (o != 0) { __p.bb.PutFloat(o + __p.bb_pos, f32); return true; } else { return false; } }
|
||||
public double F64 { get { int o = __p.__offset(22); return o != 0 ? __p.bb.GetDouble(o + __p.bb_pos) : (double)0.0; } }
|
||||
public bool MutateF64(double f64) { int o = __p.__offset(22); if (o != 0) { __p.bb.PutDouble(o + __p.bb_pos, f64); return true; } else { return false; } }
|
||||
public sbyte V8(int j) { int o = __p.__offset(24); return o != 0 ? __p.bb.GetSbyte(__p.__vector(o) + j * 1) : (sbyte)0; }
|
||||
public int V8Length { get { int o = __p.__offset(24); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public ArraySegment<byte>? GetV8Bytes() { return __p.__vector_as_arraysegment(24); }
|
||||
public bool MutateV8(int j, sbyte v8) { int o = __p.__offset(24); if (o != 0) { __p.bb.PutSbyte(__p.__vector(o) + j * 1, v8); return true; } else { return false; } }
|
||||
public double Vf64(int j) { int o = __p.__offset(26); return o != 0 ? __p.bb.GetDouble(__p.__vector(o) + j * 8) : (double)0; }
|
||||
public int Vf64Length { get { int o = __p.__offset(26); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public ArraySegment<byte>? GetVf64Bytes() { return __p.__vector_as_arraysegment(26); }
|
||||
public bool MutateVf64(int j, double vf64) { int o = __p.__offset(26); if (o != 0) { __p.bb.PutDouble(__p.__vector(o) + j * 8, vf64); return true; } else { return false; } }
|
||||
|
||||
public static Offset<TypeAliases> CreateTypeAliases(FlatBufferBuilder builder,
|
||||
sbyte i8 = 0,
|
||||
byte u8 = 0,
|
||||
short i16 = 0,
|
||||
ushort u16 = 0,
|
||||
int i32 = 0,
|
||||
uint u32 = 0,
|
||||
long i64 = 0,
|
||||
ulong u64 = 0,
|
||||
float f32 = 0.0f,
|
||||
double f64 = 0.0,
|
||||
VectorOffset v8Offset = default(VectorOffset),
|
||||
VectorOffset vf64Offset = default(VectorOffset)) {
|
||||
builder.StartObject(12);
|
||||
TypeAliases.AddF64(builder, f64);
|
||||
TypeAliases.AddU64(builder, u64);
|
||||
TypeAliases.AddI64(builder, i64);
|
||||
TypeAliases.AddVf64(builder, vf64Offset);
|
||||
TypeAliases.AddV8(builder, v8Offset);
|
||||
TypeAliases.AddF32(builder, f32);
|
||||
TypeAliases.AddU32(builder, u32);
|
||||
TypeAliases.AddI32(builder, i32);
|
||||
TypeAliases.AddU16(builder, u16);
|
||||
TypeAliases.AddI16(builder, i16);
|
||||
TypeAliases.AddU8(builder, u8);
|
||||
TypeAliases.AddI8(builder, i8);
|
||||
return TypeAliases.EndTypeAliases(builder);
|
||||
}
|
||||
|
||||
public static void StartTypeAliases(FlatBufferBuilder builder) { builder.StartObject(12); }
|
||||
public static void AddI8(FlatBufferBuilder builder, sbyte i8) { builder.AddSbyte(0, i8, 0); }
|
||||
public static void AddU8(FlatBufferBuilder builder, byte u8) { builder.AddByte(1, u8, 0); }
|
||||
public static void AddI16(FlatBufferBuilder builder, short i16) { builder.AddShort(2, i16, 0); }
|
||||
public static void AddU16(FlatBufferBuilder builder, ushort u16) { builder.AddUshort(3, u16, 0); }
|
||||
public static void AddI32(FlatBufferBuilder builder, int i32) { builder.AddInt(4, i32, 0); }
|
||||
public static void AddU32(FlatBufferBuilder builder, uint u32) { builder.AddUint(5, u32, 0); }
|
||||
public static void AddI64(FlatBufferBuilder builder, long i64) { builder.AddLong(6, i64, 0); }
|
||||
public static void AddU64(FlatBufferBuilder builder, ulong u64) { builder.AddUlong(7, u64, 0); }
|
||||
public static void AddF32(FlatBufferBuilder builder, float f32) { builder.AddFloat(8, f32, 0.0f); }
|
||||
public static void AddF64(FlatBufferBuilder builder, double f64) { builder.AddDouble(9, f64, 0.0); }
|
||||
public static void AddV8(FlatBufferBuilder builder, VectorOffset v8Offset) { builder.AddOffset(10, v8Offset.Value, 0); }
|
||||
public static VectorOffset CreateV8Vector(FlatBufferBuilder builder, sbyte[] data) { builder.StartVector(1, data.Length, 1); for (int i = data.Length - 1; i >= 0; i--) builder.AddSbyte(data[i]); return builder.EndVector(); }
|
||||
public static void StartV8Vector(FlatBufferBuilder builder, int numElems) { builder.StartVector(1, numElems, 1); }
|
||||
public static void AddVf64(FlatBufferBuilder builder, VectorOffset vf64Offset) { builder.AddOffset(11, vf64Offset.Value, 0); }
|
||||
public static VectorOffset CreateVf64Vector(FlatBufferBuilder builder, double[] data) { builder.StartVector(8, data.Length, 8); for (int i = data.Length - 1; i >= 0; i--) builder.AddDouble(data[i]); return builder.EndVector(); }
|
||||
public static void StartVf64Vector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
|
||||
public static Offset<TypeAliases> EndTypeAliases(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<TypeAliases>(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
230
tests/MyGame/Example/TypeAliases.go
Normal file
230
tests/MyGame/Example/TypeAliases.go
Normal file
@@ -0,0 +1,230 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package Example
|
||||
|
||||
import (
|
||||
flatbuffers "github.com/google/flatbuffers/go"
|
||||
)
|
||||
|
||||
type TypeAliases struct {
|
||||
_tab flatbuffers.Table
|
||||
}
|
||||
|
||||
func GetRootAsTypeAliases(buf []byte, offset flatbuffers.UOffsetT) *TypeAliases {
|
||||
n := flatbuffers.GetUOffsetT(buf[offset:])
|
||||
x := &TypeAliases{}
|
||||
x.Init(buf, n+offset)
|
||||
return x
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) Init(buf []byte, i flatbuffers.UOffsetT) {
|
||||
rcv._tab.Bytes = buf
|
||||
rcv._tab.Pos = i
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) Table() flatbuffers.Table {
|
||||
return rcv._tab
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) I8() int8 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetInt8(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) MutateI8(n int8) bool {
|
||||
return rcv._tab.MutateInt8Slot(4, n)
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) U8() byte {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetByte(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) MutateU8(n byte) bool {
|
||||
return rcv._tab.MutateByteSlot(6, n)
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) I16() int16 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetInt16(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) MutateI16(n int16) bool {
|
||||
return rcv._tab.MutateInt16Slot(8, n)
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) U16() uint16 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetUint16(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) MutateU16(n uint16) bool {
|
||||
return rcv._tab.MutateUint16Slot(10, n)
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) I32() int32 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetInt32(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) MutateI32(n int32) bool {
|
||||
return rcv._tab.MutateInt32Slot(12, n)
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) U32() uint32 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetUint32(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) MutateU32(n uint32) bool {
|
||||
return rcv._tab.MutateUint32Slot(14, n)
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) I64() int64 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(16))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetInt64(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) MutateI64(n int64) bool {
|
||||
return rcv._tab.MutateInt64Slot(16, n)
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) U64() uint64 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(18))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetUint64(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) MutateU64(n uint64) bool {
|
||||
return rcv._tab.MutateUint64Slot(18, n)
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) F32() float32 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(20))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetFloat32(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0.0
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) MutateF32(n float32) bool {
|
||||
return rcv._tab.MutateFloat32Slot(20, n)
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) F64() float64 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(22))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetFloat64(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0.0
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) MutateF64(n float64) bool {
|
||||
return rcv._tab.MutateFloat64Slot(22, n)
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) V8(j int) int8 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(24))
|
||||
if o != 0 {
|
||||
a := rcv._tab.Vector(o)
|
||||
return rcv._tab.GetInt8(a + flatbuffers.UOffsetT(j*1))
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) V8Length() int {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(24))
|
||||
if o != 0 {
|
||||
return rcv._tab.VectorLen(o)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) Vf64(j int) float64 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(26))
|
||||
if o != 0 {
|
||||
a := rcv._tab.Vector(o)
|
||||
return rcv._tab.GetFloat64(a + flatbuffers.UOffsetT(j*8))
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *TypeAliases) Vf64Length() int {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(26))
|
||||
if o != 0 {
|
||||
return rcv._tab.VectorLen(o)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func TypeAliasesStart(builder *flatbuffers.Builder) {
|
||||
builder.StartObject(12)
|
||||
}
|
||||
func TypeAliasesAddI8(builder *flatbuffers.Builder, i8 int8) {
|
||||
builder.PrependInt8Slot(0, i8, 0)
|
||||
}
|
||||
func TypeAliasesAddU8(builder *flatbuffers.Builder, u8 byte) {
|
||||
builder.PrependByteSlot(1, u8, 0)
|
||||
}
|
||||
func TypeAliasesAddI16(builder *flatbuffers.Builder, i16 int16) {
|
||||
builder.PrependInt16Slot(2, i16, 0)
|
||||
}
|
||||
func TypeAliasesAddU16(builder *flatbuffers.Builder, u16 uint16) {
|
||||
builder.PrependUint16Slot(3, u16, 0)
|
||||
}
|
||||
func TypeAliasesAddI32(builder *flatbuffers.Builder, i32 int32) {
|
||||
builder.PrependInt32Slot(4, i32, 0)
|
||||
}
|
||||
func TypeAliasesAddU32(builder *flatbuffers.Builder, u32 uint32) {
|
||||
builder.PrependUint32Slot(5, u32, 0)
|
||||
}
|
||||
func TypeAliasesAddI64(builder *flatbuffers.Builder, i64 int64) {
|
||||
builder.PrependInt64Slot(6, i64, 0)
|
||||
}
|
||||
func TypeAliasesAddU64(builder *flatbuffers.Builder, u64 uint64) {
|
||||
builder.PrependUint64Slot(7, u64, 0)
|
||||
}
|
||||
func TypeAliasesAddF32(builder *flatbuffers.Builder, f32 float32) {
|
||||
builder.PrependFloat32Slot(8, f32, 0.0)
|
||||
}
|
||||
func TypeAliasesAddF64(builder *flatbuffers.Builder, f64 float64) {
|
||||
builder.PrependFloat64Slot(9, f64, 0.0)
|
||||
}
|
||||
func TypeAliasesAddV8(builder *flatbuffers.Builder, v8 flatbuffers.UOffsetT) {
|
||||
builder.PrependUOffsetTSlot(10, flatbuffers.UOffsetT(v8), 0)
|
||||
}
|
||||
func TypeAliasesStartV8Vector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
|
||||
return builder.StartVector(1, numElems, 1)
|
||||
}
|
||||
func TypeAliasesAddVf64(builder *flatbuffers.Builder, vf64 flatbuffers.UOffsetT) {
|
||||
builder.PrependUOffsetTSlot(11, flatbuffers.UOffsetT(vf64), 0)
|
||||
}
|
||||
func TypeAliasesStartVf64Vector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
|
||||
return builder.StartVector(8, numElems, 8)
|
||||
}
|
||||
func TypeAliasesEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
|
||||
return builder.EndObject()
|
||||
}
|
||||
97
tests/MyGame/Example/TypeAliases.java
Normal file
97
tests/MyGame/Example/TypeAliases.java
Normal file
@@ -0,0 +1,97 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package MyGame.Example;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class TypeAliases extends Table {
|
||||
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 void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public TypeAliases __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public byte i8() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
public boolean mutateI8(byte i8) { int o = __offset(4); if (o != 0) { bb.put(o + bb_pos, i8); return true; } else { return false; } }
|
||||
public int u8() { int o = __offset(6); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 0; }
|
||||
public boolean mutateU8(int u8) { int o = __offset(6); if (o != 0) { bb.put(o + bb_pos, (byte)u8); return true; } else { return false; } }
|
||||
public short i16() { int o = __offset(8); return o != 0 ? bb.getShort(o + bb_pos) : 0; }
|
||||
public boolean mutateI16(short i16) { int o = __offset(8); if (o != 0) { bb.putShort(o + bb_pos, i16); return true; } else { return false; } }
|
||||
public int u16() { int o = __offset(10); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; }
|
||||
public boolean mutateU16(int u16) { int o = __offset(10); if (o != 0) { bb.putShort(o + bb_pos, (short)u16); return true; } else { return false; } }
|
||||
public int i32() { int o = __offset(12); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public boolean mutateI32(int i32) { int o = __offset(12); if (o != 0) { bb.putInt(o + bb_pos, i32); return true; } else { return false; } }
|
||||
public long u32() { int o = __offset(14); return o != 0 ? (long)bb.getInt(o + bb_pos) & 0xFFFFFFFFL : 0L; }
|
||||
public boolean mutateU32(long u32) { int o = __offset(14); if (o != 0) { bb.putInt(o + bb_pos, (int)u32); return true; } else { return false; } }
|
||||
public long i64() { int o = __offset(16); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public boolean mutateI64(long i64) { int o = __offset(16); if (o != 0) { bb.putLong(o + bb_pos, i64); return true; } else { return false; } }
|
||||
public long u64() { int o = __offset(18); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public boolean mutateU64(long u64) { int o = __offset(18); if (o != 0) { bb.putLong(o + bb_pos, u64); return true; } else { return false; } }
|
||||
public float f32() { int o = __offset(20); return o != 0 ? bb.getFloat(o + bb_pos) : 0.0f; }
|
||||
public boolean mutateF32(float f32) { int o = __offset(20); if (o != 0) { bb.putFloat(o + bb_pos, f32); return true; } else { return false; } }
|
||||
public double f64() { int o = __offset(22); return o != 0 ? bb.getDouble(o + bb_pos) : 0.0; }
|
||||
public boolean mutateF64(double f64) { int o = __offset(22); if (o != 0) { bb.putDouble(o + bb_pos, f64); return true; } else { return false; } }
|
||||
public byte v8(int j) { int o = __offset(24); return o != 0 ? bb.get(__vector(o) + j * 1) : 0; }
|
||||
public int v8Length() { int o = __offset(24); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer v8AsByteBuffer() { return __vector_as_bytebuffer(24, 1); }
|
||||
public boolean mutateV8(int j, byte v8) { int o = __offset(24); if (o != 0) { bb.put(__vector(o) + j * 1, v8); return true; } else { return false; } }
|
||||
public double vf64(int j) { int o = __offset(26); return o != 0 ? bb.getDouble(__vector(o) + j * 8) : 0; }
|
||||
public int vf64Length() { int o = __offset(26); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer vf64AsByteBuffer() { return __vector_as_bytebuffer(26, 8); }
|
||||
public boolean mutateVf64(int j, double vf64) { int o = __offset(26); if (o != 0) { bb.putDouble(__vector(o) + j * 8, vf64); return true; } else { return false; } }
|
||||
|
||||
public static int createTypeAliases(FlatBufferBuilder builder,
|
||||
byte i8,
|
||||
int u8,
|
||||
short i16,
|
||||
int u16,
|
||||
int i32,
|
||||
long u32,
|
||||
long i64,
|
||||
long u64,
|
||||
float f32,
|
||||
double f64,
|
||||
int v8Offset,
|
||||
int vf64Offset) {
|
||||
builder.startObject(12);
|
||||
TypeAliases.addF64(builder, f64);
|
||||
TypeAliases.addU64(builder, u64);
|
||||
TypeAliases.addI64(builder, i64);
|
||||
TypeAliases.addVf64(builder, vf64Offset);
|
||||
TypeAliases.addV8(builder, v8Offset);
|
||||
TypeAliases.addF32(builder, f32);
|
||||
TypeAliases.addU32(builder, u32);
|
||||
TypeAliases.addI32(builder, i32);
|
||||
TypeAliases.addU16(builder, u16);
|
||||
TypeAliases.addI16(builder, i16);
|
||||
TypeAliases.addU8(builder, u8);
|
||||
TypeAliases.addI8(builder, i8);
|
||||
return TypeAliases.endTypeAliases(builder);
|
||||
}
|
||||
|
||||
public static void startTypeAliases(FlatBufferBuilder builder) { builder.startObject(12); }
|
||||
public static void addI8(FlatBufferBuilder builder, byte i8) { builder.addByte(0, i8, 0); }
|
||||
public static void addU8(FlatBufferBuilder builder, int u8) { builder.addByte(1, (byte)u8, (byte)0); }
|
||||
public static void addI16(FlatBufferBuilder builder, short i16) { builder.addShort(2, i16, 0); }
|
||||
public static void addU16(FlatBufferBuilder builder, int u16) { builder.addShort(3, (short)u16, (short)0); }
|
||||
public static void addI32(FlatBufferBuilder builder, int i32) { builder.addInt(4, i32, 0); }
|
||||
public static void addU32(FlatBufferBuilder builder, long u32) { builder.addInt(5, (int)u32, (int)0L); }
|
||||
public static void addI64(FlatBufferBuilder builder, long i64) { builder.addLong(6, i64, 0L); }
|
||||
public static void addU64(FlatBufferBuilder builder, long u64) { builder.addLong(7, u64, 0L); }
|
||||
public static void addF32(FlatBufferBuilder builder, float f32) { builder.addFloat(8, f32, 0.0f); }
|
||||
public static void addF64(FlatBufferBuilder builder, double f64) { builder.addDouble(9, f64, 0.0); }
|
||||
public static void addV8(FlatBufferBuilder builder, int v8Offset) { builder.addOffset(10, v8Offset, 0); }
|
||||
public static int createV8Vector(FlatBufferBuilder builder, byte[] data) { builder.startVector(1, data.length, 1); for (int i = data.length - 1; i >= 0; i--) builder.addByte(data[i]); return builder.endVector(); }
|
||||
public static void startV8Vector(FlatBufferBuilder builder, int numElems) { builder.startVector(1, numElems, 1); }
|
||||
public static void addVf64(FlatBufferBuilder builder, int vf64Offset) { builder.addOffset(11, vf64Offset, 0); }
|
||||
public static int createVf64Vector(FlatBufferBuilder builder, double[] data) { builder.startVector(8, data.length, 8); for (int i = data.length - 1; i >= 0; i--) builder.addDouble(data[i]); return builder.endVector(); }
|
||||
public static void startVf64Vector(FlatBufferBuilder builder, int numElems) { builder.startVector(8, numElems, 8); }
|
||||
public static int endTypeAliases(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
||||
387
tests/MyGame/Example/TypeAliases.php
Normal file
387
tests/MyGame/Example/TypeAliases.php
Normal file
@@ -0,0 +1,387 @@
|
||||
<?php
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
namespace MyGame\Example;
|
||||
|
||||
use \Google\FlatBuffers\Struct;
|
||||
use \Google\FlatBuffers\Table;
|
||||
use \Google\FlatBuffers\ByteBuffer;
|
||||
use \Google\FlatBuffers\FlatBufferBuilder;
|
||||
|
||||
class TypeAliases extends Table
|
||||
{
|
||||
/**
|
||||
* @param ByteBuffer $bb
|
||||
* @return TypeAliases
|
||||
*/
|
||||
public static function getRootAsTypeAliases(ByteBuffer $bb)
|
||||
{
|
||||
$obj = new TypeAliases();
|
||||
return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb));
|
||||
}
|
||||
|
||||
public static function TypeAliasesIdentifier()
|
||||
{
|
||||
return "MONS";
|
||||
}
|
||||
|
||||
public static function TypeAliasesBufferHasIdentifier(ByteBuffer $buf)
|
||||
{
|
||||
return self::__has_identifier($buf, self::TypeAliasesIdentifier());
|
||||
}
|
||||
|
||||
public static function TypeAliasesExtension()
|
||||
{
|
||||
return "mon";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $_i offset
|
||||
* @param ByteBuffer $_bb
|
||||
* @return TypeAliases
|
||||
**/
|
||||
public function init($_i, ByteBuffer $_bb)
|
||||
{
|
||||
$this->bb_pos = $_i;
|
||||
$this->bb = $_bb;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return sbyte
|
||||
*/
|
||||
public function getI8()
|
||||
{
|
||||
$o = $this->__offset(4);
|
||||
return $o != 0 ? $this->bb->getSbyte($o + $this->bb_pos) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return byte
|
||||
*/
|
||||
public function getU8()
|
||||
{
|
||||
$o = $this->__offset(6);
|
||||
return $o != 0 ? $this->bb->getByte($o + $this->bb_pos) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return short
|
||||
*/
|
||||
public function getI16()
|
||||
{
|
||||
$o = $this->__offset(8);
|
||||
return $o != 0 ? $this->bb->getShort($o + $this->bb_pos) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ushort
|
||||
*/
|
||||
public function getU16()
|
||||
{
|
||||
$o = $this->__offset(10);
|
||||
return $o != 0 ? $this->bb->getUshort($o + $this->bb_pos) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getI32()
|
||||
{
|
||||
$o = $this->__offset(12);
|
||||
return $o != 0 ? $this->bb->getInt($o + $this->bb_pos) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return uint
|
||||
*/
|
||||
public function getU32()
|
||||
{
|
||||
$o = $this->__offset(14);
|
||||
return $o != 0 ? $this->bb->getUint($o + $this->bb_pos) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return long
|
||||
*/
|
||||
public function getI64()
|
||||
{
|
||||
$o = $this->__offset(16);
|
||||
return $o != 0 ? $this->bb->getLong($o + $this->bb_pos) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ulong
|
||||
*/
|
||||
public function getU64()
|
||||
{
|
||||
$o = $this->__offset(18);
|
||||
return $o != 0 ? $this->bb->getUlong($o + $this->bb_pos) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getF32()
|
||||
{
|
||||
$o = $this->__offset(20);
|
||||
return $o != 0 ? $this->bb->getFloat($o + $this->bb_pos) : 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return double
|
||||
*/
|
||||
public function getF64()
|
||||
{
|
||||
$o = $this->__offset(22);
|
||||
return $o != 0 ? $this->bb->getDouble($o + $this->bb_pos) : 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int offset
|
||||
* @return sbyte
|
||||
*/
|
||||
public function getV8($j)
|
||||
{
|
||||
$o = $this->__offset(24);
|
||||
return $o != 0 ? $this->bb->getSbyte($this->__vector($o) + $j * 1) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getV8Length()
|
||||
{
|
||||
$o = $this->__offset(24);
|
||||
return $o != 0 ? $this->__vector_len($o) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int offset
|
||||
* @return double
|
||||
*/
|
||||
public function getVf64($j)
|
||||
{
|
||||
$o = $this->__offset(26);
|
||||
return $o != 0 ? $this->bb->getDouble($this->__vector($o) + $j * 8) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getVf64Length()
|
||||
{
|
||||
$o = $this->__offset(26);
|
||||
return $o != 0 ? $this->__vector_len($o) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @return void
|
||||
*/
|
||||
public static function startTypeAliases(FlatBufferBuilder $builder)
|
||||
{
|
||||
$builder->StartObject(12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @return TypeAliases
|
||||
*/
|
||||
public static function createTypeAliases(FlatBufferBuilder $builder, $i8, $u8, $i16, $u16, $i32, $u32, $i64, $u64, $f32, $f64, $v8, $vf64)
|
||||
{
|
||||
$builder->startObject(12);
|
||||
self::addI8($builder, $i8);
|
||||
self::addU8($builder, $u8);
|
||||
self::addI16($builder, $i16);
|
||||
self::addU16($builder, $u16);
|
||||
self::addI32($builder, $i32);
|
||||
self::addU32($builder, $u32);
|
||||
self::addI64($builder, $i64);
|
||||
self::addU64($builder, $u64);
|
||||
self::addF32($builder, $f32);
|
||||
self::addF64($builder, $f64);
|
||||
self::addV8($builder, $v8);
|
||||
self::addVf64($builder, $vf64);
|
||||
$o = $builder->endObject();
|
||||
return $o;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param sbyte
|
||||
* @return void
|
||||
*/
|
||||
public static function addI8(FlatBufferBuilder $builder, $i8)
|
||||
{
|
||||
$builder->addSbyteX(0, $i8, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param byte
|
||||
* @return void
|
||||
*/
|
||||
public static function addU8(FlatBufferBuilder $builder, $u8)
|
||||
{
|
||||
$builder->addByteX(1, $u8, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param short
|
||||
* @return void
|
||||
*/
|
||||
public static function addI16(FlatBufferBuilder $builder, $i16)
|
||||
{
|
||||
$builder->addShortX(2, $i16, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param ushort
|
||||
* @return void
|
||||
*/
|
||||
public static function addU16(FlatBufferBuilder $builder, $u16)
|
||||
{
|
||||
$builder->addUshortX(3, $u16, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param int
|
||||
* @return void
|
||||
*/
|
||||
public static function addI32(FlatBufferBuilder $builder, $i32)
|
||||
{
|
||||
$builder->addIntX(4, $i32, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param uint
|
||||
* @return void
|
||||
*/
|
||||
public static function addU32(FlatBufferBuilder $builder, $u32)
|
||||
{
|
||||
$builder->addUintX(5, $u32, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param long
|
||||
* @return void
|
||||
*/
|
||||
public static function addI64(FlatBufferBuilder $builder, $i64)
|
||||
{
|
||||
$builder->addLongX(6, $i64, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param ulong
|
||||
* @return void
|
||||
*/
|
||||
public static function addU64(FlatBufferBuilder $builder, $u64)
|
||||
{
|
||||
$builder->addUlongX(7, $u64, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param float
|
||||
* @return void
|
||||
*/
|
||||
public static function addF32(FlatBufferBuilder $builder, $f32)
|
||||
{
|
||||
$builder->addFloatX(8, $f32, 0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param double
|
||||
* @return void
|
||||
*/
|
||||
public static function addF64(FlatBufferBuilder $builder, $f64)
|
||||
{
|
||||
$builder->addDoubleX(9, $f64, 0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param VectorOffset
|
||||
* @return void
|
||||
*/
|
||||
public static function addV8(FlatBufferBuilder $builder, $v8)
|
||||
{
|
||||
$builder->addOffsetX(10, $v8, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param array offset array
|
||||
* @return int vector offset
|
||||
*/
|
||||
public static function createV8Vector(FlatBufferBuilder $builder, array $data)
|
||||
{
|
||||
$builder->startVector(1, count($data), 1);
|
||||
for ($i = count($data) - 1; $i >= 0; $i--) {
|
||||
$builder->addSbyte($data[$i]);
|
||||
}
|
||||
return $builder->endVector();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param int $numElems
|
||||
* @return void
|
||||
*/
|
||||
public static function startV8Vector(FlatBufferBuilder $builder, $numElems)
|
||||
{
|
||||
$builder->startVector(1, $numElems, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param VectorOffset
|
||||
* @return void
|
||||
*/
|
||||
public static function addVf64(FlatBufferBuilder $builder, $vf64)
|
||||
{
|
||||
$builder->addOffsetX(11, $vf64, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param array offset array
|
||||
* @return int vector offset
|
||||
*/
|
||||
public static function createVf64Vector(FlatBufferBuilder $builder, array $data)
|
||||
{
|
||||
$builder->startVector(8, count($data), 8);
|
||||
for ($i = count($data) - 1; $i >= 0; $i--) {
|
||||
$builder->addDouble($data[$i]);
|
||||
}
|
||||
return $builder->endVector();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param int $numElems
|
||||
* @return void
|
||||
*/
|
||||
public static function startVf64Vector(FlatBufferBuilder $builder, $numElems)
|
||||
{
|
||||
$builder->startVector(8, $numElems, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @return int table offset
|
||||
*/
|
||||
public static function endTypeAliases(FlatBufferBuilder $builder)
|
||||
{
|
||||
$o = $builder->endObject();
|
||||
return $o;
|
||||
}
|
||||
}
|
||||
150
tests/MyGame/Example/TypeAliases.py
Normal file
150
tests/MyGame/Example/TypeAliases.py
Normal file
@@ -0,0 +1,150 @@
|
||||
# automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
# namespace: Example
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class TypeAliases(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsTypeAliases(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = TypeAliases()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# TypeAliases
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# TypeAliases
|
||||
def I8(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# TypeAliases
|
||||
def U8(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
|
||||
|
||||
# TypeAliases
|
||||
def I16(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# TypeAliases
|
||||
def U16(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# TypeAliases
|
||||
def I32(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# TypeAliases
|
||||
def U32(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# TypeAliases
|
||||
def I64(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# TypeAliases
|
||||
def U64(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# TypeAliases
|
||||
def F32(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
|
||||
return 0.0
|
||||
|
||||
# TypeAliases
|
||||
def F64(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
|
||||
return 0.0
|
||||
|
||||
# TypeAliases
|
||||
def V8(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
|
||||
return 0
|
||||
|
||||
# TypeAliases
|
||||
def V8AsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int8Flags, o)
|
||||
return 0
|
||||
|
||||
# TypeAliases
|
||||
def V8Length(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# TypeAliases
|
||||
def Vf64(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Float64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
|
||||
return 0
|
||||
|
||||
# TypeAliases
|
||||
def Vf64AsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float64Flags, o)
|
||||
return 0
|
||||
|
||||
# TypeAliases
|
||||
def Vf64Length(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
def TypeAliasesStart(builder): builder.StartObject(12)
|
||||
def TypeAliasesAddI8(builder, i8): builder.PrependInt8Slot(0, i8, 0)
|
||||
def TypeAliasesAddU8(builder, u8): builder.PrependUint8Slot(1, u8, 0)
|
||||
def TypeAliasesAddI16(builder, i16): builder.PrependInt16Slot(2, i16, 0)
|
||||
def TypeAliasesAddU16(builder, u16): builder.PrependUint16Slot(3, u16, 0)
|
||||
def TypeAliasesAddI32(builder, i32): builder.PrependInt32Slot(4, i32, 0)
|
||||
def TypeAliasesAddU32(builder, u32): builder.PrependUint32Slot(5, u32, 0)
|
||||
def TypeAliasesAddI64(builder, i64): builder.PrependInt64Slot(6, i64, 0)
|
||||
def TypeAliasesAddU64(builder, u64): builder.PrependUint64Slot(7, u64, 0)
|
||||
def TypeAliasesAddF32(builder, f32): builder.PrependFloat32Slot(8, f32, 0.0)
|
||||
def TypeAliasesAddF64(builder, f64): builder.PrependFloat64Slot(9, f64, 0.0)
|
||||
def TypeAliasesAddV8(builder, v8): builder.PrependUOffsetTRelativeSlot(10, flatbuffers.number_types.UOffsetTFlags.py_type(v8), 0)
|
||||
def TypeAliasesStartV8Vector(builder, numElems): return builder.StartVector(1, numElems, 1)
|
||||
def TypeAliasesAddVf64(builder, vf64): builder.PrependUOffsetTRelativeSlot(11, flatbuffers.number_types.UOffsetTFlags.py_type(vf64), 0)
|
||||
def TypeAliasesStartVf64Vector(builder, numElems): return builder.StartVector(8, numElems, 8)
|
||||
def TypeAliasesEnd(builder): return builder.EndObject()
|
||||
Reference in New Issue
Block a user