Add missing code for cion cs generator 91/279891/2
authorSangyoon Jang <jeremy.jang@samsung.com>
Fri, 19 Aug 2022 01:00:03 +0000 (10:00 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Mon, 22 Aug 2022 05:33:09 +0000 (05:33 +0000)
Change-Id: Ib49372d83d62f0d002f2760169216d9b25741aab
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
idlc/gen_cion/cs_cion_proxy_gen.cc
idlc/gen_cion/cs_cion_proxy_gen.h
idlc/gen_cion/cs_cion_stub_gen.cc

index 7e7a421..5e49600 100644 (file)
@@ -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("<PEER_INFO_T>", 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("<PEER_INFO_T>", GetTransportable().Cs().GenPeerInfoType())
+      .Change("<PAYLOAD_T>", GetTransportable().Cs().GenPayloadType())
+      .Change("<PAYLOAD_TYPE_FILE>",
+          GetTransportable().Cs().GenPayloadTypeFile())
+      .Change("<PAYLOAD_TRANSFER_STATUS>",
+          GetTransportable().Cs().GenPayloadTransferStatusType())
+      .Out(stream);
+}
+
 void CsCionProxyGen::GenMethods(std::ofstream& stream, const Interface& iface) {
   auto& decls = iface.GetDeclarations();
 
index f2e4262..98c7736 100644 (file)
@@ -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);
 };
index b2b7ac6..1b20fdd 100644 (file)
@@ -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, "<VERSION>", FULLVER);
     GenServiceBase(stream, iface);
     GenCallbacks(stream, iface, false);
     GenDelegateId(stream, iface);