Fix cion C++ generator 40/269540/3
authorSangyoon Jang <jeremy.jang@samsung.com>
Tue, 18 Jan 2022 05:52:02 +0000 (14:52 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Mon, 24 Jan 2022 01:55:20 +0000 (01:55 +0000)
Add a parameter(peerinfo) for method handler.

Change-Id: I36a3fb7f2a8ec16e72e1a527a7ba79f3a6f4f624
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
idlc/gen_cion/cpp_cion_group_body_gen.cc
idlc/gen_cion/cpp_cion_group_body_gen_cb.h
idlc/gen_cion/cpp_cion_group_header_gen.cc
idlc/gen_cion/cpp_cion_group_header_gen_cb.h

index ac016be..51ab1ee 100644 (file)
@@ -133,12 +133,11 @@ void CppCionGroupBodyGen::GenHandlerInvocation(std::ofstream& stream,
 
   // Invoke
   std::string m;
-  m += "On" + decl.GetID() + "(";
+  m += "On" + decl.GetID() + "(peer_info";
   cnt = 1;
   for (auto i = decl.GetParameters().begin();
       i != decl.GetParameters().end(); ++i) {
-    if (cnt != 1)
-      m += ", ";
+    m += ", ";
     m += "param" + std::to_string(cnt++);
   }
 
index ec7fae8..5450595 100644 (file)
@@ -190,7 +190,7 @@ R"__cpp_cb(
   ret = cion_group_subscribe(group);
   if (ret != CION_ERROR_NONE) {
     _E("Failed to subscribe. error(%d)", ret);
-    switch(ret) {
+    switch (ret) {
     case CION_ERROR_PERMISSION_DENIED :
       throw UnauthorizedAccessException();
       break;
index 486a151..572b3bb 100644 (file)
@@ -101,7 +101,7 @@ void CppCionGroupHeaderGen::GenMethodHandlers(std::ofstream& stream,
 
   for (const auto& i : decls) {
     stream << Tab(1) << "virtual " << ConvertTypeToString(i->GetType()) << " On"
-           << i->GetID() << "(";
+           << i->GetID() << "(const cion_peer_info_h peer_info, ";
     GenParameters(stream, i->GetParameters());
     stream << ") = 0;" << NLine(1);
   }
index 41b3025..aed0e24 100644 (file)
@@ -52,7 +52,7 @@ R"__cpp_cb(  /// <summary>
   virtual void OnJoined(const cion_peer_info_h peer_info) = 0;
 
   /// <summary>
-  /// This method will be invoked after the peer group app was left from the tpoic.
+  /// This method will be invoked after the peer group app was left from the topic.
   /// </summary>
   virtual void OnLeft(const cion_peer_info_h peer_info) = 0;