summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorVladimir Glavnyy <31897320+vglavnyy@users.noreply.github.com>2019-06-18 00:16:21 +0700
committerWouter van Oortmerssen <aardappel@gmail.com>2019-06-17 19:16:21 +0200
commit0d2cebccfeffae9df998f3ac819bf17b7ec7a6d0 (patch)
tree02bde173585c860e9840a139454fad2e9c90c89e /net
parenta80db8538cf49953fbbf88ac380472655acc089e (diff)
downloadflatbuffers-0d2cebccfeffae9df998f3ac819bf17b7ec7a6d0.tar.gz
flatbuffers-0d2cebccfeffae9df998f3ac819bf17b7ec7a6d0.tar.bz2
flatbuffers-0d2cebccfeffae9df998f3ac819bf17b7ec7a6d0.zip
Add FLATBUFFERS_COMPATIBILITY string (#5381)
* Add FLATBUFFERS_COMPATIBILITY string - Add a new __reset method NET/JAVA which hides internal state * Resolve PR notes * Use operator new() to __init of Struct and Table * Restrict visibility of C# Table/Struct to internal level
Diffstat (limited to 'net')
-rw-r--r--net/FlatBuffers/Struct.cs13
-rw-r--r--net/FlatBuffers/Table.cs13
2 files changed, 20 insertions, 6 deletions
diff --git a/net/FlatBuffers/Struct.cs b/net/FlatBuffers/Struct.cs
index 61da32f7..82a3d10d 100644
--- a/net/FlatBuffers/Struct.cs
+++ b/net/FlatBuffers/Struct.cs
@@ -19,9 +19,16 @@ namespace FlatBuffers
/// <summary>
/// All structs in the generated code derive from this class, and add their own accessors.
/// </summary>
- public struct Struct
+ internal struct Struct
{
- public int bb_pos;
- public ByteBuffer bb;
+ public int bb_pos { get; private set; }
+ public ByteBuffer bb { get; private set; }
+
+ // Re-init the internal state with an external buffer {@code ByteBuffer} and an offset within.
+ public Struct(int _i, ByteBuffer _bb)
+ {
+ bb = _bb;
+ bb_pos = _i;
+ }
}
}
diff --git a/net/FlatBuffers/Table.cs b/net/FlatBuffers/Table.cs
index cc7f3c1c..9d0744a1 100644
--- a/net/FlatBuffers/Table.cs
+++ b/net/FlatBuffers/Table.cs
@@ -22,13 +22,20 @@ namespace FlatBuffers
/// <summary>
/// All tables in the generated code derive from this struct, and add their own accessors.
/// </summary>
- public struct Table
+ internal struct Table
{
- public int bb_pos;
- public ByteBuffer bb;
+ public int bb_pos { get; private set; }
+ public ByteBuffer bb { get; private set; }
public ByteBuffer ByteBuffer { get { return bb; } }
+ // Re-init the internal state with an external buffer {@code ByteBuffer} and an offset within.
+ public Table(int _i, ByteBuffer _bb)
+ {
+ bb = _bb;
+ bb_pos = _i;
+ }
+
// Look up a field in the vtable, return an offset into the object, or 0 if the field is not
// present.
public int __offset(int vtableOffset)