mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-13 00:04:29 +00:00
added reuse option for root objects
getRootAs..() function now has a second implementation that accepts an existing object to allow object reuse, much like all other methods that refer to objects. Change-Id: Iffef567c903a130761ef7de98867e5465d29a04d
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
4d3db99283
commit
b0910e75e0
@@ -6,7 +6,8 @@ namespace MyGame.Example
|
||||
using FlatBuffers;
|
||||
|
||||
public class Stat : Table {
|
||||
public static Stat GetRootAsStat(ByteBuffer _bb) { return (new Stat()).__init(_bb.GetInt(_bb.position()) + _bb.position(), _bb); }
|
||||
public static Stat GetRootAsStat(ByteBuffer _bb) { return GetRootAsStat(_bb, new Stat()); }
|
||||
public static Stat GetRootAsStat(ByteBuffer _bb, Stat obj) { return (obj.__init(_bb.GetInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public Stat __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
|
||||
|
||||
public string Id() { int o = __offset(4); return o != 0 ? __string(o + bb_pos) : null; }
|
||||
|
||||
Reference in New Issue
Block a user