From ebbb57530419cc75d94600bb67f9c2d4c66c25d1 Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Fri, 19 Aug 2022 10:00:03 +0900 Subject: [PATCH] Add missing code for cion cs generator Change-Id: Ib49372d83d62f0d002f2760169216d9b25741aab Signed-off-by: Sangyoon Jang --- idlc/gen_cion/cs_cion_proxy_gen.cc | 18 +++++++++++++++--- idlc/gen_cion/cs_cion_proxy_gen.h | 3 ++- idlc/gen_cion/cs_cion_stub_gen.cc | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/idlc/gen_cion/cs_cion_proxy_gen.cc b/idlc/gen_cion/cs_cion_proxy_gen.cc index 7e7a421..5e49600 100644 --- a/idlc/gen_cion/cs_cion_proxy_gen.cc +++ b/idlc/gen_cion/cs_cion_proxy_gen.cc @@ -71,12 +71,12 @@ void CsCionProxyGen::GenInterface(std::ofstream& stream, const Interface& iface) GenCallbacks(stream, iface, true); GenDelegateId(stream, iface); GenMethodId(stream, iface); - stream << CB_EVENT_METHODS; + GenEventMethods(stream, iface); GenSerializer(stream); GenListSerializer(stream); GenShareFile(stream, iface, true); GenCtor(stream, iface); - GenConnectMethod(stream, iface); + GenConnectMethods(stream, iface); GenMethods(stream, iface); }); } @@ -117,7 +117,7 @@ void CsCionProxyGen::GenCtor(std::ofstream& stream, const Interface& iface) { }); } -void CsCionProxyGen::GenConnectMethod(std::ofstream& stream, +void CsCionProxyGen::GenConnectMethods(std::ofstream& stream, const Interface& iface) { ReplaceAll(CB_CONNECT_METHOD) .Change("", GetTransportable().Cs().GenPeerInfoType()) @@ -125,6 +125,18 @@ void CsCionProxyGen::GenConnectMethod(std::ofstream& stream, stream << NLine(1); } +void CsCionProxyGen::GenEventMethods(std::ofstream& stream, + const Interface& iface) { + ReplaceAll(CB_EVENT_METHODS) + .Change("", GetTransportable().Cs().GenPeerInfoType()) + .Change("", GetTransportable().Cs().GenPayloadType()) + .Change("", + GetTransportable().Cs().GenPayloadTypeFile()) + .Change("", + GetTransportable().Cs().GenPayloadTransferStatusType()) + .Out(stream); +} + void CsCionProxyGen::GenMethods(std::ofstream& stream, const Interface& iface) { auto& decls = iface.GetDeclarations(); diff --git a/idlc/gen_cion/cs_cion_proxy_gen.h b/idlc/gen_cion/cs_cion_proxy_gen.h index f2e4262..98c7736 100644 --- a/idlc/gen_cion/cs_cion_proxy_gen.h +++ b/idlc/gen_cion/cs_cion_proxy_gen.h @@ -38,7 +38,8 @@ class CsCionProxyGen : public CsCionGeneratorBase { void GenInterfaces(std::ofstream& stream); void GenInterface(std::ofstream& stream, const Interface& iface); void GenCtor(std::ofstream& stream, const Interface& iface); - void GenConnectMethod(std::ofstream& stream, const Interface& iface); + void GenConnectMethods(std::ofstream& stream, const Interface& iface); + void GenEventMethods(std::ofstream& stream, const Interface& iface); void GenMethods(std::ofstream& stream, const Interface& iface); void GenInvocation(std::ofstream& stream, const Declaration& decl); }; diff --git a/idlc/gen_cion/cs_cion_stub_gen.cc b/idlc/gen_cion/cs_cion_stub_gen.cc index b2b7ac6..1b20fdd 100644 --- a/idlc/gen_cion/cs_cion_stub_gen.cc +++ b/idlc/gen_cion/cs_cion_stub_gen.cc @@ -63,6 +63,7 @@ void CsCionStubGen::GenInterface(std::ofstream& stream, const Interface& iface) stream << Tab(2) << "public sealed class " << iface.GetID() << " : ServerBase" << NLine(1); GenBrace(stream, TAB_SIZE * 2, [&]() { + stream << ReplaceAll(CB_DATA_MEMBERS, "", FULLVER); GenServiceBase(stream, iface); GenCallbacks(stream, iface, false); GenDelegateId(stream, iface); -- 2.7.4