Skip to content

Instantly share code, notes, and snippets.

@chobie chobie/Test.cs
Last active Dec 24, 2015

Embed
What would you like to do?
namespace Example;
table Test {
a:byte = 1;
b:ubyte = 1;
c:bool = 1;
d:short = 1;
e:ushort = 1;
f:int = 1;
g:uint = 1;
h:float = 1;
i:long = 1;
j:ulong = 1;
k:double = 1;
l:float = 1.0;
m:float = 3.402823e+38;
}
// automatically generated, do not modify
namespace Example
{
using System;
using FlatBuffers;
public sealed class Test : Table
{
public static Test GetRootAsTest(ByteBuffer _bb) { return GetRootAsTest(_bb, new Test()); }
public static Test GetRootAsTest(ByteBuffer _bb, Test obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public Test __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public sbyte A { get { int o = __offset(4); return o != 0 ? bb.GetSbyte(o + bb_pos) : (sbyte)1; } }
public byte B { get { int o = __offset(6); return o != 0 ? bb.Get(o + bb_pos) : (byte)1; } }
public bool C { get { int o = __offset(8); return o != 0 ? 0 != bb.Get(o + bb_pos) : (bool)true; } }
public short D { get { int o = __offset(10); return o != 0 ? bb.GetShort(o + bb_pos) : (short)1; } }
public ushort E { get { int o = __offset(12); return o != 0 ? bb.GetUshort(o + bb_pos) : (ushort)1; } }
public int F { get { int o = __offset(14); return o != 0 ? bb.GetInt(o + bb_pos) : (int)1; } }
public uint G { get { int o = __offset(16); return o != 0 ? bb.GetUint(o + bb_pos) : (uint)1; } }
public float H { get { int o = __offset(18); return o != 0 ? bb.GetFloat(o + bb_pos) : 1f; } }
public long I { get { int o = __offset(20); return o != 0 ? bb.GetLong(o + bb_pos) : (long)1; } }
public ulong J { get { int o = __offset(22); return o != 0 ? bb.GetUlong(o + bb_pos) : (ulong)1; } }
public double K { get { int o = __offset(24); return o != 0 ? bb.GetDouble(o + bb_pos) : (double)1; } }
public float L { get { int o = __offset(26); return o != 0 ? bb.GetFloat(o + bb_pos) : 1.0f; } }
public float M { get { int o = __offset(28); return o != 0 ? bb.GetFloat(o + bb_pos) : 3.402823e+38f; } }
public static Offset<Test> CreateTest(FlatBufferBuilder builder,
sbyte a = 1,
byte b = 1,
bool c = true,
short d = 1,
ushort e = 1,
int f = 1,
uint g = 1,
float h = 1f,
long i = 1,
ulong j = 1,
double k = 1,
float l = 1.0f,
float m = 3.402823e+38f)
{
builder.StartObject(13);
Test.AddK(builder, k);
Test.AddJ(builder, j);
Test.AddI(builder, i);
Test.AddM(builder, m);
Test.AddL(builder, l);
Test.AddH(builder, h);
Test.AddG(builder, g);
Test.AddF(builder, f);
Test.AddE(builder, e);
Test.AddD(builder, d);
Test.AddC(builder, c);
Test.AddB(builder, b);
Test.AddA(builder, a);
return Test.EndTest(builder);
}
public static void StartTest(FlatBufferBuilder builder) { builder.StartObject(13); }
public static void AddA(FlatBufferBuilder builder, sbyte a) { builder.AddSbyte(0, a, 1); }
public static void AddB(FlatBufferBuilder builder, byte b) { builder.AddByte(1, b, 1); }
public static void AddC(FlatBufferBuilder builder, bool c) { builder.AddBool(2, c, true); }
public static void AddD(FlatBufferBuilder builder, short d) { builder.AddShort(3, d, 1); }
public static void AddE(FlatBufferBuilder builder, ushort e) { builder.AddUshort(4, e, 1); }
public static void AddF(FlatBufferBuilder builder, int f) { builder.AddInt(5, f, 1); }
public static void AddG(FlatBufferBuilder builder, uint g) { builder.AddUint(6, g, 1); }
public static void AddH(FlatBufferBuilder builder, float h) { builder.AddFloat(7, h, 1); }
public static void AddI(FlatBufferBuilder builder, long i) { builder.AddLong(8, i, 1); }
public static void AddJ(FlatBufferBuilder builder, ulong j) { builder.AddUlong(9, j, 1); }
public static void AddK(FlatBufferBuilder builder, double k) { builder.AddDouble(10, k, 1); }
public static void AddL(FlatBufferBuilder builder, float l) { builder.AddFloat(11, l, 1.0); }
public static void AddM(FlatBufferBuilder builder, float m) { builder.AddFloat(12, m, 3.402823e+38); }
public static Offset<Test> EndTest(FlatBufferBuilder builder)
{
int o = builder.EndObject();
return new Offset<Test>(o);
}
};
}
// automatically generated, do not modify
package Example;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class Test extends Table {
public static Test getRootAsTest(ByteBuffer _bb) { return getRootAsTest(_bb, new Test()); }
public static Test getRootAsTest(ByteBuffer _bb, Test obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__init(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public Test __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public byte a() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) : 1; }
public int b() { int o = __offset(6); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 1; }
public boolean c() { int o = __offset(8); return o != 0 ? 0!=bb.get(o + bb_pos) : true; }
public short d() { int o = __offset(10); return o != 0 ? bb.getShort(o + bb_pos) : 1; }
public int e() { int o = __offset(12); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 1; }
public int f() { int o = __offset(14); return o != 0 ? bb.getInt(o + bb_pos) : 1; }
public long g() { int o = __offset(16); return o != 0 ? (long)bb.getInt(o + bb_pos) & 0xFFFFFFFFL : 1; }
public float h() { int o = __offset(18); return o != 0 ? bb.getFloat(o + bb_pos) : 1; }
public long i() { int o = __offset(20); return o != 0 ? bb.getLong(o + bb_pos) : 1; }
public long j() { int o = __offset(22); return o != 0 ? bb.getLong(o + bb_pos) : 1; }
public double k() { int o = __offset(24); return o != 0 ? bb.getDouble(o + bb_pos) : 1; }
public float l() { int o = __offset(26); return o != 0 ? bb.getFloat(o + bb_pos) : 1.0; }
public float m() { int o = __offset(28); return o != 0 ? bb.getFloat(o + bb_pos) : 3.402823e+38; }
public static int createTest(FlatBufferBuilder builder,
byte a,
int b,
boolean c,
short d,
int e,
int f,
long g,
float h,
long i,
long j,
double k,
float l,
float m) {
builder.startObject(13);
Test.addK(builder, k);
Test.addJ(builder, j);
Test.addI(builder, i);
Test.addM(builder, m);
Test.addL(builder, l);
Test.addH(builder, h);
Test.addG(builder, g);
Test.addF(builder, f);
Test.addE(builder, e);
Test.addD(builder, d);
Test.addC(builder, c);
Test.addB(builder, b);
Test.addA(builder, a);
return Test.endTest(builder);
}
public static void startTest(FlatBufferBuilder builder) { builder.startObject(13); }
public static void addA(FlatBufferBuilder builder, byte a) { builder.addByte(0, a, 1); }
public static void addB(FlatBufferBuilder builder, int b) { builder.addByte(1, (byte)b, 1); }
public static void addC(FlatBufferBuilder builder, boolean c) { builder.addBoolean(2, c, true); }
public static void addD(FlatBufferBuilder builder, short d) { builder.addShort(3, d, 1); }
public static void addE(FlatBufferBuilder builder, int e) { builder.addShort(4, (short)e, 1); }
public static void addF(FlatBufferBuilder builder, int f) { builder.addInt(5, f, 1); }
public static void addG(FlatBufferBuilder builder, long g) { builder.addInt(6, (int)g, 1); }
public static void addH(FlatBufferBuilder builder, float h) { builder.addFloat(7, h, 1); }
public static void addI(FlatBufferBuilder builder, long i) { builder.addLong(8, i, 1); }
public static void addJ(FlatBufferBuilder builder, long j) { builder.addLong(9, j, 1); }
public static void addK(FlatBufferBuilder builder, double k) { builder.addDouble(10, k, 1); }
public static void addL(FlatBufferBuilder builder, float l) { builder.addFloat(11, l, 1.0); }
public static void addM(FlatBufferBuilder builder, float m) { builder.addFloat(12, m, 3.402823e+38); }
public static int endTest(FlatBufferBuilder builder) {
int o = builder.endObject();
return o;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.