Skip to content

Commit

Permalink
add client reconnect function and modf idl
Browse files Browse the repository at this point in the history
  • Loading branch information
noclear committed Sep 6, 2017
1 parent 235eb60 commit 66534a4
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 300 deletions.
5 changes: 3 additions & 2 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
"dependencies": {
"dlang-snappy": "~>0.0.1",
"flatbuffers": "~>0.1.1",
"kiss" : "~>0.0.7",
"kiss" : "~>0.0.8",
},

"license": "Apache-2.0"
"license": "Apache-2.0"

}
111 changes: 0 additions & 111 deletions kiss-rpc-idl/kissrpc/generated/client/TestRpcInterface.d

This file was deleted.

34 changes: 0 additions & 34 deletions kiss-rpc-idl/kissrpc/generated/client/TestRpcService.d

This file was deleted.

28 changes: 0 additions & 28 deletions kiss-rpc-idl/kissrpc/generated/message/TestRpc.d

This file was deleted.

8 changes: 0 additions & 8 deletions kiss-rpc-idl/kissrpc/generated/message/TestRpc.fbs

This file was deleted.

11 changes: 0 additions & 11 deletions kiss-rpc-idl/kissrpc/generated/message/TestRpcMessage.d

This file was deleted.

59 changes: 0 additions & 59 deletions kiss-rpc-idl/kissrpc/generated/server/TestRpcInterface.d

This file was deleted.

32 changes: 0 additions & 32 deletions kiss-rpc-idl/kissrpc/generated/server/TestRpcService.d

This file was deleted.

22 changes: 11 additions & 11 deletions kiss-rpc-idl/source/IDL/IdlInerfaceCreateCode.d
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class IdlFunctionAttrCode
formattedWrite(strings, "\t\t%s\n\n", IdlParseStruct.createDeserializeCodeForFlatbuffer(idlStructList[FunctionAttrInterface.funcArgMap.getTypeName], FunctionAttrInterface.funcArgMap.getVarName, FunctionAttrInterface.funcArgMap.getVarName~"FB"));


formattedWrite(strings, "\t\tauto %s = (cast(Rpc%sService)this).%s(%s);\n\n", FunctionAttrInterface.retValue.getVarName, inerfaceName, FunctionAttrInterface.getFuncName, FunctionAttrInterface.funcArgMap.getVarName);
formattedWrite(strings, "\t\tauto %s = (cast(%sService)this).%s(%s);\n\n", FunctionAttrInterface.retValue.getVarName, inerfaceName, FunctionAttrInterface.getFuncName, FunctionAttrInterface.funcArgMap.getVarName);

formattedWrite(strings, "\t\tauto builder = new FlatBufferBuilder(512);\n");

Expand Down Expand Up @@ -226,9 +226,9 @@ class idl_inerface_dlang_code
{
auto strings = appender!string();

formattedWrite(strings, "abstract class Rpc%sInterface{ \n\n", idlInterface.interfaceName);
formattedWrite(strings, "abstract class %sInterface{ \n\n", idlInterface.interfaceName);
formattedWrite(strings, "\tthis(RpcServer rpServer){ \n");
formattedWrite(strings, "\t\trpImpl = new RpcServerImpl!(Rpc%sService)(rpServer); \n", idlInterface.interfaceName);
formattedWrite(strings, "\t\trpImpl = new RpcServerImpl!(%sService)(rpServer); \n", idlInterface.interfaceName);

foreach(k,v; idlInterface.functionList)
{
Expand All @@ -242,7 +242,7 @@ class idl_inerface_dlang_code
formattedWrite(strings, IdlFunctionAttrCode.createServerInterfaceCode(v, idlInterface.interfaceName));
}

formattedWrite(strings, "\tRpcServerImpl!(Rpc%sService) rpImpl;\n}\n\n\n", idlInterface.interfaceName);
formattedWrite(strings, "\tRpcServerImpl!(%sService) rpImpl;\n}\n\n\n", idlInterface.interfaceName);

return strings.data;
}
Expand All @@ -253,12 +253,12 @@ class idl_inerface_dlang_code
auto strings = appender!string();


formattedWrite(strings, "\nclass Rpc%sService: Rpc%sInterface{\n\n", idlInterface.interfaceName, idlInterface.interfaceName);
formattedWrite(strings, "\nclass %sService: %sInterface{\n\n", idlInterface.interfaceName, idlInterface.interfaceName);
formattedWrite(strings, "\tthis(RpcServer rpServer){\n");

foreach(k,v; idlInterface.functionList)
{
formattedWrite(strings, "\t\tRpcBindFunctionMap[%s] = typeid(&Rpc%sService.%s).toString();\n", v.funcHash, idlInterface.interfaceName, v.funcName);
formattedWrite(strings, "\t\tRpcBindFunctionMap[%s] = typeid(&%sService.%s).toString();\n", v.funcHash, idlInterface.interfaceName, v.funcName);
}

formattedWrite(strings, "\t\tsuper(rpServer);\n");
Expand All @@ -279,9 +279,9 @@ class idl_inerface_dlang_code
{
auto strings = appender!string();

formattedWrite(strings, "abstract class Rpc%sInterface{ \n\n", idlInterface.interfaceName);
formattedWrite(strings, "abstract class %sInterface{ \n\n", idlInterface.interfaceName);
formattedWrite(strings, "\tthis(RpcClient rpClient){ \n");
formattedWrite(strings, "\t\trpImpl = new RpcClientImpl!(Rpc%sService)(rpClient); \n", idlInterface.interfaceName);
formattedWrite(strings, "\t\trpImpl = new RpcClientImpl!(%sService)(rpClient); \n", idlInterface.interfaceName);
formattedWrite(strings, "\t}\n\n");


Expand All @@ -290,7 +290,7 @@ class idl_inerface_dlang_code
formattedWrite(strings, IdlFunctionAttrCode.createClientInterfaceCode(v, idlInterface.interfaceName));
}

formattedWrite(strings, "\tRpcClientImpl!(Rpc%sService) rpImpl;\n}\n\n\n", idlInterface.interfaceName);
formattedWrite(strings, "\tRpcClientImpl!(%sService) rpImpl;\n}\n\n\n", idlInterface.interfaceName);

return strings.data;
}
Expand All @@ -300,12 +300,12 @@ class idl_inerface_dlang_code
{
auto strings = appender!string();

formattedWrite(strings, "\nclass Rpc%sService: Rpc%sInterface{\n\n", idlInterface.interfaceName, idlInterface.interfaceName);
formattedWrite(strings, "\nclass %sService: %sInterface{\n\n", idlInterface.interfaceName, idlInterface.interfaceName);
formattedWrite(strings, "\tthis(RpcClient rpClient){\n");

foreach(k,v; idlInterface.functionList)
{
formattedWrite(strings, "\t\tRpcBindFunctionMap[%s] = typeid(&Rpc%sService.%s).toString();\n", v.funcHash, idlInterface.interfaceName, v.funcName);
formattedWrite(strings, "\t\tRpcBindFunctionMap[%s] = typeid(&%sService.%s).toString();\n", v.funcHash, idlInterface.interfaceName, v.funcName);
}


Expand Down
Loading

0 comments on commit 66534a4

Please sign in to comment.