mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-16 01:07:29 +00:00
Switched C# accessors from classes to structs
This commit is contained in:
@@ -6,13 +6,16 @@ namespace NamespaceA.NamespaceB
|
||||
using System;
|
||||
using FlatBuffers;
|
||||
|
||||
public sealed class TableInNestedNS : Table {
|
||||
public struct TableInNestedNS : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public static TableInNestedNS GetRootAsTableInNestedNS(ByteBuffer _bb) { return GetRootAsTableInNestedNS(_bb, new TableInNestedNS()); }
|
||||
public static TableInNestedNS GetRootAsTableInNestedNS(ByteBuffer _bb, TableInNestedNS obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public TableInNestedNS __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
|
||||
public static TableInNestedNS GetRootAsTableInNestedNS(ByteBuffer _bb, TableInNestedNS 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 TableInNestedNS __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int Foo { get { int o = __offset(4); return o != 0 ? bb.GetInt(o + bb_pos) : (int)0; } }
|
||||
public bool MutateFoo(int foo) { int o = __offset(4); if (o != 0) { bb.PutInt(o + bb_pos, foo); return true; } else { return false; } }
|
||||
public int Foo { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public bool MutateFoo(int foo) { int o = __p.__offset(4); if (o != 0) { __p.bb.PutInt(o + __p.bb_pos, foo); return true; } else { return false; } }
|
||||
|
||||
public static Offset<TableInNestedNS> CreateTableInNestedNS(FlatBufferBuilder builder,
|
||||
int foo = 0) {
|
||||
|
||||
Reference in New Issue
Block a user