Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
02dfa64a
Commit
02dfa64a
authored
Sep 09, 2016
by
Alberto Fernández
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow access to underlying ByteBuffer
parent
8e3fa336
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
20 additions
and
2 deletions
+20
-2
IFlatbufferObject.cs
net/FlatBuffers/IFlatbufferObject.cs
+2
-0
idl_gen_general.cpp
src/idl_gen_general.cpp
+5
-0
FlatBuffers.Test.csproj
tests/FlatBuffers.Test/FlatBuffers.Test.csproj
+2
-2
Monster.cs
tests/MyGame/Example/Monster.cs
+1
-0
Stat.cs
tests/MyGame/Example/Stat.cs
+1
-0
Test.cs
tests/MyGame/Example/Test.cs
+1
-0
TestSimpleTableWithEnum.cs
tests/MyGame/Example/TestSimpleTableWithEnum.cs
+1
-0
Vec3.cs
tests/MyGame/Example/Vec3.cs
+1
-0
Monster.cs
tests/MyGame/Example2/Monster.cs
+1
-0
generate_code.sh
tests/generate_code.sh
+0
-0
StructInNestedNS.cs
.../namespace_test/NamespaceA/NamespaceB/StructInNestedNS.cs
+1
-0
TableInNestedNS.cs
...s/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.cs
+1
-0
SecondTableInA.cs
tests/namespace_test/NamespaceA/SecondTableInA.cs
+1
-0
TableInFirstNS.cs
tests/namespace_test/NamespaceA/TableInFirstNS.cs
+1
-0
TableInC.cs
tests/namespace_test/NamespaceC/TableInC.cs
+1
-0
No files found.
net/FlatBuffers/IFlatbufferObject
.cs
→
net/FlatBuffers/IFlatbufferObject.cs
View file @
02dfa64a
...
...
@@ -22,5 +22,7 @@ namespace FlatBuffers
public
interface
IFlatbufferObject
{
void
__init
(
int
_i
,
ByteBuffer
_bb
);
ByteBuffer
ByteBuffer
{
get
;
}
}
}
src/idl_gen_general.cpp
View file @
02dfa64a
...
...
@@ -804,6 +804,11 @@ void GenStruct(StructDef &struct_def, std::string *code_ptr) {
code
+=
" private "
;
code
+=
struct_def
.
fixed
?
"Struct"
:
"Table"
;
code
+=
" __p;
\n
"
;
if
(
lang_
.
language
==
IDLOptions
::
kCSharp
)
{
code
+=
" public ByteBuffer ByteBuffer { get { return __p.bb; } }
\n
"
;
}
}
else
{
code
+=
lang_
.
inheritance_marker
;
code
+=
struct_def
.
fixed
?
"Struct"
:
"Table"
;
...
...
tests/FlatBuffers.Test/FlatBuffers.Test.csproj
View file @
02dfa64a
...
...
@@ -41,8 +41,8 @@
<Compile
Include=
"..\..\net\FlatBuffers\ByteBuffer.cs"
>
<Link>
FlatBuffers\ByteBuffer.cs
</Link>
</Compile>
<Compile
Include=
"..\..\net\FlatBuffers\IFlatbufferObject
.cs"
>
<Link>
FlatBuffers\IFlatbufferObject
.cs
</Link>
<Compile
Include=
"..\..\net\FlatBuffers\IFlatbufferObject.cs"
>
<Link>
FlatBuffers\IFlatbufferObject.cs
</Link>
</Compile>
<Compile
Include=
"..\..\net\FlatBuffers\Offset.cs"
>
<Link>
FlatBuffers\Offset.cs
</Link>
...
...
tests/MyGame/Example/Monster.cs
View file @
02dfa64a
...
...
@@ -10,6 +10,7 @@ using FlatBuffers;
public
struct
Monster
:
IFlatbufferObject
{
private
Table
__p
;
public
ByteBuffer
ByteBuffer
{
get
{
return
__p
.
bb
;
}
}
public
static
Monster
GetRootAsMonster
(
ByteBuffer
_bb
)
{
return
GetRootAsMonster
(
_bb
,
new
Monster
());
}
public
static
Monster
GetRootAsMonster
(
ByteBuffer
_bb
,
Monster
obj
)
{
return
(
obj
.
__assign
(
_bb
.
GetInt
(
_bb
.
Position
)
+
_bb
.
Position
,
_bb
));
}
public
static
bool
MonsterBufferHasIdentifier
(
ByteBuffer
_bb
)
{
return
Table
.
__has_identifier
(
_bb
,
"MONS"
);
}
...
...
tests/MyGame/Example/Stat.cs
View file @
02dfa64a
...
...
@@ -9,6 +9,7 @@ using FlatBuffers;
public
struct
Stat
:
IFlatbufferObject
{
private
Table
__p
;
public
ByteBuffer
ByteBuffer
{
get
{
return
__p
.
bb
;
}
}
public
static
Stat
GetRootAsStat
(
ByteBuffer
_bb
)
{
return
GetRootAsStat
(
_bb
,
new
Stat
());
}
public
static
Stat
GetRootAsStat
(
ByteBuffer
_bb
,
Stat
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
;
}
...
...
tests/MyGame/Example/Test.cs
View file @
02dfa64a
...
...
@@ -9,6 +9,7 @@ using FlatBuffers;
public
struct
Test
:
IFlatbufferObject
{
private
Struct
__p
;
public
ByteBuffer
ByteBuffer
{
get
{
return
__p
.
bb
;
}
}
public
void
__init
(
int
_i
,
ByteBuffer
_bb
)
{
__p
.
bb_pos
=
_i
;
__p
.
bb
=
_bb
;
}
public
Test
__assign
(
int
_i
,
ByteBuffer
_bb
)
{
__init
(
_i
,
_bb
);
return
this
;
}
...
...
tests/MyGame/Example/TestSimpleTableWithEnum.cs
View file @
02dfa64a
...
...
@@ -9,6 +9,7 @@ using FlatBuffers;
public
partial
struct
TestSimpleTableWithEnum
:
IFlatbufferObject
{
private
Table
__p
;
public
ByteBuffer
ByteBuffer
{
get
{
return
__p
.
bb
;
}
}
public
static
TestSimpleTableWithEnum
GetRootAsTestSimpleTableWithEnum
(
ByteBuffer
_bb
)
{
return
GetRootAsTestSimpleTableWithEnum
(
_bb
,
new
TestSimpleTableWithEnum
());
}
public
static
TestSimpleTableWithEnum
GetRootAsTestSimpleTableWithEnum
(
ByteBuffer
_bb
,
TestSimpleTableWithEnum
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
;
}
...
...
tests/MyGame/Example/Vec3.cs
View file @
02dfa64a
...
...
@@ -9,6 +9,7 @@ using FlatBuffers;
public
struct
Vec3
:
IFlatbufferObject
{
private
Struct
__p
;
public
ByteBuffer
ByteBuffer
{
get
{
return
__p
.
bb
;
}
}
public
void
__init
(
int
_i
,
ByteBuffer
_bb
)
{
__p
.
bb_pos
=
_i
;
__p
.
bb
=
_bb
;
}
public
Vec3
__assign
(
int
_i
,
ByteBuffer
_bb
)
{
__init
(
_i
,
_bb
);
return
this
;
}
...
...
tests/MyGame/Example2/Monster.cs
View file @
02dfa64a
...
...
@@ -9,6 +9,7 @@ using FlatBuffers;
public
struct
Monster
:
IFlatbufferObject
{
private
Table
__p
;
public
ByteBuffer
ByteBuffer
{
get
{
return
__p
.
bb
;
}
}
public
static
Monster
GetRootAsMonster
(
ByteBuffer
_bb
)
{
return
GetRootAsMonster
(
_bb
,
new
Monster
());
}
public
static
Monster
GetRootAsMonster
(
ByteBuffer
_bb
,
Monster
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
;
}
...
...
tests/generate_code.sh
100644 → 100755
View file @
02dfa64a
File mode changed from 100644 to 100755
tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.cs
View file @
02dfa64a
...
...
@@ -9,6 +9,7 @@ using FlatBuffers;
public
struct
StructInNestedNS
:
IFlatbufferObject
{
private
Struct
__p
;
public
ByteBuffer
ByteBuffer
{
get
{
return
__p
.
bb
;
}
}
public
void
__init
(
int
_i
,
ByteBuffer
_bb
)
{
__p
.
bb_pos
=
_i
;
__p
.
bb
=
_bb
;
}
public
StructInNestedNS
__assign
(
int
_i
,
ByteBuffer
_bb
)
{
__init
(
_i
,
_bb
);
return
this
;
}
...
...
tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.cs
View file @
02dfa64a
...
...
@@ -9,6 +9,7 @@ using FlatBuffers;
public
struct
TableInNestedNS
:
IFlatbufferObject
{
private
Table
__p
;
public
ByteBuffer
ByteBuffer
{
get
{
return
__p
.
bb
;
}
}
public
static
TableInNestedNS
GetRootAsTableInNestedNS
(
ByteBuffer
_bb
)
{
return
GetRootAsTableInNestedNS
(
_bb
,
new
TableInNestedNS
());
}
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
;
}
...
...
tests/namespace_test/NamespaceA/SecondTableInA.cs
View file @
02dfa64a
...
...
@@ -9,6 +9,7 @@ using FlatBuffers;
public
struct
SecondTableInA
:
IFlatbufferObject
{
private
Table
__p
;
public
ByteBuffer
ByteBuffer
{
get
{
return
__p
.
bb
;
}
}
public
static
SecondTableInA
GetRootAsSecondTableInA
(
ByteBuffer
_bb
)
{
return
GetRootAsSecondTableInA
(
_bb
,
new
SecondTableInA
());
}
public
static
SecondTableInA
GetRootAsSecondTableInA
(
ByteBuffer
_bb
,
SecondTableInA
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
;
}
...
...
tests/namespace_test/NamespaceA/TableInFirstNS.cs
View file @
02dfa64a
...
...
@@ -9,6 +9,7 @@ using FlatBuffers;
public
struct
TableInFirstNS
:
IFlatbufferObject
{
private
Table
__p
;
public
ByteBuffer
ByteBuffer
{
get
{
return
__p
.
bb
;
}
}
public
static
TableInFirstNS
GetRootAsTableInFirstNS
(
ByteBuffer
_bb
)
{
return
GetRootAsTableInFirstNS
(
_bb
,
new
TableInFirstNS
());
}
public
static
TableInFirstNS
GetRootAsTableInFirstNS
(
ByteBuffer
_bb
,
TableInFirstNS
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
;
}
...
...
tests/namespace_test/NamespaceC/TableInC.cs
View file @
02dfa64a
...
...
@@ -9,6 +9,7 @@ using FlatBuffers;
public
struct
TableInC
:
IFlatbufferObject
{
private
Table
__p
;
public
ByteBuffer
ByteBuffer
{
get
{
return
__p
.
bb
;
}
}
public
static
TableInC
GetRootAsTableInC
(
ByteBuffer
_bb
)
{
return
GetRootAsTableInC
(
_bb
,
new
TableInC
());
}
public
static
TableInC
GetRootAsTableInC
(
ByteBuffer
_bb
,
TableInC
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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment