-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Your Name
committed
Aug 4, 2017
1 parent
bd1a7fb
commit dc245e4
Showing
138 changed files
with
2,487 additions
and
8,051 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// automatically generated by the FlatBuffers compiler, do not modify | ||
|
||
module KissRpc.IDL.flatbuffer.kissidl; | ||
|
||
import std.typecons; | ||
import flatbuffers; | ||
|
||
struct UserInfoFB { | ||
mixin Table!UserInfoFB; | ||
|
||
static UserInfoFB getRootAsUserInfoFB(ByteBuffer _bb) { return UserInfoFB.init_(_bb.get!int(_bb.position()) + _bb.position(), _bb); } | ||
@property Nullable!string name() { uint o = __offset(4); return o != 0 ? Nullable!string(__string(o + _pos)) : Nullable!string.init; } | ||
@property int age() { uint o = __offset(6); return o != 0 ? _buffer.get!int(o + _pos) : 0; } | ||
@property double widget() { uint o = __offset(8); return o != 0 ? _buffer.get!double(o + _pos) : 0.0; } | ||
|
||
static uint createUserInfoFB(FlatBufferBuilder builder,uint name,int age,double widget) { | ||
builder.startObject(3); | ||
UserInfoFB.addWidget(builder, widget); | ||
UserInfoFB.addAge(builder, age); | ||
UserInfoFB.addName(builder, name); | ||
return UserInfoFB.endUserInfoFB(builder); | ||
} | ||
|
||
static void startUserInfoFB(FlatBufferBuilder builder) { builder.startObject(3); } | ||
static void addName(FlatBufferBuilder builder, uint nameOffset) { builder.addOffset(0, nameOffset, 0); } | ||
static void addAge(FlatBufferBuilder builder, int age) { builder.add!int(1, age, 0); } | ||
static void addWidget(FlatBufferBuilder builder, double widget) { builder.add!double(2, widget, 0.0); } | ||
static uint endUserInfoFB(FlatBufferBuilder builder) { | ||
uint o = builder.endObject(); | ||
return o; | ||
} | ||
} | ||
|
||
struct ContactsFB { | ||
mixin Table!ContactsFB; | ||
|
||
static ContactsFB getRootAsContactsFB(ByteBuffer _bb) { return ContactsFB.init_(_bb.get!int(_bb.position()) + _bb.position(), _bb); } | ||
@property int number() { uint o = __offset(4); return o != 0 ? _buffer.get!int(o + _pos) : 0; } | ||
auto userInfoList() { return Iterator!(ContactsFB, UserInfoFB, "userInfoList")(this); } | ||
Nullable!UserInfoFB userInfoList(uint j) { uint o = __offset(6); return o != 0 ? Nullable!UserInfoFB(UserInfoFB.init_(__indirect(__dvector(o) + j * 4), _buffer)) : Nullable!UserInfoFB.init; } | ||
@property uint userInfoListLength() { uint o = __offset(6); return o != 0 ? __vector_len(o) : 0; } | ||
|
||
static uint createContactsFB(FlatBufferBuilder builder,int number,uint userInfoList) { | ||
builder.startObject(2); | ||
ContactsFB.addUserInfoList(builder, userInfoList); | ||
ContactsFB.addNumber(builder, number); | ||
return ContactsFB.endContactsFB(builder); | ||
} | ||
|
||
static void startContactsFB(FlatBufferBuilder builder) { builder.startObject(2); } | ||
static void addNumber(FlatBufferBuilder builder, int number) { builder.add!int(0, number, 0); } | ||
static void addUserInfoList(FlatBufferBuilder builder, uint userInfoListOffset) { builder.addOffset(1, userInfoListOffset, 0); } | ||
static uint createUserInfoListVector(FlatBufferBuilder builder, uint[] data) { builder.startVector(4, cast(uint)data.length, 4); for (size_t i = data.length; i > 0; i--) builder.addOffset(data[i - 1]); return builder.endVector(); } | ||
static void startUserInfoListVector(FlatBufferBuilder builder, uint numElems) { builder.startVector(4, numElems, 4); } | ||
static uint endContactsFB(FlatBufferBuilder builder) { | ||
uint o = builder.endObject(); | ||
return o; | ||
} | ||
} | ||
|
||
struct AccountNameFB { | ||
mixin Table!AccountNameFB; | ||
|
||
static AccountNameFB getRootAsAccountNameFB(ByteBuffer _bb) { return AccountNameFB.init_(_bb.get!int(_bb.position()) + _bb.position(), _bb); } | ||
@property Nullable!string name() { uint o = __offset(4); return o != 0 ? Nullable!string(__string(o + _pos)) : Nullable!string.init; } | ||
@property int count() { uint o = __offset(6); return o != 0 ? _buffer.get!int(o + _pos) : 0; } | ||
|
||
static uint createAccountNameFB(FlatBufferBuilder builder,uint name,int count) { | ||
builder.startObject(2); | ||
AccountNameFB.addCount(builder, count); | ||
AccountNameFB.addName(builder, name); | ||
return AccountNameFB.endAccountNameFB(builder); | ||
} | ||
|
||
static void startAccountNameFB(FlatBufferBuilder builder) { builder.startObject(2); } | ||
static void addName(FlatBufferBuilder builder, uint nameOffset) { builder.addOffset(0, nameOffset, 0); } | ||
static void addCount(FlatBufferBuilder builder, int count) { builder.add!int(1, count, 0); } | ||
static uint endAccountNameFB(FlatBufferBuilder builder) { | ||
uint o = builder.endObject(); | ||
return o; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace KissRpc.IDL.flatbuffer; | ||
|
||
table UserInfoFB{ | ||
name:string; | ||
age:int; | ||
widget:double; | ||
} | ||
|
||
|
||
table ContactsFB{ | ||
number:int; | ||
userInfoList:[UserInfoFB]; | ||
} | ||
|
||
|
||
table AccountNameFB{ | ||
name:string; | ||
count:int; | ||
} | ||
|
||
|
Oops, something went wrong.