Replace AITT with MQTT 20/284620/4
authorSangyoon Jang <jeremy.jang@samsung.com>
Tue, 22 Nov 2022 02:34:23 +0000 (11:34 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Tue, 3 Jan 2023 04:28:15 +0000 (13:28 +0900)
Change-Id: I1951de37c78e23b9b8d08f3770f82cc6d7017c89
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
59 files changed:
idlc/CMakeLists.txt
idlc/ast/location.hh
idlc/ast/parser.cc
idlc/ast/parser.h
idlc/ast/position.hh
idlc/ast/tidlc_l.cpp
idlc/ast/tidlc_y.cpp
idlc/ast/tidlc_y.hpp
idlc/gen_aitt_plugin/aitt_plugin_c_transportable.cc [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_c_transportable.h [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_cpp_transportable.cc [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_cpp_transportable.h [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_cs_base_gen.cc [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_cs_base_gen.h [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_cs_base_gen_cb.h [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_cs_interop_gen.cc [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_cs_interop_gen.h [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_cs_interop_gen_cb.h [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_cs_transportable.cc [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_cs_transportable.h [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_internal_body_gen.cc [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_internal_body_gen.h [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_internal_body_gen_cb.h [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_internal_header_gen.cc [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_internal_header_gen.h [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_internal_header_gen_cb.h [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_java_transportable.cc [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_java_transportable.h [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_loader.cc [deleted file]
idlc/gen_aitt_plugin/aitt_plugin_loader.h [deleted file]
idlc/gen_mqtt_plugin/mqtt_plugin_c_transportable.cc [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_c_transportable.h [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_cpp_transportable.cc [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_cpp_transportable.h [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_cs_base_gen.cc [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_cs_base_gen.h [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_cs_base_gen_cb.h [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_cs_interop_gen.cc [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_cs_interop_gen.h [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_cs_interop_gen_cb.h [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_cs_transportable.cc [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_cs_transportable.h [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_internal_body_gen.cc [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_internal_body_gen.h [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_internal_body_gen_cb.h [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_internal_header_gen.cc [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_internal_header_gen.h [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_internal_header_gen_cb.h [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_java_transportable.cc [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_java_transportable.h [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_loader.cc [new file with mode: 0644]
idlc/gen_mqtt_plugin/mqtt_plugin_loader.h [new file with mode: 0644]
idlc/main.cc
idlc/options.cc
idlc/options.h
release/windows-32/tidlc.exe
release/windows-64/tidlc.exe
tests/build_tests/CMakeLists.txt
tests/build_tests/prebuild.sh

index 7cc9a319449ece13d203074836e66cac8a981a8a..00a51780b80a9336542c05fe63de7f165d13c36d 100644 (file)
@@ -28,7 +28,7 @@ AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCES)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/ast AST_GEN_SOURCES)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/gen GEN_SOURCES)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/gen/version2 GEN_VERSION2_SOURCES)
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/gen_aitt_plugin GEN_AITT_PLUGIN_SOURCES)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/gen_mqtt_plugin GEN_MQTT_PLUGIN_SOURCES)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/gen_cion GEN_CION_SOURCES)
 
 BISON_TARGET(TIDLC ${CMAKE_CURRENT_SOURCE_DIR}/ast/tidlc.yy ${CMAKE_CURRENT_SOURCE_DIR}/ast/tidlc_y.cpp)
@@ -38,7 +38,7 @@ ADD_EXECUTABLE(${PROJECT_NAME}
        ${AST_GEN_SOURCES}
        ${BISON_TIDLC_OUTPUTS}
        ${FLEX_TIDLC_OUTPUTS}
-       ${GEN_AITT_PLUGIN_SOURCES}
+       ${GEN_MQTT_PLUGIN_SOURCES}
        ${GEN_CION_SOURCES}
        ${GEN_SOURCES}
        ${SOURCES}
@@ -48,4 +48,3 @@ ADD_EXECUTABLE(${PROJECT_NAME}
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIBPKGS_LIBRARIES} ${EXE_STATIC})
 
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
-
index 4e0b449c40f84aefd46d434dd0496a3a5a1325a6..895f1824a789542b6b47452cfd9144dc0b285683 100644 (file)
@@ -1,8 +1,8 @@
-// A Bison parser, made by GNU Bison 3.5.1.
+// A Bison parser, made by GNU Bison 3.0.4.
 
 // Locations for Bison parsers in C++
 
-// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
+// Copyright (C) 2002-2015 Free Software Foundation, Inc.
 
 // This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 // version 2.2 of Bison.
 
 /**
- ** \file /home/upple/tizen/appfw/tidl/idlc/ast/location.hh
+ ** \file /home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/location.hh
  ** Define the yy::location class.
  */
 
-#ifndef YY_YY_HOME_UPPLE_TIZEN_APPFW_TIDL_IDLC_AST_LOCATION_HH_INCLUDED
-# define YY_YY_HOME_UPPLE_TIZEN_APPFW_TIDL_IDLC_AST_LOCATION_HH_INCLUDED
+#ifndef YY_YY_HOME_GBS_WORKSPACE_CLONE_PUBLIC_APPFW_TIDL_IDLC_AST_LOCATION_HH_INCLUDED
+# define YY_YY_HOME_GBS_WORKSPACE_CLONE_PUBLIC_APPFW_TIDL_IDLC_AST_LOCATION_HH_INCLUDED
 
-# include <iostream>
-# include <string>
+# include "position.hh"
 
-# ifndef YY_NULLPTR
-#  if defined __cplusplus
-#   if 201103L <= __cplusplus
-#    define YY_NULLPTR nullptr
-#   else
-#    define YY_NULLPTR 0
-#   endif
-#  else
-#   define YY_NULLPTR ((void*)0)
-#  endif
-# endif
 
 namespace yy {
-#line 58 "/home/upple/tizen/appfw/tidl/idlc/ast/location.hh"
-
-  /// A point in a source file.
-  class position
-  {
-  public:
-    /// Type for line and column numbers.
-    typedef int counter_type;
-
-    /// Initialization.
-    void initialize (std::string* fn = YY_NULLPTR,
-                     counter_type l = 1,
-                     counter_type c = 1)
-    {
-      filename = fn;
-      line = l;
-      column = c;
-    }
-
-    /** \name Line and Column related manipulators
-     ** \{ */
-    /// (line related) Advance to the COUNT next lines.
-    void lines (counter_type count = 1)
-    {
-      if (count)
-        {
-          column = 1;
-          line = add_ (line, count, 1);
-        }
-    }
-
-    /// (column related) Advance to the COUNT next columns.
-    void columns (counter_type count = 1)
-    {
-      column = add_ (column, count, 1);
-    }
-    /** \} */
-
-    /// File name to which this position refers.
-    std::string* filename;
-    /// Current line number.
-    counter_type line;
-    /// Current column number.
-    counter_type column;
-
-  private:
-    /// Compute max (min, lhs+rhs).
-    static counter_type add_ (counter_type lhs, counter_type rhs, counter_type min)
-    {
-      return lhs + rhs < min ? min : lhs + rhs;
-    }
-  };
-
-  /// Add \a width columns, in place.
-  inline position&
-  operator+= (position& res, position::counter_type width)
-  {
-    res.columns (width);
-    return res;
-  }
-
-  /// Add \a width columns.
-  inline position
-  operator+ (position res, position::counter_type width)
-  {
-    return res += width;
-  }
-
-  /// Subtract \a width columns, in place.
-  inline position&
-  operator-= (position& res, position::counter_type width)
-  {
-    return res += -width;
-  }
-
-  /// Subtract \a width columns.
-  inline position
-  operator- (position res, position::counter_type width)
-  {
-    return res -= width;
-  }
-
-  /// Compare two position objects.
-  inline bool
-  operator== (const position& pos1, const position& pos2)
-  {
-    return (pos1.line == pos2.line
-            && pos1.column == pos2.column
-            && (pos1.filename == pos2.filename
-                || (pos1.filename && pos2.filename
-                    && *pos1.filename == *pos2.filename)));
-  }
-
-  /// Compare two position objects.
-  inline bool
-  operator!= (const position& pos1, const position& pos2)
-  {
-    return !(pos1 == pos2);
-  }
-
-  /** \brief Intercept output stream redirection.
-   ** \param ostr the destination output stream
-   ** \param pos a reference to the position to redirect
-   */
-  template <typename YYChar>
-  std::basic_ostream<YYChar>&
-  operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
-  {
-    if (pos.filename)
-      ostr << *pos.filename << ':';
-    return ostr << pos.line << '.' << pos.column;
-  }
-
-  /// Two points in a source file.
+#line 46 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/location.hh" // location.cc:296
+  /// Abstract a location.
   class location
   {
   public:
-    /// Type for line and column numbers.
-    typedef position::counter_type counter_type;
 
     /// Initialization.
     void initialize (std::string* f = YY_NULLPTR,
-                     counter_type l = 1,
-                     counter_type c = 1)
+                     unsigned int l = 1u,
+                     unsigned int c = 1u)
     {
       begin.initialize (f, l, c);
       end = begin;
@@ -193,13 +67,13 @@ namespace yy {
     }
 
     /// Extend the current location to the COUNT next columns.
-    void columns (counter_type count = 1)
+    void columns (int count = 1)
     {
       end += count;
     }
 
     /// Extend the current location to the COUNT next lines.
-    void lines (counter_type count = 1)
+    void lines (int count = 1)
     {
       end.lines (count);
     }
@@ -214,45 +88,39 @@ namespace yy {
   };
 
   /// Join two locations, in place.
-  inline location&
-  operator+= (location& res, const location& end)
+  inline location& operator+= (location& res, const location& end)
   {
     res.end = end.end;
     return res;
   }
 
   /// Join two locations.
-  inline location
-  operator+ (location res, const location& end)
+  inline location operator+ (location res, const location& end)
   {
     return res += end;
   }
 
   /// Add \a width columns to the end position, in place.
-  inline location&
-  operator+= (location& res, location::counter_type width)
+  inline location& operator+= (location& res, int width)
   {
     res.columns (width);
     return res;
   }
 
   /// Add \a width columns to the end position.
-  inline location
-  operator+ (location res, location::counter_type width)
+  inline location operator+ (location res, int width)
   {
     return res += width;
   }
 
   /// Subtract \a width columns to the end position, in place.
-  inline location&
-  operator-= (location& res, location::counter_type width)
+  inline location& operator-= (location& res, int width)
   {
     return res += -width;
   }
 
   /// Subtract \a width columns to the end position.
-  inline location
-  operator- (location res, location::counter_type width)
+  inline location operator- (location res, int width)
   {
     return res -= width;
   }
@@ -278,11 +146,10 @@ namespace yy {
    ** Avoid duplicate information.
    */
   template <typename YYChar>
-  std::basic_ostream<YYChar>&
+  inline std::basic_ostream<YYChar>&
   operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
   {
-    location::counter_type end_col
-      = 0 < loc.end.column ? loc.end.column - 1 : 0;
+    unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
     ostr << loc.begin;
     if (loc.end.filename
         && (!loc.begin.filename
@@ -295,7 +162,7 @@ namespace yy {
     return ostr;
   }
 
-} // yy
-#line 300 "/home/upple/tizen/appfw/tidl/idlc/ast/location.hh"
 
-#endif // !YY_YY_HOME_UPPLE_TIZEN_APPFW_TIDL_IDLC_AST_LOCATION_HH_INCLUDED
+} // yy
+#line 168 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/location.hh" // location.cc:296
+#endif // !YY_YY_HOME_GBS_WORKSPACE_CLONE_PUBLIC_APPFW_TIDL_IDLC_AST_LOCATION_HH_INCLUDED
index dc6581fde4622eb48224df8f8b210a7157e85c37..5f2991c63504bec87060b8d4e2613ede456b70bb 100644 (file)
@@ -33,10 +33,10 @@ void yylex_destroy(void*);
 
 namespace tidl {
 
-Parser::Parser(bool beta_enable, bool cion_enable, bool aitt_enable,
+Parser::Parser(bool beta_enable, bool cion_enable, bool mqtt_enable,
     bool group_enable)
     : scanner_(nullptr), error_(false), beta_enable_(beta_enable),
-    cion_enable_(cion_enable), aitt_enable_(aitt_enable),
+    cion_enable_(cion_enable), mqtt_enable_(mqtt_enable),
     group_enable_(group_enable), ver_(1) {
   yylex_init(&scanner_);
 }
@@ -96,8 +96,8 @@ bool Parser::IsCionEnabled() const {
   return cion_enable_;
 }
 
-bool Parser::IsAittEnabled() const {
-  return aitt_enable_;
+bool Parser::IsMqttEnabled() const {
+  return mqtt_enable_;
 }
 
 bool Parser::IsGroupEnabled() const {
index 9ce8252be40d95f698ba8af4795a56d324a656de..eba8211f03c65b59f265ae59a6529d5dcdf50c23 100644 (file)
@@ -28,7 +28,7 @@ namespace tidl {
 class Parser {
  public:
   Parser(bool beta_enable = false, bool cion_enable = false,
-      bool aitt_enable = false, bool group_enable = false);
+      bool mqtt_enable = false, bool group_enable = false);
   ~Parser();
 
   void* Scanner() const { return scanner_; }
@@ -39,7 +39,7 @@ class Parser {
   void ReportError(const std::string& err, unsigned line);
   bool IsBetaEnabled() const;
   bool IsCionEnabled() const;
-  bool IsAittEnabled() const;
+  bool IsMqttEnabled() const;
   bool IsGroupEnabled() const;
   void SetVersion(int ver);
   int GetVersion() const;
@@ -51,7 +51,7 @@ class Parser {
   bool error_;
   bool beta_enable_;
   bool cion_enable_;
-  bool aitt_enable_;
+  bool mqtt_enable_;
   bool group_enable_;
   int ver_;
 };
index bf34c1c57a7058bedf941ae0a2fbe6dba4f3fd5c..e2934992cb77a3364212ce39141d1da3d5f2929e 100644 (file)
-// A Bison parser, made by GNU Bison 3.5.1.
+// A Bison parser, made by GNU Bison 3.0.4.
 
-// Starting with Bison 3.2, this file is useless: the structure it
-// used to define is now defined in "location.hh".
-//
-// To get rid of this file:
-// 1. add '%require "3.2"' (or newer) to your grammar file
-// 2. remove references to this file from your build system
-// 3. if you used to include it, include "location.hh" instead.
+// Positions for Bison parsers in C++
 
-#include "location.hh"
+// Copyright (C) 2002-2015 Free Software Foundation, Inc.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+// As a special exception, you may create a larger work that contains
+// part or all of the Bison parser skeleton and distribute that work
+// under terms of your choice, so long as that work isn't itself a
+// parser generator using the skeleton or a modified version thereof
+// as a parser skeleton.  Alternatively, if you modify or redistribute
+// the parser skeleton itself, you may (at your option) remove this
+// special exception, which will cause the skeleton and the resulting
+// Bison output files to be licensed under the GNU General Public
+// License without this special exception.
+
+// This special exception was added by the Free Software Foundation in
+// version 2.2 of Bison.
+
+/**
+ ** \file /home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/position.hh
+ ** Define the yy::position class.
+ */
+
+#ifndef YY_YY_HOME_GBS_WORKSPACE_CLONE_PUBLIC_APPFW_TIDL_IDLC_AST_POSITION_HH_INCLUDED
+# define YY_YY_HOME_GBS_WORKSPACE_CLONE_PUBLIC_APPFW_TIDL_IDLC_AST_POSITION_HH_INCLUDED
+
+# include <algorithm> // std::max
+# include <iostream>
+# include <string>
+
+# ifndef YY_NULLPTR
+#  if defined __cplusplus && 201103L <= __cplusplus
+#   define YY_NULLPTR nullptr
+#  else
+#   define YY_NULLPTR 0
+#  endif
+# endif
+
+
+namespace yy {
+#line 56 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/position.hh" // location.cc:296
+  /// Abstract a position.
+  class position
+  {
+  public:
+    /// Initialization.
+    void initialize (std::string* fn = YY_NULLPTR,
+                     unsigned int l = 1u,
+                     unsigned int c = 1u)
+    {
+      filename = fn;
+      line = l;
+      column = c;
+    }
+
+    /** \name Line and Column related manipulators
+     ** \{ */
+    /// (line related) Advance to the COUNT next lines.
+    void lines (int count = 1)
+    {
+      if (count)
+        {
+          column = 1u;
+          line = add_ (line, count, 1);
+        }
+    }
+
+    /// (column related) Advance to the COUNT next columns.
+    void columns (int count = 1)
+    {
+      column = add_ (column, count, 1);
+    }
+    /** \} */
+
+    /// File name to which this position refers.
+    std::string* filename;
+    /// Current line number.
+    unsigned int line;
+    /// Current column number.
+    unsigned int column;
+
+  private:
+    /// Compute max(min, lhs+rhs) (provided min <= lhs).
+    static unsigned int add_ (unsigned int lhs, int rhs, unsigned int min)
+    {
+      return (0 < rhs || -static_cast<unsigned int>(rhs) < lhs
+              ? rhs + lhs
+              : min);
+    }
+  };
+
+  /// Add \a width columns, in place.
+  inline position&
+  operator+= (position& res, int width)
+  {
+    res.columns (width);
+    return res;
+  }
+
+  /// Add \a width columns.
+  inline position
+  operator+ (position res, int width)
+  {
+    return res += width;
+  }
+
+  /// Subtract \a width columns, in place.
+  inline position&
+  operator-= (position& res, int width)
+  {
+    return res += -width;
+  }
+
+  /// Subtract \a width columns.
+  inline position
+  operator- (position res, int width)
+  {
+    return res -= width;
+  }
+
+  /// Compare two position objects.
+  inline bool
+  operator== (const position& pos1, const position& pos2)
+  {
+    return (pos1.line == pos2.line
+            && pos1.column == pos2.column
+            && (pos1.filename == pos2.filename
+                || (pos1.filename && pos2.filename
+                    && *pos1.filename == *pos2.filename)));
+  }
+
+  /// Compare two position objects.
+  inline bool
+  operator!= (const position& pos1, const position& pos2)
+  {
+    return !(pos1 == pos2);
+  }
+
+  /** \brief Intercept output stream redirection.
+   ** \param ostr the destination output stream
+   ** \param pos a reference to the position to redirect
+   */
+  template <typename YYChar>
+  inline std::basic_ostream<YYChar>&
+  operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
+  {
+    if (pos.filename)
+      ostr << *pos.filename << ':';
+    return ostr << pos.line << '.' << pos.column;
+  }
+
+
+} // yy
+#line 169 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/position.hh" // location.cc:296
+#endif // !YY_YY_HOME_GBS_WORKSPACE_CLONE_PUBLIC_APPFW_TIDL_IDLC_AST_POSITION_HH_INCLUDED
index efb6c55c9fe02e31b0d6409f83c54162c718eb05..53e20889516f95322eef3e36e9211d1132e8e5a5 100644 (file)
@@ -1,6 +1,6 @@
-#line 2 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_l.cpp"
+#line 2 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_l.cpp"
 
-#line 4 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_l.cpp"
+#line 4 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_l.cpp"
 
 #define  YY_INT_ALIGNED short int
 
@@ -382,8 +382,8 @@ static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
        yyg->yy_hold_char = *yy_cp; \
        *yy_cp = '\0'; \
        yyg->yy_c_buf_p = yy_cp;
-#define YY_NUM_RULES 46
-#define YY_END_OF_BUFFER 47
+#define YY_NUM_RULES 48
+#define YY_END_OF_BUFFER 49
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -391,22 +391,23 @@ struct yy_trans_info
        flex_int32_t yy_verify;
        flex_int32_t yy_nxt;
        };
-static const flex_int16_t yy_accept[132] =
+static const flex_int16_t yy_accept[142] =
     {   0,
-        0,    0,    0,    0,    0,    0,   47,   45,   12,   11,
-        8,   16,   17,   13,   45,   18,   35,   44,   36,   41,
-       42,   43,   41,   41,   41,   41,   41,   41,   41,   41,
-       41,   41,   41,   14,   15,    6,    5,    6,   10,   46,
-        9,   10,   11,    1,    0,   41,   41,   41,   41,   41,
-       41,   41,   41,   41,   41,   30,   41,   41,   41,   41,
-       41,   41,   41,    6,    5,    3,   10,    0,    7,   41,
-       41,   41,   41,   41,   41,   41,   41,   41,   22,   41,
-       41,   31,   32,   41,   41,   41,    0,    5,    4,    0,
-        2,    0,   41,   41,   29,   41,   20,   41,   41,   27,
-
-       41,   41,   37,   23,   41,   41,   41,   19,    0,   38,
-       33,   41,   41,   41,   24,   41,   21,   41,   41,   26,
-       41,   25,   41,   28,   39,   41,   41,   34,   41,   40,
+        0,    0,    0,    0,    0,    0,   49,   47,   12,   11,
+        8,   16,   17,   13,   47,   43,   18,   36,   46,   37,
+       42,   44,   45,   42,   42,   42,   42,   42,   42,   42,
+       42,   42,   42,   42,   42,   14,   15,    6,    5,    6,
+       10,   48,    9,   10,   11,    1,    0,   43,   42,   42,
+       42,   42,   42,   42,   42,   42,   42,   42,   31,   42,
+       42,   42,   42,   42,   42,   42,   42,    6,    5,    3,
+       10,    0,    7,   42,   42,   42,   42,   42,   42,   42,
+       42,   42,   22,   42,   42,   32,   42,   33,   42,   42,
+       42,    0,    5,    4,    0,    2,    0,   42,   42,   29,
+
+       42,   20,   42,   42,   27,   42,   42,   38,   23,   42,
+       42,   42,   42,   19,    0,   39,   34,   42,   42,   42,
+       24,   42,   42,   21,   42,   42,   26,   42,   25,   42,
+       42,   28,   40,   42,   42,   42,   35,   42,   30,   41,
         0
     } ;
 
@@ -424,8 +425,8 @@ static const YY_CHAR yy_ec[256] =
        16,    1,   17,    1,   15,    1,   18,   19,   20,   21,
 
        22,   23,   24,   25,   26,   15,   15,   27,   15,   28,
-       29,   15,   15,   30,   31,   32,   33,   34,   15,   15,
-       35,   15,   36,    1,   37,    1,    1,    1,    1,    1,
+       29,   30,   15,   31,   32,   33,   34,   35,   15,   15,
+       36,   15,   37,    1,   38,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -442,110 +443,114 @@ static const YY_CHAR yy_ec[256] =
         1,    1,    1,    1,    1
     } ;
 
-static const YY_CHAR yy_meta[38] =
+static const YY_CHAR yy_meta[39] =
     {   0,
         1,    1,    1,    1,    1,    1,    2,    1,    1,    3,
         1,    1,    1,    1,    3,    1,    1,    3,    3,    3,
         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    1,    1
+        3,    3,    3,    3,    3,    3,    1,    1
     } ;
 
-static const flex_int16_t yy_base[138] =
+static const flex_int16_t yy_base[148] =
     {   0,
-        0,    0,   35,   36,   37,   42,  156,  157,  157,  152,
-      157,  157,  157,  157,   41,  157,  157,  157,  157,    0,
-      157,  157,   21,   24,  129,   25,   29,  125,   32,  119,
-      129,   34,  121,  157,  157,  146,  145,  138,  143,  142,
-      141,  157,  140,  157,  139,    0,  111,  105,  110,  110,
-      119,  109,  102,  107,  104,  100,  100,  102,   97,  105,
-       98,   96,   99,    0,  121,   60,    0,  120,  157,  104,
-       93,   93,   98,   88,   95,   97,   93,   96,   91,   80,
-       87,    0,    0,   80,   38,   88,  105,  104,  103,   96,
-      157,  101,   68,   82,    0,   74,    0,   76,   72,    0,
-
-       66,   67,    0,    0,   64,   67,   74,    0,   53,    0,
-        0,   71,   74,   69,    0,   67,    0,   65,   56,    0,
-       55,    0,   67,    0,    0,   60,   50,    0,   46,    0,
-      157,   71,   74,   62,   77,   80,   83
+        0,    0,   36,   37,   38,   43,  166,  167,  167,  162,
+      167,  167,  167,  167,   42,  154,  167,  167,  167,  167,
+        0,  167,  167,   21,   25,  138,   26,   30,  134,   32,
+      127,  129,  137,   35,  129,  167,  167,  154,  153,  146,
+      151,  150,  149,  167,  148,  167,  147,  139,    0,  117,
+      111,  117,  117,  126,  116,  108,  114,  111,  106,  106,
+      109,  103,  106,  111,  104,  101,  105,    0,  127,   60,
+        0,  126,  167,  110,   99,   99,  104,   93,  101,  103,
+       99,  102,   97,   85,   93,    0,   83,    0,   84,   36,
+       93,  110,  109,  108,  101,  167,  106,   72,   87,    0,
+
+       79,    0,   81,   77,    0,   70,   71,    0,    0,   72,
+       67,   71,   78,    0,   57,    0,    0,   75,   78,   73,
+        0,   71,   73,    0,   68,   58,    0,   57,    0,   71,
+       59,    0,    0,   65,   66,   57,    0,   59,    0,    0,
+      167,   70,   73,   62,   76,   79,   82
     } ;
 
-static const flex_int16_t yy_def[138] =
+static const flex_int16_t yy_def[148] =
     {   0,
-      131,    1,  132,  132,  133,  133,  131,  131,  131,  131,
-      131,  131,  131,  131,  131,  131,  131,  131,  131,  134,
-      131,  131,  134,  134,  134,  134,  134,  134,  134,  134,
-      134,  134,  134,  131,  131,  131,  131,  131,  131,  131,
-      131,  131,  131,  131,  135,  134,  134,  134,  134,  134,
-      134,  134,  134,  134,  134,  134,  134,  134,  134,  134,
-      134,  134,  134,  136,  136,  131,  137,  135,  131,  134,
-      134,  134,  134,  134,  134,  134,  134,  134,  134,  134,
-      134,  134,  134,  134,  134,  134,  131,  131,  131,  131,
-      131,  131,  134,  134,  134,  134,  134,  134,  134,  134,
-
-      134,  134,  134,  134,  134,  134,  134,  134,  131,  134,
-      134,  134,  134,  134,  134,  134,  134,  134,  134,  134,
-      134,  134,  134,  134,  134,  134,  134,  134,  134,  134,
-        0,  131,  131,  131,  131,  131,  131
+      141,    1,  142,  142,  143,  143,  141,  141,  141,  141,
+      141,  141,  141,  141,  141,  141,  141,  141,  141,  141,
+      144,  141,  141,  144,  144,  144,  144,  144,  144,  144,
+      144,  144,  144,  144,  144,  141,  141,  141,  141,  141,
+      141,  141,  141,  141,  141,  141,  145,  141,  144,  144,
+      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
+      144,  144,  144,  144,  144,  144,  144,  146,  146,  141,
+      147,  145,  141,  144,  144,  144,  144,  144,  144,  144,
+      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
+      144,  141,  141,  141,  141,  141,  141,  144,  144,  144,
+
+      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
+      144,  144,  144,  144,  141,  144,  144,  144,  144,  144,
+      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
+      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
+        0,  141,  141,  141,  141,  141,  141
     } ;
 
-static const flex_int16_t yy_nxt[195] =
+static const flex_int16_t yy_nxt[206] =
     {   0,
-        8,    9,   10,   11,   12,   13,    8,   14,   15,    8,
-       16,   17,   18,   19,   20,   21,   22,   23,   24,   25,
-       26,   20,   27,   20,   20,   28,   29,   20,   30,   31,
-       32,   20,   20,   33,   20,   34,   35,   37,   37,   40,
-       41,   38,   38,   42,   40,   41,   52,   44,   42,   45,
-       47,   48,   49,   53,   54,   55,   50,   57,   61,   90,
-       58,   91,   89,  106,   46,   62,   90,  130,   91,  129,
-      107,   36,   36,   36,   39,   39,   39,   68,   68,   68,
-       87,  128,   87,   92,  127,   92,  126,  125,  124,  123,
-      122,  121,  120,  119,  118,  117,  116,  115,  114,  113,
-
-      112,  111,  110,   67,  109,   89,   65,   64,  108,  105,
-      104,  103,  102,  101,  100,   99,   98,   97,   96,   95,
-       94,   93,   69,   88,   86,   85,   84,   83,   82,   81,
-       80,   79,   78,   77,   76,   75,   74,   73,   72,   71,
-       70,   69,   43,   67,   67,   67,   66,   65,   64,   63,
-       60,   59,   56,   51,   43,  131,    7,  131,  131,  131,
-      131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
-      131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
-      131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
-      131,  131,  131,  131
-
+        8,    9,   10,   11,   12,   13,    8,   14,   15,   16,
+       17,   18,   19,   20,   21,   22,   23,   24,   25,   26,
+       27,   21,   28,   21,   21,   29,   30,   21,   31,   32,
+       33,   34,   21,   21,   35,   21,   36,   37,   39,   39,
+       42,   43,   40,   40,   44,   42,   43,   55,   46,   44,
+       47,   50,   51,   52,   56,   57,   58,   60,   53,   65,
+       61,  112,   94,   95,   49,   96,   95,   66,   96,  113,
+       38,   38,   38,   41,   41,   41,   72,   72,   72,   92,
+      140,   92,   97,  139,   97,  138,  137,  136,  135,  134,
+      133,  132,  131,  130,  129,  128,  127,  126,  125,  124,
+
+      123,  122,  121,  120,  119,  118,  117,  116,   71,  115,
+       94,   69,   68,  114,  111,  110,  109,  108,  107,  106,
+      105,  104,  103,  102,  101,  100,   99,   98,   73,   93,
+       91,   90,   89,   88,   87,   86,   85,   84,   83,   82,
+       81,   80,   79,   78,   77,   76,   75,   74,   48,   73,
+       45,   71,   71,   71,   70,   69,   68,   67,   64,   63,
+       62,   59,   54,   48,   45,  141,    7,  141,  141,  141,
+      141,  141,  141,  141,  141,  141,  141,  141,  141,  141,
+      141,  141,  141,  141,  141,  141,  141,  141,  141,  141,
+      141,  141,  141,  141,  141,  141,  141,  141,  141,  141,
+
+      141,  141,  141,  141,  141
     } ;
 
-static const flex_int16_t yy_chk[195] =
+static const flex_int16_t yy_chk[206] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    3,    4,    5,
-        5,    3,    4,    5,    6,    6,   26,   15,    6,   15,
-       23,   23,   24,   26,   27,   27,   24,   29,   32,  109,
-       29,  109,   66,   85,  134,   32,   66,  129,   66,  127,
-       85,  132,  132,  132,  133,  133,  133,  135,  135,  135,
-      136,  126,  136,  137,  123,  137,  121,  119,  118,  116,
-      114,  113,  112,  107,  106,  105,  102,  101,   99,   98,
-
-       96,   94,   93,   92,   90,   89,   88,   87,   86,   84,
-       81,   80,   79,   78,   77,   76,   75,   74,   73,   72,
-       71,   70,   68,   65,   63,   62,   61,   60,   59,   58,
-       57,   56,   55,   54,   53,   52,   51,   50,   49,   48,
-       47,   45,   43,   41,   40,   39,   38,   37,   36,   33,
-       31,   30,   28,   25,   10,    7,  131,  131,  131,  131,
-      131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
-      131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
-      131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
-      131,  131,  131,  131
-
+        1,    1,    1,    1,    1,    1,    1,    1,    3,    4,
+        5,    5,    3,    4,    5,    6,    6,   27,   15,    6,
+       15,   24,   24,   25,   27,   28,   28,   30,   25,   34,
+       30,   90,   70,  115,  144,  115,   70,   34,   70,   90,
+      142,  142,  142,  143,  143,  143,  145,  145,  145,  146,
+      138,  146,  147,  136,  147,  135,  134,  131,  130,  128,
+      126,  125,  123,  122,  120,  119,  118,  113,  112,  111,
+
+      110,  107,  106,  104,  103,  101,   99,   98,   97,   95,
+       94,   93,   92,   91,   89,   87,   85,   84,   83,   82,
+       81,   80,   79,   78,   77,   76,   75,   74,   72,   69,
+       67,   66,   65,   64,   63,   62,   61,   60,   59,   58,
+       57,   56,   55,   54,   53,   52,   51,   50,   48,   47,
+       45,   43,   42,   41,   40,   39,   38,   35,   33,   32,
+       31,   29,   26,   16,   10,    7,  141,  141,  141,  141,
+      141,  141,  141,  141,  141,  141,  141,  141,  141,  141,
+      141,  141,  141,  141,  141,  141,  141,  141,  141,  141,
+      141,  141,  141,  141,  141,  141,  141,  141,  141,  141,
+
+      141,  141,  141,  141,  141
     } ;
 
 /* Table of booleans, true if rule could match eol. */
-static const flex_int32_t yy_rule_can_match_eol[47] =
+static const flex_int32_t yy_rule_can_match_eol[49] =
     {   0,
 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0,     };
+    0, 0, 0, 0, 0, 0, 0, 0, 0,     };
 
 /* The intent behind this definition is that it'll catch
  * any uses of REJECT which flex missed.
@@ -554,8 +559,8 @@ static const flex_int32_t yy_rule_can_match_eol[47] =
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
-#line 1 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
-#line 2 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 1 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
+#line 2 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 #include <stdio.h>
 #include <string>
 
@@ -572,9 +577,9 @@ static const flex_int32_t yy_rule_can_match_eol[47] =
 #include "idlc/ast/tidlc_y.hpp"
 
 #define YY_USER_ACTION yylloc->columns(yyleng);
-#line 576 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_l.cpp"
+#line 581 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_l.cpp"
 
-#line 578 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_l.cpp"
+#line 583 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_l.cpp"
 
 #define INITIAL 0
 #define COMMENT 1
@@ -860,15 +865,15 @@ YY_DECL
                }
 
        {
-#line 28 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 28 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 
 
-#line 31 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 31 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
   std::string comments;
   std::string values;
 
 
-#line 872 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_l.cpp"
+#line 877 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_l.cpp"
 
        while ( /*CONSTCOND*/1 )                /* loops until end-of-file is reached */
                {
@@ -895,13 +900,13 @@ yy_match:
                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                                {
                                yy_current_state = (int) yy_def[yy_current_state];
-                               if ( yy_current_state >= 132 )
+                               if ( yy_current_state >= 142 )
                                        yy_c = yy_meta[yy_c];
                                }
                        yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
                        ++yy_cp;
                        }
-               while ( yy_base[yy_current_state] != 157 );
+               while ( yy_base[yy_current_state] != 167 );
 
 yy_find_action:
                yy_act = yy_accept[yy_current_state];
@@ -939,55 +944,55 @@ do_action:        /* This label is used only to access EOF actions. */
 
 case 1:
 YY_RULE_SETUP
-#line 35 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 35 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { comments += yytext; BEGIN(COMMENT); }
        YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 36 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 36 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { comments += yytext; yylloc->step(); BEGIN(INITIAL); }
        YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 37 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 37 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { comments += yytext; comments += "\n"; BEGIN(INITIAL); }
        YY_BREAK
 case 4:
 /* rule 4 can match eol */
 YY_RULE_SETUP
-#line 38 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 38 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { comments += yytext; yylloc->step(); BEGIN(INITIAL); }
        YY_BREAK
 case 5:
 /* rule 5 can match eol */
 YY_RULE_SETUP
-#line 39 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 39 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { comments += yytext; yylloc->lines(yyleng); }
        YY_BREAK
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
-#line 40 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 40 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { comments += yytext; yylloc->step(); }
        YY_BREAK
 case YY_STATE_EOF(COMMENT):
-#line 41 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 41 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { return 0; }
        YY_BREAK
 case 7:
 /* rule 7 can match eol */
 YY_RULE_SETUP
-#line 43 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 43 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { comments += yytext; yylloc->step(); }
        YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 45 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 45 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { BEGIN(VALUE); }
        YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 46 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 46 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           BEGIN(INITIAL);
                           yylval->token = new tidl::Token(values, comments);
@@ -997,54 +1002,54 @@ YY_RULE_SETUP
 case 10:
 /* rule 10 can match eol */
 YY_RULE_SETUP
-#line 51 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 51 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { values += yytext; yylloc->step(); }
        YY_BREAK
 case 11:
 /* rule 11 can match eol */
 YY_RULE_SETUP
-#line 53 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 53 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { yylloc->lines(yyleng); yylloc->step(); }
        YY_BREAK
 case 12:
 /* rule 12 can match eol */
 YY_RULE_SETUP
-#line 55 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 55 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 ; // ignore all whitespace
        YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 56 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 56 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { return yy::parser::token::T_COMMA; }
        YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 57 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 57 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { return yy::parser::token::T_BRACE_OPEN; }
        YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 58 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 58 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { return yy::parser::token::T_BRACE_CLOSE; }
        YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 59 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 59 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { return yy::parser::token::T_LEFT; }
        YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 60 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 60 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { return yy::parser::token::T_RIGHT; }
        YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 61 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 61 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { return yy::parser::token::T_SEMICOLON; }
        YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 62 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 62 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_VOID;
@@ -1052,7 +1057,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 66 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 66 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_CHAR;
@@ -1060,7 +1065,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 70 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 70 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_SHORT;
@@ -1068,7 +1073,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 74 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 74 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_INT;
@@ -1076,7 +1081,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 78 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 78 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_LONG;
@@ -1084,7 +1089,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 82 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 82 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_FLOAT;
@@ -1092,7 +1097,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 86 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 86 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_DOUBLE;
@@ -1100,7 +1105,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 90 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 90 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_BUNDLE;
@@ -1108,7 +1113,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 94 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 94 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_FILE;
@@ -1116,7 +1121,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 98 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 98 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_STRING;
@@ -1124,7 +1129,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 29:
 YY_RULE_SETUP
-#line 102 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 102 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_BOOL;
@@ -1132,111 +1137,127 @@ YY_RULE_SETUP
        YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 106 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
-{ return yy::parser::token::T_IN; }
+#line 106 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
+{
+                          yylval->token = new tidl::Token(yytext, comments);
+                          return yy::parser::token::T_PROTOCOL;
+                        }
        YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 107 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
-{ return yy::parser::token::T_OUT; }
+#line 110 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
+{ return yy::parser::token::T_IN; }
        YY_BREAK
 case 32:
 YY_RULE_SETUP
-#line 108 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
-{ return yy::parser::token::T_REF; }
+#line 111 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
+{ return yy::parser::token::T_OUT; }
        YY_BREAK
 case 33:
 YY_RULE_SETUP
-#line 109 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
-{ return yy::parser::token::T_ASYNC; }
+#line 112 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
+{ return yy::parser::token::T_REF; }
        YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 110 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
-{ return yy::parser::token::T_DELEGATE; }
+#line 113 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
+{ return yy::parser::token::T_ASYNC; }
        YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 111 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
-{ return yy::parser::token::T_META_OPEN; }
+#line 114 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
+{ return yy::parser::token::T_DELEGATE; }
        YY_BREAK
 case 36:
 YY_RULE_SETUP
-#line 112 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
-{ return yy::parser::token::T_META_CLOSE; }
+#line 115 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
+{ return yy::parser::token::T_META_OPEN; }
        YY_BREAK
 case 37:
 YY_RULE_SETUP
-#line 113 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 116 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
+{ return yy::parser::token::T_META_CLOSE; }
+       YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 117 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_LIST;
                         }
        YY_BREAK
-case 38:
+case 39:
 YY_RULE_SETUP
-#line 117 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 121 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_ARRAY;
                         }
        YY_BREAK
-case 39:
+case 40:
 YY_RULE_SETUP
-#line 121 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 125 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_STRUCTURE;
                         }
        YY_BREAK
-case 40:
+case 41:
 YY_RULE_SETUP
-#line 125 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 129 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_INTERFACE;
                         }
        YY_BREAK
-case 41:
+case 42:
 YY_RULE_SETUP
-#line 129 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 133 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 {
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_ID;
                         }
        YY_BREAK
-case 42:
+case 43:
+YY_RULE_SETUP
+#line 137 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
+{
+                          yylval->token = new tidl::Token(yytext, comments);
+                          return yy::parser::token::T_NUMBER;
+                        }
+       YY_BREAK
+case 44:
 YY_RULE_SETUP
-#line 133 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 141 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { // Square Bracket
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_SB_OPEN;
                         }
        YY_BREAK
-case 43:
+case 45:
 YY_RULE_SETUP
-#line 137 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 145 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { // Square Bracket
                           yylval->token = new tidl::Token(yytext, comments);
                           return yy::parser::token::T_SB_CLOSE;
                         }
        YY_BREAK
-case 44:
+case 46:
 YY_RULE_SETUP
-#line 141 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 149 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { return yy::parser::token::T_EQUAL; }
        YY_BREAK
-case 45:
+case 47:
 YY_RULE_SETUP
-#line 142 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 150 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 { return yy::parser::token::T_UNKNOWN; }
        YY_BREAK
-case 46:
+case 48:
 YY_RULE_SETUP
-#line 144 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 152 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 ECHO;
        YY_BREAK
-#line 1240 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_l.cpp"
+#line 1261 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_l.cpp"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(VALUE):
        yyterminate();
@@ -1536,7 +1557,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                        {
                        yy_current_state = (int) yy_def[yy_current_state];
-                       if ( yy_current_state >= 132 )
+                       if ( yy_current_state >= 142 )
                                yy_c = yy_meta[yy_c];
                        }
                yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@@ -1565,11 +1586,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                {
                yy_current_state = (int) yy_def[yy_current_state];
-               if ( yy_current_state >= 132 )
+               if ( yy_current_state >= 142 )
                        yy_c = yy_meta[yy_c];
                }
        yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
-       yy_is_jam = (yy_current_state == 131);
+       yy_is_jam = (yy_current_state == 141);
 
        (void)yyg;
        return yy_is_jam ? 0 : yy_current_state;
@@ -2441,7 +2462,7 @@ void yyfree (void * ptr , yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
-#line 144 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.ll"
+#line 152 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.ll"
 
 
 
index 292424e3f7a08f46f0aa44519c8bb708298881a4..38add8a3e4f4c8b502ad1ad11228cc0c407c3ba7 100644 (file)
@@ -1,8 +1,8 @@
-// A Bison parser, made by GNU Bison 3.5.1.
+// A Bison parser, made by GNU Bison 3.0.4.
 
 // Skeleton implementation for Bison GLR parsers in C
 
-// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
+// Copyright (C) 2002-2015 Free Software Foundation, Inc.
 
 // This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 
 /* C GLR parser skeleton written by Paul Hilfinger.  */
 
-// Undocumented macros, especially those whose name start with YY_,
-// are private implementation details.  Do not rely on them.
-
 /* Identify Bison output.  */
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "3.5.1"
+#define YYBISON_VERSION "3.0.4"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "glr.cc"
@@ -52,8 +49,8 @@
 
 
 
-// First part of user prologue.
-#line 1 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
+/* First part of user declarations.  */
+#line 1 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:240
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -76,26 +73,13 @@ int yylex(yy::parser::semantic_type *, yy::parser::location_type *, void *);
 #define lex_scanner ps->Scanner()
 
 
-#line 80 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 77 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:240
 
-# ifndef YY_CAST
-#  ifdef __cplusplus
-#   define YY_CAST(Type, Val) static_cast<Type> (Val)
-#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
-#  else
-#   define YY_CAST(Type, Val) ((Type) (Val))
-#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
-#  endif
-# endif
 # ifndef YY_NULLPTR
-#  if defined __cplusplus
-#   if 201103L <= __cplusplus
-#    define YY_NULLPTR nullptr
-#   else
-#    define YY_NULLPTR 0
-#   endif
+#  if defined __cplusplus && 201103L <= __cplusplus
+#   define YY_NULLPTR nullptr
 #  else
-#   define YY_NULLPTR ((void*)0)
+#   define YY_NULLPTR 0
 #  endif
 # endif
 
@@ -120,73 +104,35 @@ static YYLTYPE yyloc_default
 # endif
 ;
 
-// Second part of user prologue.
-#line 125 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
-static void yyerror (const yy::parser::location_type *yylocationp, yy::parser& yyparser, tidl::Parser* ps, const char* msg);
-#line 127 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+/* Copy the second part of user declarations.  */
+#line 109 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:263
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+   If N is 0, then set CURRENT to the empty location which ends
+   the previous symbol: RHS[0] (always defined).  */
 
+# ifndef YYLLOC_DEFAULT
+#  define YYLLOC_DEFAULT(Current, Rhs, N)                               \
+    do                                                                  \
+      if (N)                                                            \
+        {                                                               \
+          (Current).begin  = YYRHSLOC (Rhs, 1).begin;                   \
+          (Current).end    = YYRHSLOC (Rhs, N).end;                     \
+        }                                                               \
+      else                                                              \
+        {                                                               \
+          (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;      \
+        }                                                               \
+    while (/*CONSTCOND*/ false)
+# endif
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc)
+static void yyerror (const yy::parser::location_type *yylocationp, yy::parser& yyparser, tidl::Parser* ps, const char* msg);
+#line 131 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:263
 
-#include <stddef.h>
-#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
-   <limits.h> and (if available) <stdint.h> are included
-   so that the code can choose integer types of a good width.  */
-
-#ifndef __PTRDIFF_MAX__
-# include <limits.h> /* INFRINGES ON USER NAME SPACE */
-# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
-#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
-#  define YY_STDINT_H
-# endif
-#endif
-
-/* Narrow types that promote to a signed type and that can represent a
-   signed or unsigned integer of at least N bits.  In tables they can
-   save space and decrease cache pressure.  Promoting to a signed type
-   helps avoid bugs in integer arithmetic.  */
-
-#ifdef __INT_LEAST8_MAX__
-typedef __INT_LEAST8_TYPE__ yytype_int8;
-#elif defined YY_STDINT_H
-typedef int_least8_t yytype_int8;
-#else
-typedef signed char yytype_int8;
-#endif
-
-#ifdef __INT_LEAST16_MAX__
-typedef __INT_LEAST16_TYPE__ yytype_int16;
-#elif defined YY_STDINT_H
-typedef int_least16_t yytype_int16;
-#else
-typedef short yytype_int16;
-#endif
-
-#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
-typedef __UINT_LEAST8_TYPE__ yytype_uint8;
-#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
-       && UINT_LEAST8_MAX <= INT_MAX)
-typedef uint_least8_t yytype_uint8;
-#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
-typedef unsigned char yytype_uint8;
-#else
-typedef short yytype_uint8;
-#endif
-
-#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
-typedef __UINT_LEAST16_TYPE__ yytype_uint16;
-#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
-       && UINT_LEAST16_MAX <= INT_MAX)
-typedef uint_least16_t yytype_uint16;
-#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
-typedef unsigned short yytype_uint16;
-#else
-typedef int yytype_uint16;
-#endif
-
 #ifndef YY_
 # if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
@@ -209,64 +155,48 @@ typedef int yytype_uint16;
 # define YYREALLOC realloc
 #endif
 
-#define YYSIZEMAX \
-  (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : YY_CAST (ptrdiff_t, SIZE_MAX))
+#define YYSIZEMAX ((size_t) -1)
 
 #ifdef __cplusplus
-  typedef bool yybool;
-# define yytrue true
-# define yyfalse false
+   typedef bool yybool;
 #else
-  /* When we move to stdbool, get rid of the various casts to yybool.  */
-  typedef signed char yybool;
-# define yytrue 1
-# define yyfalse 0
+   typedef unsigned char yybool;
 #endif
+#define yytrue 1
+#define yyfalse 0
 
 #ifndef YYSETJMP
 # include <setjmp.h>
 # define YYJMP_BUF jmp_buf
 # define YYSETJMP(Env) setjmp (Env)
-/* Pacify Clang and ICC.  */
-# define YYLONGJMP(Env, Val)                    \
- do {                                           \
-   longjmp (Env, Val);                          \
-   YY_ASSERT (0);                               \
- } while (yyfalse)
+/* Pacify clang.  */
+# define YYLONGJMP(Env, Val) (longjmp (Env, Val), YYASSERT (0))
 #endif
 
-#ifndef YY_ATTRIBUTE_PURE
-# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
-#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__                                               \
+      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
+     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
 # else
-#  define YY_ATTRIBUTE_PURE
+#  define YY_ATTRIBUTE(Spec) /* empty */
 # endif
 #endif
 
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
+#endif
+
 #ifndef YY_ATTRIBUTE_UNUSED
-# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
-#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
-# else
-#  define YY_ATTRIBUTE_UNUSED
-# endif
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
 #endif
 
-/* The _Noreturn keyword of C11.  */
-#ifndef _Noreturn
-# if (defined __cplusplus \
-      && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
-          || (defined _MSC_VER && 1900 <= _MSC_VER)))
-#  define _Noreturn [[noreturn]]
-# elif ((!defined __cplusplus || defined __clang__) \
-        && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0)  \
-            || 4 < __GNUC__ + (7 <= __GNUC_MINOR__)))
-   /* _Noreturn works as-is.  */
-# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
-#  define _Noreturn __attribute__ ((__noreturn__))
-# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
+#if !defined _Noreturn \
+     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
 #  define _Noreturn __declspec (noreturn)
 # else
-#  define _Noreturn
+#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
 # endif
 #endif
 
@@ -277,13 +207,13 @@ typedef int yytype_uint16;
 # define YYUSE(E) /* empty */
 #endif
 
-#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
-    _Pragma ("GCC diagnostic push")                                     \
-    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+    _Pragma ("GCC diagnostic push") \
+    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
     _Pragma ("GCC diagnostic pop")
 #else
 # define YY_INITIAL_VALUE(Value) Value
@@ -296,57 +226,39 @@ typedef int yytype_uint16;
 # define YY_INITIAL_VALUE(Value) /* Nothing. */
 #endif
 
-#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
-# define YY_IGNORE_USELESS_CAST_BEGIN                          \
-    _Pragma ("GCC diagnostic push")                            \
-    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
-# define YY_IGNORE_USELESS_CAST_END            \
-    _Pragma ("GCC diagnostic pop")
-#endif
-#ifndef YY_IGNORE_USELESS_CAST_BEGIN
-# define YY_IGNORE_USELESS_CAST_BEGIN
-# define YY_IGNORE_USELESS_CAST_END
-#endif
-
 
-#define YY_ASSERT(E) ((void) (0 && (E)))
+#ifndef YYASSERT
+# define YYASSERT(Condition) ((void) ((Condition) || (abort (), 0)))
+#endif
 
 /* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  19
+#define YYFINAL  23
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   388
+#define YYLAST   396
 
 /* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  37
+#define YYNTOKENS  39
 /* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  20
+#define YYNNTS  21
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  70
-/* YYNSTATES -- Number of states.  */
-#define YYNSTATES  135
+#define YYNRULES  73
+/* YYNRULES -- Number of states.  */
+#define YYNSTATES  139
 /* YYMAXRHS -- Maximum number of symbols on right-hand side of rule.  */
 #define YYMAXRHS 8
 /* YYMAXLEFT -- Maximum number of symbols to the left of a handle
    accessed by $0, $-1, etc., in any rule.  */
 #define YYMAXLEFT 0
 
-/* YYMAXUTOK -- Last valid token number (for yychar).  */
-#define YYMAXUTOK   291
-/* YYFAULTYTOK -- Token number (for yychar) that denotes a
-   syntax_error thrown from the scanner.  */
-#define YYFAULTYTOK (YYMAXUTOK + 1)
-/* YYUNDEFTOK -- Symbol number (for yytoken) that denotes an unknown
-   token.  */
+/* YYTRANSLATE(X) -- Bison symbol number corresponding to X.  */
 #define YYUNDEFTOK  2
+#define YYMAXUTOK   293
 
-/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
-   as returned by yylex, with out-of-bounds checking.  */
-#define YYTRANSLATE(YYX)                         \
-  (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+#define YYTRANSLATE(YYX)                                                \
+  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
-/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
-   as returned by yylex.  */
-static const yytype_int8 yytranslate[] =
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+static const unsigned char yytranslate[] =
 {
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -377,21 +289,21 @@ static const yytype_int8 yytranslate[] =
        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
-      35,    36
+      35,    36,    37,    38
 };
 
 #if YYDEBUG
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
-static const yytype_int16 yyrline[] =
-{
-       0,    96,    96,   101,   106,   120,   123,   128,   134,   139,
-     145,   152,   160,   171,   177,   182,   186,   190,   196,   204,
-     215,   221,   226,   232,   239,   245,   253,   258,   263,   270,
-     278,   289,   295,   308,   316,   331,   336,   341,   346,   350,
-     354,   358,   362,   368,   376,   387,   393,   396,   399,   404,
-     407,   411,   417,   420,   426,   429,   446,   449,   453,   457,
-     461,   465,   469,   473,   477,   487,   491,   495,   501,   508,
-     512
+static const unsigned short int yyrline[] =
+{
+       0,   100,   100,   105,   110,   124,   127,   130,   135,   148,
+     157,   163,   168,   174,   181,   189,   200,   206,   211,   215,
+     219,   225,   233,   244,   250,   255,   261,   268,   274,   282,
+     287,   292,   299,   307,   318,   324,   337,   345,   360,   365,
+     370,   375,   379,   383,   387,   391,   397,   405,   416,   422,
+     425,   428,   433,   436,   440,   446,   449,   455,   458,   475,
+     478,   482,   486,   490,   494,   498,   502,   506,   516,   520,
+     524,   530,   537,   541
 };
 #endif
 
@@ -403,213 +315,218 @@ static const char *const yytname[] =
   "$end", "error", "$undefined", "T_LEFT", "T_RIGHT", "T_COMMA",
   "T_SEMICOLON", "T_BRACE_OPEN", "T_BRACE_CLOSE", "T_IN", "T_OUT", "T_REF",
   "T_ASYNC", "T_META_OPEN", "T_META_CLOSE", "T_EQUAL", "T_DELEGATE",
-  "T_UNKNOWN", "T_ID", "T_STRUCTURE", "T_INTERFACE", "T_CHAR", "T_SHORT",
-  "T_INT", "T_LONG", "T_FLOAT", "T_DOUBLE", "T_VOID", "T_BUNDLE",
-  "T_STRING", "T_BOOL", "T_LIST", "T_ARRAY", "T_VALUE", "T_SB_OPEN",
-  "T_SB_CLOSE", "T_FILE", "$accept", "start", "blocks", "block",
-  "structure_block", "elements", "element", "attributes", "attribute",
-  "interface_block", "declarations", "declaration", "parameter_list",
-  "direction_specifier", "parameter", "parameter_type", "base_type",
-  "raw_type", "container_type", "container_type_name", YY_NULLPTR
+  "T_UNKNOWN", "T_ID", "T_NUMBER", "T_STRUCTURE", "T_INTERFACE", "T_CHAR",
+  "T_SHORT", "T_INT", "T_LONG", "T_FLOAT", "T_DOUBLE", "T_VOID",
+  "T_BUNDLE", "T_STRING", "T_BOOL", "T_LIST", "T_ARRAY", "T_VALUE",
+  "T_SB_OPEN", "T_SB_CLOSE", "T_FILE", "T_PROTOCOL", "$accept", "start",
+  "blocks", "block", "protocol_block", "structure_block", "elements",
+  "element", "attributes", "attribute", "interface_block", "declarations",
+  "declaration", "parameter_list", "direction_specifier", "parameter",
+  "parameter_type", "base_type", "raw_type", "container_type",
+  "container_type_name", YY_NULLPTR
 };
 #endif
 
-#define YYPACT_NINF (-67)
-#define YYTABLE_NINF (-58)
+#define YYPACT_NINF -70
+#define YYTABLE_NINF -61
 
   // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   // STATE-NUM.
-static const yytype_int16 yypact[] =
-{
-      -4,    24,    45,    21,    10,    -4,   -67,   -67,   -67,    69,
-     296,     5,    87,   336,    13,   -67,    49,     6,   -67,   -67,
-     -67,   296,   -67,   -67,   -67,   -67,   -67,   -67,   -67,   -67,
-     -67,   -67,   -67,   -67,   -67,   -67,   -67,   217,   -67,    20,
-     -67,     4,   296,   336,   -67,    42,   -67,    89,   -67,    52,
-     -67,   336,    14,     2,    33,    34,   249,    51,   -67,   -67,
-      65,   -67,    67,   352,   281,   121,    85,    57,    93,   117,
-     -67,   -67,   118,    57,    98,   153,   -67,   -67,   -67,   -67,
-     108,   -67,   -67,   -67,   -67,   113,   -67,   -67,   -67,   -67,
-     -67,   -67,   -67,   110,    95,   352,   -67,   112,   -67,    57,
-     -67,   -67,    99,    57,   -67,   124,   -67,     7,   320,   -67,
-     -67,   101,   126,   104,   336,   127,   128,   -67,    53,   -67,
-      86,   185,   -67,   -67,   -67,   129,   130,   -67,   131,   132,
-     -67,   -67,   -67,   -67,   -67
+static const short int yypact[] =
+{
+      -9,    15,    39,    43,     2,    14,    -9,   -70,   -70,   -70,
+     -70,    47,   302,    10,    62,   343,    45,   -70,    48,     5,
+     -70,   -70,   -70,   -70,   -70,   302,   -70,   -70,   -70,   -70,
+     -70,   -70,   -70,   -70,   -70,   -70,   -70,   -70,   -70,   -70,
+     -70,   220,   -70,    24,   -70,    54,   302,   343,   -70,    44,
+     -70,    88,   -70,    50,   -70,   343,    37,     3,    72,    77,
+     253,    94,   -70,   -70,    96,   -70,   117,   359,   286,   121,
+     118,    55,   106,   120,   -70,   -70,   122,    55,   124,   154,
+     -70,   -70,   -70,   -70,   112,   -70,   -70,   -70,   -70,   119,
+     -70,   -70,   -70,   -70,   -70,   -70,   -70,   113,    71,   359,
+     -70,   114,   -70,    55,   -70,   -70,    90,    55,   -70,   127,
+     -70,     7,   327,   -70,   -70,   100,   129,   103,   343,   130,
+     131,   -70,    85,   -70,    87,   187,   -70,   -70,   -70,   132,
+     134,   -70,   135,   136,   -70,   -70,   -70,   -70,   -70
 };
 
   // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
   // Performed when YYTABLE does not specify something else to do.  Zero
   // means the default is an error.
-static const yytype_int8 yydefact[] =
-{
-       0,     0,     0,     0,     0,     2,     3,     6,     5,     0,
-       0,     0,     0,     0,     0,    20,     0,     0,    18,     1,
-       4,     0,    10,    17,    67,    58,    59,    60,    61,    62,
-      63,    57,    64,    65,    66,    69,    70,     0,    11,     0,
-      56,     0,     0,     0,    28,     0,    55,     0,    29,     0,
-      54,     0,     0,     0,     0,     0,     0,    17,     8,    12,
-       0,    15,     0,     0,     0,     0,     0,     0,     0,     0,
-      26,    30,     0,     0,     0,     0,    22,    23,    21,    19,
-       0,     9,    13,    16,    14,     0,     7,    27,    42,    45,
-      46,    47,    48,    50,     0,     0,    43,     0,    52,     0,
-      31,    41,     0,     0,    24,     0,    68,     0,    49,    53,
-      51,     0,     0,     0,     0,     0,     0,    44,     0,    38,
-       0,     0,    39,    40,    37,     0,     0,    32,     0,     0,
-      25,    33,    34,    35,    36
+static const unsigned char yydefact[] =
+{
+       0,     0,     0,     0,     0,     0,     2,     3,     7,     6,
+       5,     0,     0,     0,     0,     0,     0,    23,     0,     0,
+      21,     9,     8,     1,     4,     0,    13,    20,    70,    61,
+      62,    63,    64,    65,    66,    60,    67,    68,    69,    72,
+      73,     0,    14,     0,    59,     0,     0,     0,    31,     0,
+      58,     0,    32,     0,    57,     0,     0,     0,     0,     0,
+       0,    20,    11,    15,     0,    18,     0,     0,     0,     0,
+       0,     0,     0,     0,    29,    33,     0,     0,     0,     0,
+      25,    26,    24,    22,     0,    12,    16,    19,    17,     0,
+      10,    30,    45,    48,    49,    50,    51,    53,     0,     0,
+      46,     0,    55,     0,    34,    44,     0,     0,    27,     0,
+      71,     0,    52,    56,    54,     0,     0,     0,     0,     0,
+       0,    47,     0,    41,     0,     0,    42,    43,    40,     0,
+       0,    35,     0,     0,    28,    36,    37,    38,    39
 };
 
   // YYPGOTO[NTERM-NUM].
-static const yytype_int16 yypgoto[] =
+static const short int yypgoto[] =
 {
-     -67,   -67,   -67,   135,   -67,   -15,   -32,   -67,   102,   -67,
-     -42,   -47,   -66,   -67,    47,   -67,   -59,    -8,   -67,   -67
+     -70,   -70,   -70,   150,   -70,   -70,   -19,   -36,   -70,    99,
+     -70,   -46,   -51,   -69,   -70,    49,   -70,   -64,   -10,   -70,
+     -70
 };
 
   // YYDEFGOTO[NTERM-NUM].
-static const yytype_int8 yydefgoto[] =
+static const signed char yydefgoto[] =
 {
-      -1,     4,     5,     6,     7,    37,    38,    17,    18,     8,
-      47,    48,    94,    95,    96,    97,    49,    50,    40,    41
+      -1,     5,     6,     7,     8,     9,    41,    42,    19,    20,
+      10,    51,    52,    98,    99,   100,   101,    53,    54,    44,
+      45
 };
 
   // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
   // positive, shift that token.  If negative, reduce the rule whose
   // number is the opposite.  If YYTABLE_NINF, syntax error.
-static const yytype_int16 yytable[] =
-{
-      71,    65,    39,    77,    85,    59,    56,   102,    98,    75,
-      19,    54,    42,    39,    98,     1,     2,    63,    71,   115,
-      51,    60,    15,   116,    59,     9,    61,    64,    71,    39,
-       3,    10,    59,   111,    39,    78,   109,   113,    62,    16,
-      98,    55,    11,    66,    98,    67,    12,    76,    39,    98,
-      52,    16,    13,    72,    80,    73,    39,    82,    89,   124,
-      68,   -49,   -49,    14,    53,   125,    90,    91,    92,   126,
-      74,    83,   121,    84,    71,    24,    21,    22,    25,    26,
-      27,    28,    29,    30,    93,    32,    33,    34,    35,    36,
-      69,    88,   127,    46,    43,    44,    99,    70,   128,   107,
-     108,   103,   129,   112,   108,   118,   108,    24,   120,   108,
-      25,    26,    27,    28,    29,    30,    45,    32,    33,    34,
-      35,    36,    69,   100,   101,    46,   105,   106,   -57,    87,
-     110,   114,   119,   122,   123,   131,   132,   133,   134,    24,
-      20,     0,    25,    26,    27,    28,    29,    30,    45,    32,
-      33,    34,    35,    36,    69,   117,    79,    46,     0,     0,
-       0,   104,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,    24,     0,     0,    25,    26,    27,    28,    29,    30,
-      45,    32,    33,    34,    35,    36,    69,     0,     0,    46,
-       0,     0,     0,   130,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,    24,     0,     0,    25,    26,    27,    28,
-      29,    30,    45,    32,    33,    34,    35,    36,    57,     0,
-       0,    46,     0,     0,     0,    58,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,    24,     0,     0,    25,    26,
-      27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-      57,     0,     0,     0,     0,     0,     0,    81,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,    24,     0,     0,
-      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
-      35,    36,    57,     0,     0,     0,     0,     0,     0,    86,
-       0,     0,     0,     0,     0,     0,     0,    23,     0,    24,
-       0,     0,    25,    26,    27,    28,    29,    30,    31,    32,
-      33,    34,    35,    36,    24,     0,     0,    25,    26,    27,
-      28,    29,    30,    31,    32,    33,    34,    35,    36,    90,
-      91,    92,     0,     0,     0,     0,     0,     0,    24,     0,
-       0,    25,    26,    27,    28,    29,    30,    93,    32,    33,
-      34,    35,    36,     0,    24,     0,    46,    25,    26,    27,
-      28,    29,    30,    45,    32,    33,    34,    35,    36,     0,
-      24,     0,    46,    25,    26,    27,    28,    29,    30,    31,
-      32,    33,    34,    35,    36,     0,     0,     0,    46
+static const short int yytable[] =
+{
+      75,    69,    43,    89,    81,    63,    60,   102,   106,    79,
+      58,     1,     2,   102,    23,    43,    11,    46,    75,   119,
+      21,    22,    12,   120,    63,    64,     3,    68,    75,     4,
+      65,    43,    63,    13,   115,   113,    43,    82,   117,   102,
+      14,    59,    66,   102,    17,    70,    15,    71,   102,    56,
+      43,    76,    55,    77,    25,    26,    93,    16,    43,   -52,
+     -52,    18,    72,    57,    94,    95,    96,    67,    78,    47,
+      48,    80,   125,    28,    75,   111,   112,    29,    30,    31,
+      32,    33,    34,    97,    36,    37,    38,    39,    40,    73,
+      18,   128,    50,   131,   116,   112,    74,   129,    84,   132,
+      86,   130,    87,   133,   122,   112,    28,   124,   112,   103,
+      29,    30,    31,    32,    33,    34,    49,    36,    37,    38,
+      39,    40,    73,    88,    92,    50,   104,   107,   105,    91,
+     109,   -60,   114,   110,   118,   123,   126,   127,   135,    28,
+     136,   137,   138,    29,    30,    31,    32,    33,    34,    49,
+      36,    37,    38,    39,    40,    73,    24,    83,    50,     0,
+       0,   121,   108,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,    28,     0,     0,     0,    29,    30,    31,    32,
+      33,    34,    49,    36,    37,    38,    39,    40,    73,     0,
+       0,    50,     0,     0,     0,   134,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,    28,     0,     0,     0,    29,
+      30,    31,    32,    33,    34,    49,    36,    37,    38,    39,
+      40,    61,     0,     0,    50,     0,     0,     0,    62,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,    28,     0,
+       0,     0,    29,    30,    31,    32,    33,    34,    35,    36,
+      37,    38,    39,    40,    61,     0,     0,     0,     0,     0,
+       0,    85,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,    28,     0,     0,     0,    29,    30,    31,    32,    33,
+      34,    35,    36,    37,    38,    39,    40,    61,     0,     0,
+       0,     0,     0,     0,    90,     0,     0,     0,     0,     0,
+       0,     0,     0,    27,    28,     0,     0,     0,    29,    30,
+      31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
+      28,     0,     0,     0,    29,    30,    31,    32,    33,    34,
+      35,    36,    37,    38,    39,    40,    94,    95,    96,     0,
+       0,     0,     0,     0,     0,    28,     0,     0,     0,    29,
+      30,    31,    32,    33,    34,    97,    36,    37,    38,    39,
+      40,    28,     0,     0,    50,    29,    30,    31,    32,    33,
+      34,    49,    36,    37,    38,    39,    40,    28,     0,     0,
+      50,    29,    30,    31,    32,    33,    34,    35,    36,    37,
+      38,    39,    40,     0,     0,     0,    50
 };
 
-static const yytype_int8 yycheck[] =
-{
-      47,    43,    10,     1,    63,    37,    21,    73,    67,    51,
-       0,     5,     7,    21,    73,    19,    20,    13,    65,    12,
-       7,     1,     1,    16,    56,     1,     6,    42,    75,    37,
-      34,     7,    64,    99,    42,    33,    95,   103,    18,    18,
-      99,    35,    18,     1,   103,     3,     1,    33,    56,   108,
-       1,    18,     7,     1,    20,     3,    64,     6,     1,     6,
-      18,     4,     5,    18,    15,    12,     9,    10,    11,    16,
-      18,     6,   114,     6,   121,    18,     7,     8,    21,    22,
+static const signed char yycheck[] =
+{
+      51,    47,    12,    67,     1,    41,    25,    71,    77,    55,
+       5,    20,    21,    77,     0,    25,     1,     7,    69,    12,
+      18,    19,     7,    16,    60,     1,    35,    46,    79,    38,
+       6,    41,    68,    18,   103,    99,    46,    34,   107,   103,
+       1,    36,    18,   107,     1,     1,     7,     3,   112,     1,
+      60,     1,     7,     3,     7,     8,     1,    18,    68,     4,
+       5,    18,    18,    15,     9,    10,    11,    13,    18,     7,
+       8,    34,   118,    18,   125,     4,     5,    22,    23,    24,
+      25,    26,    27,    28,    29,    30,    31,    32,    33,     1,
+      18,     6,    37,     6,     4,     5,     8,    12,    21,    12,
+       6,    16,     6,    16,     4,     5,    18,     4,     5,     3,
+      22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
+      32,    33,     1,     6,     6,    37,     6,     3,     6,     8,
+      18,    18,    18,    14,     7,     6,     6,     6,     6,    18,
+       6,     6,     6,    22,    23,    24,    25,    26,    27,    28,
+      29,    30,    31,    32,    33,     1,     6,    58,    37,    -1,
+      -1,   112,     8,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    18,    -1,    -1,    -1,    22,    23,    24,    25,
+      26,    27,    28,    29,    30,    31,    32,    33,     1,    -1,
+      -1,    37,    -1,    -1,    -1,     8,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    18,    -1,    -1,    -1,    22,
       23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
-       1,     6,     6,    36,     7,     8,     3,     8,    12,     4,
-       5,     3,    16,     4,     5,     4,     5,    18,     4,     5,
-      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
-      31,    32,     1,     6,     6,    36,    18,    14,    18,     8,
-      18,     7,     6,     6,     6,     6,     6,     6,     6,    18,
-       5,    -1,    21,    22,    23,    24,    25,    26,    27,    28,
-      29,    30,    31,    32,     1,   108,    54,    36,    -1,    -1,
+      33,     1,    -1,    -1,    37,    -1,    -1,    -1,     8,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    18,    -1,
+      -1,    -1,    22,    23,    24,    25,    26,    27,    28,    29,
+      30,    31,    32,    33,     1,    -1,    -1,    -1,    -1,    -1,
       -1,     8,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    18,    -1,    -1,    21,    22,    23,    24,    25,    26,
-      27,    28,    29,    30,    31,    32,     1,    -1,    -1,    36,
-      -1,    -1,    -1,     8,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    18,    -1,    -1,    21,    22,    23,    24,
-      25,    26,    27,    28,    29,    30,    31,    32,     1,    -1,
-      -1,    36,    -1,    -1,    -1,     8,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    18,    -1,    -1,    21,    22,
+      -1,    18,    -1,    -1,    -1,    22,    23,    24,    25,    26,
+      27,    28,    29,    30,    31,    32,    33,     1,    -1,    -1,
+      -1,    -1,    -1,    -1,     8,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,     1,    18,    -1,    -1,    -1,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
+      18,    -1,    -1,    -1,    22,    23,    24,    25,    26,    27,
+      28,    29,    30,    31,    32,    33,     9,    10,    11,    -1,
+      -1,    -1,    -1,    -1,    -1,    18,    -1,    -1,    -1,    22,
       23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
-       1,    -1,    -1,    -1,    -1,    -1,    -1,     8,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    18,    -1,    -1,
-      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
-      31,    32,     1,    -1,    -1,    -1,    -1,    -1,    -1,     8,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,     1,    -1,    18,
-      -1,    -1,    21,    22,    23,    24,    25,    26,    27,    28,
-      29,    30,    31,    32,    18,    -1,    -1,    21,    22,    23,
-      24,    25,    26,    27,    28,    29,    30,    31,    32,     9,
-      10,    11,    -1,    -1,    -1,    -1,    -1,    -1,    18,    -1,
-      -1,    21,    22,    23,    24,    25,    26,    27,    28,    29,
-      30,    31,    32,    -1,    18,    -1,    36,    21,    22,    23,
-      24,    25,    26,    27,    28,    29,    30,    31,    32,    -1,
-      18,    -1,    36,    21,    22,    23,    24,    25,    26,    27,
-      28,    29,    30,    31,    32,    -1,    -1,    -1,    36
+      33,    18,    -1,    -1,    37,    22,    23,    24,    25,    26,
+      27,    28,    29,    30,    31,    32,    33,    18,    -1,    -1,
+      37,    22,    23,    24,    25,    26,    27,    28,    29,    30,
+      31,    32,    33,    -1,    -1,    -1,    37
 };
 
   // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
   // symbol of state STATE-NUM.
-static const yytype_int8 yystos[] =
-{
-       0,    19,    20,    34,    38,    39,    40,    41,    46,     1,
-       7,    18,     1,     7,    18,     1,    18,    44,    45,     0,
-      40,     7,     8,     1,    18,    21,    22,    23,    24,    25,
-      26,    27,    28,    29,    30,    31,    32,    42,    43,    54,
-      55,    56,     7,     7,     8,    27,    36,    47,    48,    53,
-      54,     7,     1,    15,     5,    35,    42,     1,     8,    43,
-       1,     6,    18,    13,    42,    47,     1,     3,    18,     1,
-       8,    48,     1,     3,    18,    47,    33,     1,    33,    45,
-      20,     8,     6,     6,     6,    53,     8,     8,     6,     1,
-       9,    10,    11,    27,    49,    50,    51,    52,    53,     3,
-       6,     6,    49,     3,     8,    18,    14,     4,     5,    53,
-      18,    49,     4,    49,     7,    12,    16,    51,     4,     6,
-       4,    47,     6,     6,     6,    12,    16,     6,    12,    16,
-       8,     6,     6,     6,     6
+static const unsigned char yystos[] =
+{
+       0,    20,    21,    35,    38,    40,    41,    42,    43,    44,
+      49,     1,     7,    18,     1,     7,    18,     1,    18,    47,
+      48,    18,    19,     0,    42,     7,     8,     1,    18,    22,
+      23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
+      33,    45,    46,    57,    58,    59,     7,     7,     8,    28,
+      37,    50,    51,    56,    57,     7,     1,    15,     5,    36,
+      45,     1,     8,    46,     1,     6,    18,    13,    45,    50,
+       1,     3,    18,     1,     8,    51,     1,     3,    18,    50,
+      34,     1,    34,    48,    21,     8,     6,     6,     6,    56,
+       8,     8,     6,     1,     9,    10,    11,    28,    52,    53,
+      54,    55,    56,     3,     6,     6,    52,     3,     8,    18,
+      14,     4,     5,    56,    18,    52,     4,    52,     7,    12,
+      16,    54,     4,     6,     4,    50,     6,     6,     6,    12,
+      16,     6,    12,    16,     8,     6,     6,     6,     6
 };
 
   // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
-static const yytype_int8 yyr1[] =
-{
-       0,    37,    38,    39,    39,    40,    40,    41,    41,    41,
-      41,    42,    42,    42,    43,    43,    43,    43,    44,    44,
-      44,    45,    45,    45,    46,    46,    46,    46,    46,    47,
-      47,    47,    48,    48,    48,    48,    48,    48,    48,    48,
-      48,    48,    48,    49,    49,    49,    50,    50,    50,    51,
-      51,    51,    52,    52,    53,    53,    54,    54,    54,    54,
-      54,    54,    54,    54,    54,    54,    54,    54,    55,    56,
-      56
+static const unsigned char yyr1[] =
+{
+       0,    39,    40,    41,    41,    42,    42,    42,    43,    43,
+      44,    44,    44,    44,    45,    45,    45,    46,    46,    46,
+      46,    47,    47,    47,    48,    48,    48,    49,    49,    49,
+      49,    49,    50,    50,    50,    51,    51,    51,    51,    51,
+      51,    51,    51,    51,    51,    51,    52,    52,    52,    53,
+      53,    53,    54,    54,    54,    55,    55,    56,    56,    57,
+      57,    57,    57,    57,    57,    57,    57,    57,    57,    57,
+      57,    58,    59,    59
 };
 
   // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
-static const yytype_int8 yyr2[] =
-{
-       0,     2,     1,     1,     2,     1,     1,     5,     4,     5,
-       3,     1,     2,     3,     3,     2,     3,     1,     1,     3,
-       1,     3,     3,     3,     5,     8,     4,     5,     3,     1,
-       2,     3,     6,     7,     7,     7,     7,     6,     5,     6,
-       6,     3,     3,     1,     3,     1,     1,     1,     1,     0,
-       1,     2,     1,     2,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     4,     1,
-       1
+static const unsigned char yyr2[] =
+{
+       0,     2,     1,     1,     2,     1,     1,     1,     2,     2,
+       5,     4,     5,     3,     1,     2,     3,     3,     2,     3,
+       1,     1,     3,     1,     3,     3,     3,     5,     8,     4,
+       5,     3,     1,     2,     3,     6,     7,     7,     7,     7,
+       6,     5,     6,     6,     3,     3,     1,     3,     1,     1,
+       1,     1,     0,     1,     2,     1,     2,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
+       1,     4,     1,     1
 };
 
 
 /* YYDPREC[RULE-NUM] -- Dynamic precedence of rule #RULE-NUM (0 if none).  */
-static const yytype_int8 yydprec[] =
+static const unsigned char yydprec[] =
 {
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
@@ -618,11 +535,11 @@ static const yytype_int8 yydprec[] =
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0
+       0,     0,     0,     0
 };
 
 /* YYMERGER[RULE-NUM] -- Index of merging function for rule #RULE-NUM.  */
-static const yytype_int8 yymerger[] =
+static const unsigned char yymerger[] =
 {
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
@@ -631,7 +548,7 @@ static const yytype_int8 yymerger[] =
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0
+       0,     0,     0,     0
 };
 
 /* YYIMMEDIATE[RULE-NUM] -- True iff rule #RULE-NUM is not to be deferred, as
@@ -645,14 +562,14 @@ static const yybool yyimmediate[] =
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0
+       0,     0,     0,     0
 };
 
 /* YYCONFLP[YYPACT[STATE-NUM]] -- Pointer into YYCONFL of start of
    list of conflicting reductions corresponding to action entry for
    state STATE-NUM in yytable.  0 means no conflicts.  The list in
    yyconfl is terminated by a rule number of 0.  */
-static const yytype_int8 yyconflp[] =
+static const unsigned char yyconflp[] =
 {
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
@@ -692,12 +609,13 @@ static const yytype_int8 yyconflp[] =
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0
 };
 
 /* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by
    0, pointed into by YYCONFLP.  */
-static const short yyconfl[] =
+static const short int yyconfl[] =
 {
        0
 };
@@ -722,7 +640,7 @@ static const short yyconfl[] =
         {                                                               \
           (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;      \
         }                                                               \
-    while (false)
+    while (/*CONSTCOND*/ false)
 # endif
 
 # define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc)
@@ -757,25 +675,6 @@ typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG;
 #  define YYFPRINTF fprintf
 # endif
 
-# define YY_FPRINTF                             \
-  YY_IGNORE_USELESS_CAST_BEGIN YY_FPRINTF_
-
-# define YY_FPRINTF_(Args)                      \
-  do {                                          \
-    YYFPRINTF Args;                             \
-    YY_IGNORE_USELESS_CAST_END                  \
-  } while (0)
-
-# define YY_DPRINTF                             \
-  YY_IGNORE_USELESS_CAST_BEGIN YY_DPRINTF_
-
-# define YY_DPRINTF_(Args)                      \
-  do {                                          \
-    if (yydebug)                                \
-      YYFPRINTF Args;                           \
-    YY_IGNORE_USELESS_CAST_END                  \
-  } while (0)
-
 
 /* YY_LOCATION_PRINT -- Print the location on the stream.
    This macro was not mandated originally: define only if we know
@@ -787,10 +686,10 @@ typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG;
 /* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
 
 YY_ATTRIBUTE_UNUSED
-static int
+static unsigned
 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
 {
-  int res = 0;
+  unsigned res = 0;
   int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
   if (0 <= yylocp->first_line)
     {
@@ -821,6 +720,12 @@ yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
 #endif
 
 
+# define YYDPRINTF(Args)                        \
+  do {                                          \
+    if (yydebug)                                \
+      YYFPRINTF Args;                           \
+  } while (0)
+
 
 /*--------------------.
 | Print this symbol.  |
@@ -839,9 +744,9 @@ yy_symbol_print (FILE *, int yytype, const yy::parser::semantic_type *yyvaluep,
   do {                                                                  \
     if (yydebug)                                                        \
       {                                                                 \
-        YY_FPRINTF ((stderr, "%s ", Title));                            \
+        YYFPRINTF (stderr, "%s ", Title);                               \
         yy_symbol_print (stderr, Type, Value, Location, yyparser, ps);        \
-        YY_FPRINTF ((stderr, "\n"));                                    \
+        YYFPRINTF (stderr, "\n");                                       \
       }                                                                 \
   } while (0)
 
@@ -850,14 +755,14 @@ yy_symbol_print (FILE *, int yytype, const yy::parser::semantic_type *yyvaluep,
 int yydebug;
 
 struct yyGLRStack;
-static void yypstack (struct yyGLRStack* yystackp, ptrdiff_t yyk)
+static void yypstack (struct yyGLRStack* yystackp, size_t yyk)
   YY_ATTRIBUTE_UNUSED;
 static void yypdumpstack (struct yyGLRStack* yystackp)
   YY_ATTRIBUTE_UNUSED;
 
 #else /* !YYDEBUG */
 
-# define YY_DPRINTF(Args) do {} while (yyfalse)
+# define YYDPRINTF(Args)
 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 
 #endif /* !YYDEBUG */
@@ -934,12 +839,12 @@ yystpcpy (char *yydest, const char *yysrc)
    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
    null, do not copy; instead, return the length of what the result
    would have been.  */
-static ptrdiff_t
+static size_t
 yytnamerr (char *yyres, const char *yystr)
 {
   if (*yystr == '"')
     {
-      ptrdiff_t yyn = 0;
+      size_t yyn = 0;
       char const *yyp = yystr;
 
       for (;;)
@@ -952,10 +857,7 @@ yytnamerr (char *yyres, const char *yystr)
           case '\\':
             if (*++yyp != '\\')
               goto do_not_strip_quotes;
-            else
-              goto append;
-
-          append:
+            /* Fall through.  */
           default:
             if (yyres)
               yyres[yyn] = *yyp;
@@ -970,26 +872,26 @@ yytnamerr (char *yyres, const char *yystr)
     do_not_strip_quotes: ;
     }
 
-  if (yyres)
-    return yystpcpy (yyres, yystr) - yyres;
-  else
-    return YY_CAST (ptrdiff_t, strlen (yystr));
+  if (yyres)
+    return strlen (yystr);
+
+  return yystpcpy (yyres, yystr) - yyres;
 }
 # endif
 
 #endif /* !YYERROR_VERBOSE */
 
-/** State numbers. */
+/** State numbers, as in LALR(1) machine */
 typedef int yyStateNum;
 
-/** Rule numbers. */
+/** Rule numbers, as in LALR(1) machine */
 typedef int yyRuleNum;
 
-/** Grammar symbol. */
+/** Grammar symbol */
 typedef int yySymbol;
 
-/** Item references. */
-typedef short yyItemNum;
+/** Item references, as in LALR(1) machine */
+typedef short int yyItemNum;
 
 typedef struct yyGLRState yyGLRState;
 typedef struct yyGLRStateSet yyGLRStateSet;
@@ -1008,10 +910,10 @@ struct yyGLRState {
   /** Preceding state in this stack */
   yyGLRState* yypred;
   /** Source position of the last token produced by my symbol */
-  ptrdiff_t yyposn;
+  size_t yyposn;
   union {
     /** First in a chain of alternative reductions producing the
-     *  nonterminal corresponding to this state, threaded through
+     *  non-terminal corresponding to this state, threaded through
      *  yynext.  */
     yySemanticOption* yyfirstVal;
     /** Semantic value for this state.  */
@@ -1028,8 +930,7 @@ struct yyGLRStateSet {
    *  operation, yylookaheadNeeds[0] is not maintained since it would merely
    *  duplicate yychar != YYEMPTY.  */
   yybool* yylookaheadNeeds;
-  ptrdiff_t yysize;
-  ptrdiff_t yycapacity;
+  size_t yysize, yycapacity;
 };
 
 struct yySemanticOption {
@@ -1068,7 +969,7 @@ struct yyGLRStack {
   YYJMP_BUF yyexception_buffer;
   yyGLRStackItem* yyitems;
   yyGLRStackItem* yynextFree;
-  ptrdiff_t yyspaceLeft;
+  size_t yyspaceLeft;
   yyGLRState* yysplitPoint;
   yyGLRState* yylastDeleted;
   yyGLRStateSet yytops;
@@ -1078,7 +979,7 @@ struct yyGLRStack {
 static void yyexpandGLRStack (yyGLRStack* yystackp);
 #endif
 
-_Noreturn static void
+static _Noreturn void
 yyFail (yyGLRStack* yystackp, YYLTYPE *yylocp, yy::parser& yyparser, tidl::Parser* ps, const char* yymsg)
 {
   if (yymsg != YY_NULLPTR)
@@ -1086,7 +987,7 @@ yyFail (yyGLRStack* yystackp, YYLTYPE *yylocp, yy::parser& yyparser, tidl::Parse
   YYLONGJMP (yystackp->yyexception_buffer, 1);
 }
 
-_Noreturn static void
+static _Noreturn void
 yyMemoryExhausted (yyGLRStack* yystackp)
 {
   YYLONGJMP (yystackp->yyexception_buffer, 2);
@@ -1097,7 +998,10 @@ yyMemoryExhausted (yyGLRStack* yystackp)
 static inline const char*
 yytokenName (yySymbol yytoken)
 {
-  return yytoken == YYEMPTY ? "" : yytname[yytoken];
+  if (yytoken == YYEMPTY)
+    return "";
+
+  return yytname[yytoken];
 }
 #endif
 
@@ -1127,49 +1031,6 @@ yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
     }
 }
 
-
-/** If yychar is empty, fetch the next token.  */
-static inline yySymbol
-yygetToken (int *yycharp, yyGLRStack* yystackp, yy::parser& yyparser, tidl::Parser* ps)
-{
-  yySymbol yytoken;
-  YYUSE (yyparser);
-  YYUSE (ps);
-  if (*yycharp == YYEMPTY)
-    {
-      YY_DPRINTF ((stderr, "Reading a token: "));
-#if YY_EXCEPTIONS
-      try
-        {
-#endif // YY_EXCEPTIONS
-          *yycharp = yylex (&yylval, &yylloc, lex_scanner);
-#if YY_EXCEPTIONS
-        }
-      catch (const yy::parser::syntax_error& yyexc)
-        {
-          YY_DPRINTF ((stderr, "Caught exception: %s\n", yyexc.what()));
-          yylloc = yyexc.location;
-          yyerror (&yylloc, yyparser, ps, yyexc.what ());
-          // Map errors caught in the scanner to the undefined token
-          // (YYUNDEFTOK), so that error handling is started.
-          // However, record this with this special value of yychar.
-          *yycharp = YYFAULTYTOK;
-        }
-#endif // YY_EXCEPTIONS
-    }
-  if (*yycharp <= YYEOF)
-    {
-      *yycharp = yytoken = YYEOF;
-      YY_DPRINTF ((stderr, "Now at end of input.\n"));
-    }
-  else
-    {
-      yytoken = YYTRANSLATE (*yycharp);
-      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
-    }
-  return yytoken;
-}
-
 /* Do nothing if YYNORMAL or if *YYLOW <= YYLOW1.  Otherwise, fill in
  * YYVSP[YYLOW1 .. *YYLOW-1] as in yyfillin and set *YYLOW = YYLOW1.
  * For convenience, always return YYLOW1.  */
@@ -1192,11 +1053,11 @@ yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal)
  *  (@$).  Returns yyok for normal return, yyaccept for YYACCEPT,
  *  yyerr for YYERROR, yyabort for YYABORT.  */
 static YYRESULTTAG
-yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
+yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp,
               yyGLRStack* yystackp,
               YYSTYPE* yyvalp, YYLTYPE *yylocp, yy::parser& yyparser, tidl::Parser* ps)
 {
-  yybool yynormal YY_ATTRIBUTE_UNUSED = yystackp->yysplitPoint == YY_NULLPTR;
+  yybool yynormal YY_ATTRIBUTE_UNUSED = (yystackp->yysplitPoint == YY_NULLPTR);
   int yylow;
   YYUSE (yyvalp);
   YYUSE (yylocp);
@@ -1216,7 +1077,7 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
 # undef yyclearin
 # define yyclearin (yychar = YYEMPTY)
 # undef YYFILL
-# define YYFILL(N) yyfill (yyvsp, &yylow, (N), yynormal)
+# define YYFILL(N) yyfill (yyvsp, &yylow, N, yynormal)
 # undef YYBACKUP
 # define YYBACKUP(Token, Value)                                              \
   return yyerror (yylocp, yyparser, ps, YY_("syntax error: cannot back up")),     \
@@ -1227,761 +1088,782 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
     *yyvalp = yyval_default;
   else
     *yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval;
-  /* Default location. */
   YYLLOC_DEFAULT ((*yylocp), (yyvsp - yyrhslen), yyrhslen);
   yystackp->yyerror_range[1].yystate.yyloc = *yylocp;
 
-#if YY_EXCEPTIONS
-  typedef yy::parser::syntax_error syntax_error;
-  try
-  {
-#endif // YY_EXCEPTIONS
   switch (yyn)
     {
-  case 2:
-#line 96 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-              {
-     ps->SetDoc((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.doc));
+        case 2:
+#line 100 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+     ps->SetDoc((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.doc));
   }
-#line 1247 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1102 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 3:
-#line 101 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-              {
+#line 105 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
     ((*yyvalp).doc) = new tidl::Document();
-    if ((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk) != NULL)
-      ((*yyvalp).doc)->AddBlock((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk));
+    if ((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk) != NULL)
+      ((*yyvalp).doc)->AddBlock((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk));
   }
-#line 1257 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1112 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 4:
-#line 106 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                 {
-    ((*yyvalp).doc) = (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.doc);
-
-    if ((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk) != NULL) {
-      if (((*yyvalp).doc)->ExistBlock((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk))) {
-        ps->ReportError("syntax error. \"Already Exists\".", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk)->GetLine());
-        delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk);
+#line 110 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).doc) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.doc);
+
+    if ((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk) != NULL) {
+      if (((*yyvalp).doc)->ExistBlock((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk))) {
+        ps->ReportError("syntax error. \"Already Exists\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk)->GetLine());
+        delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk);
       } else {
-        ((*yyvalp).doc)->AddBlock((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk));
+        ((*yyvalp).doc)->AddBlock((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk));
       }
     }
   }
-#line 1274 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1129 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 5:
-#line 120 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                       {
-    ((*yyvalp).blk) = (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.interf);
+#line 124 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).blk) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.interf);
   }
-#line 1282 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1137 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 6:
-#line 123 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                    {
-    ((*yyvalp).blk) = (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.structure);
+#line 127 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).blk) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.structure);
   }
-#line 1290 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1145 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 7:
-#line 128 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                                      {
-    ((*yyvalp).structure) = new tidl::Structure((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->ToString(), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.elms), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token)->GetComments(),
-        (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yyloc).begin.line);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token);
+#line 130 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).blk) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.blk);
   }
-#line 1301 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1153 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 8:
-#line 134 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                    {
-    ps->ReportError("syntax error. \"No identifier\".", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line);
-    ((*yyvalp).structure) = NULL;
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token);
+#line 135 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    int ver = atoi((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->ToString().c_str());
+
+    if (ver < 1) {
+      ps->ReportError("syntax error in protocol version : " + (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->ToString(),
+        (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
+    } else {
+      ps->SetVersion(ver);
+    }
+    ((*yyvalp).blk) = NULL;
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
   }
-#line 1311 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1171 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 9:
-#line 139 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                          {
+#line 148 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in protocol version : " + (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->ToString(),
+        (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
+    ((*yyvalp).blk) = NULL;
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+  }
+#line 1183 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
+    break;
+
+  case 10:
+#line 157 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).structure) = new tidl::Structure((((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.elms), (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token)->GetComments(),
+        (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yyloc).begin.line);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token);
+  }
+#line 1194 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
+    break;
+
+  case 11:
+#line 163 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error. \"No identifier\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line);
+    ((*yyvalp).structure) = NULL;
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token);
+  }
+#line 1204 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
+    break;
+
+  case 12:
+#line 168 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
     ps->ReportError("syntax error. \"Please check it before an open brace.\"",
-        (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line);
+        (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line);
     ((*yyvalp).structure) = NULL;
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
   }
-#line 1322 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1215 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 10:
-#line 145 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                    {
-    ps->ReportError("syntax error in structure declaration.", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
+  case 13:
+#line 174 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in structure declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
     ((*yyvalp).structure) = NULL;
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token);
   }
-#line 1332 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1225 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 11:
-#line 152 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                  {
+  case 14:
+#line 181 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
     ((*yyvalp).elms) = new (std::nothrow) tidl::Elements();
     if (((*yyvalp).elms) != nullptr) {
-      if ((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm) != nullptr) {
-        ((*yyvalp).elms)->Add(std::unique_ptr<tidl::Element>((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm)));
+      if ((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm) != nullptr) {
+        ((*yyvalp).elms)->Add(std::unique_ptr<tidl::Element>((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm)));
       }
     }
   }
-#line 1345 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1238 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 12:
-#line 160 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                     {
-    ((*yyvalp).elms) = (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.elms);
-    if ((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm) != nullptr) {
-      if (((*yyvalp).elms)->Exist(*(YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm))) {
-        ps->ReportError("syntax error. \"Already Exists\".", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm)->GetLine());
-        delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm);
+  case 15:
+#line 189 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).elms) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.elms);
+    if ((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm) != nullptr) {
+      if (((*yyvalp).elms)->Exist(*(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm))) {
+        ps->ReportError("syntax error. \"Already Exists\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm)->GetLine());
+        delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm);
       } else {
-        ((*yyvalp).elms)->Add(std::unique_ptr<tidl::Element>((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm)));
+        ((*yyvalp).elms)->Add(std::unique_ptr<tidl::Element>((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.elm)));
       }
     }
   }
-#line 1361 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1254 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 13:
-#line 171 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                               {
-    ps->ReportError("syntax error in elements declarations.", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yyloc).begin.line);
-    ((*yyvalp).elms) = (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.elms);
+  case 16:
+#line 200 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in elements declarations.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yyloc).begin.line);
+    ((*yyvalp).elms) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.elms);
   }
-#line 1370 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1263 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 14:
-#line 177 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                   {
-    ((*yyvalp).elm) = new tidl::Element((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.token)->ToString(), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.b_type), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.b_type)->GetComments(),
-        (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yyloc).begin.line);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.token);
+  case 17:
+#line 206 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).elm) = new tidl::Element((((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.b_type), (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.b_type)->GetComments(),
+        (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yyloc).begin.line);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.token);
   }
-#line 1380 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1273 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 15:
-#line 182 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                         {
-    ps->ReportError("syntax error. \"No identifier\".", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
+  case 18:
+#line 211 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error. \"No identifier\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
     ((*yyvalp).elm) = NULL;
   }
-#line 1389 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1282 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 16:
-#line 186 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                               {
-    ps->ReportError("syntax error in element declaration.", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
+  case 19:
+#line 215 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in element declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
     ((*yyvalp).elm) = NULL;
   }
-#line 1398 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1291 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 17:
-#line 190 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-          {
-    ps->ReportError("syntax error in element declaration.", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
+  case 20:
+#line 219 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in element declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
     ((*yyvalp).elm) = NULL;
   }
-#line 1407 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1300 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 18:
-#line 196 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                      {
+  case 21:
+#line 225 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
     ((*yyvalp).attrs) = new (std::nothrow) tidl::Attributes();
     if (((*yyvalp).attrs) != nullptr) {
-      if ((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr) != nullptr) {
-        ((*yyvalp).attrs)->Add(std::unique_ptr<tidl::Attribute>((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr)));
+      if ((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr) != nullptr) {
+        ((*yyvalp).attrs)->Add(std::unique_ptr<tidl::Attribute>((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr)));
       }
     }
   }
-#line 1420 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1313 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 19:
-#line 204 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                 {
-    ((*yyvalp).attrs) = (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.attrs);
-    if ((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr) != nullptr) {
-      if (((*yyvalp).attrs)->Exist(*(YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr))) {
-        ps->ReportError("syntax error. \"Already Exist\".", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr)->GetLine());
-        delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr);
+  case 22:
+#line 233 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).attrs) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.attrs);
+    if ((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr) != nullptr) {
+      if (((*yyvalp).attrs)->Exist(*(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr))) {
+        ps->ReportError("syntax error. \"Already Exist\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr)->GetLine());
+        delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr);
       } else {
-        ((*yyvalp).attrs)->Add(std::unique_ptr<tidl::Attribute>((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr)));
+        ((*yyvalp).attrs)->Add(std::unique_ptr<tidl::Attribute>((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.attr)));
       }
     }
   }
-#line 1436 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1329 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 20:
-#line 215 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-          {
-    ps->ReportError("syntax error in attributes", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
+  case 23:
+#line 244 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in attributes", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
     ((*yyvalp).attrs) = new tidl::Attributes();
   }
-#line 1445 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1338 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 21:
-#line 221 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                {
-    ((*yyvalp).attr) = new tidl::Attribute((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token)->ToString(), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->ToString(), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yyloc).begin.line);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+  case 24:
+#line 250 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).attr) = new tidl::Attribute((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yyloc).begin.line);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
   }
-#line 1455 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1348 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 22:
-#line 226 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                        {
-    ps->ReportError("syntax error in attribute declaration.", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
+  case 25:
+#line 255 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in attribute declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
     ((*yyvalp).attr) = NULL;
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
   }
-#line 1466 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1359 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 23:
-#line 232 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                       {
-    ps->ReportError("syntax error in attribute declaration.", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
+  case 26:
+#line 261 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in attribute declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
     ((*yyvalp).attr) = NULL;
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token);
   }
-#line 1476 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1369 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 24:
-#line 239 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                                          {
-    ((*yyvalp).interf) = new tidl::Interface((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->ToString(), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.decls), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token)->GetComments(),
-        new tidl::Attributes(), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yyloc).begin.line);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token);
+  case 27:
+#line 268 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).interf) = new tidl::Interface((((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.decls), (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token)->GetComments(),
+        new tidl::Attributes(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yyloc).begin.line);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token);
   }
-#line 1487 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1380 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 25:
-#line 245 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                                                             {
-    ((*yyvalp).interf) = new tidl::Interface((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->ToString(), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.decls), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-7)].yystate.yysemantics.yysval.token)->GetComments(), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.attrs),
-        (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-7)].yystate.yyloc).begin.line);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-7)].yystate.yysemantics.yysval.token);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token);
+  case 28:
+#line 274 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).interf) = new tidl::Interface((((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.decls), (((yyGLRStackItem const *)yyvsp)[YYFILL (-7)].yystate.yysemantics.yysval.token)->GetComments(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.attrs),
+        (((yyGLRStackItem const *)yyvsp)[YYFILL (-7)].yystate.yyloc).begin.line);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-7)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token);
   }
-#line 1500 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1393 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 26:
-#line 253 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                        {
-    ps->ReportError("syntax error. \"No identifier\".", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line);
+  case 29:
+#line 282 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error. \"No identifier\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line);
     ((*yyvalp).interf) = NULL;
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token);
   }
-#line 1510 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1403 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 27:
-#line 258 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                              {
-    ps->ReportError("syntax error in interface declaration.", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line);
+  case 30:
+#line 287 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in interface declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line);
     ((*yyvalp).interf) = NULL;
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
   }
-#line 1520 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1413 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 28:
-#line 263 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                    {
-    ps->ReportError("syntax error in interface declaration.", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
+  case 31:
+#line 292 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in interface declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
     ((*yyvalp).interf) = NULL;
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.token);
   }
-#line 1530 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1423 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 29:
-#line 270 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                          {
+  case 32:
+#line 299 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
     ((*yyvalp).decls) = new (std::nothrow) tidl::Declarations();
     if (((*yyvalp).decls) != nullptr) {
-      if ((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl) != nullptr) {
-        ((*yyvalp).decls)->Add(std::unique_ptr<tidl::Declaration>((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl)));
+      if ((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl) != nullptr) {
+        ((*yyvalp).decls)->Add(std::unique_ptr<tidl::Declaration>((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl)));
       }
     }
   }
-#line 1543 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1436 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 30:
-#line 278 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                             {
-    ((*yyvalp).decls) = (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.decls);
-    if ((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl) != nullptr) {
-      if (((*yyvalp).decls)->Exist(*(YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl))) {
-        ps->ReportError("syntax error. \"Already Exists\".", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl)->GetLine());
-        delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl);
+  case 33:
+#line 307 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).decls) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.decls);
+    if ((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl) != nullptr) {
+      if (((*yyvalp).decls)->Exist(*(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl))) {
+        ps->ReportError("syntax error. \"Already Exists\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl)->GetLine());
+        delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl);
       } else {
-        ((*yyvalp).decls)->Add(std::unique_ptr<tidl::Declaration>((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl)));
+        ((*yyvalp).decls)->Add(std::unique_ptr<tidl::Declaration>((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.decl)));
       }
     }
   }
-#line 1559 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1452 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 31:
-#line 289 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                   {
-    ps->ReportError("syntax error in methods declaration.", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
-    ((*yyvalp).decls) = (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.decls);
+  case 34:
+#line 318 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in methods declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
+    ((*yyvalp).decls) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.decls);
   }
-#line 1568 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1461 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 32:
-#line 295 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                                      {
+  case 35:
+#line 324 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
     if (ps->IsGroupEnabled()) {
-      ps->ReportError("Group does not support 'sync' method type", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yyloc).begin.line);
+      ps->ReportError("Group does not support 'sync' method type", (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yyloc).begin.line);
       ((*yyvalp).decl) = NULL;
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
     } else {
-      ((*yyvalp).decl) = new tidl::Declaration((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token)->ToString(),
-          std::unique_ptr<tidl::BaseType>((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.b_type)),
-          std::unique_ptr<tidl::Parameters>((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.params)), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.b_type)->GetComments(),
-          (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yyloc).begin.line, tidl::Declaration::MethodType::SYNC);
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
+      ((*yyvalp).decl) = new tidl::Declaration((((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token)->ToString(),
+          std::unique_ptr<tidl::BaseType>((((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.b_type)),
+          std::unique_ptr<tidl::Parameters>((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.params)), (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.b_type)->GetComments(),
+          (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yyloc).begin.line, tidl::Declaration::MethodType::SYNC);
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
     }
   }
-#line 1586 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1479 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 33:
-#line 308 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                                  {
-    ((*yyvalp).decl) = new tidl::Declaration((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token)->ToString(),
-        std::unique_ptr<tidl::BaseType>(new tidl::BaseType("void", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token)->GetComments())),
-        std::unique_ptr<tidl::Parameters>((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.params)), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token)->GetComments(),
-        (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-6)].yystate.yyloc).begin.line, tidl::Declaration::MethodType::ASYNC);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token);
+  case 36:
+#line 337 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).decl) = new tidl::Declaration((((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token)->ToString(),
+        std::unique_ptr<tidl::BaseType>(new tidl::BaseType("void", (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token)->GetComments())),
+        std::unique_ptr<tidl::Parameters>((((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.params)), (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token)->GetComments(),
+        (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yyloc).begin.line, tidl::Declaration::MethodType::ASYNC);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token);
   }
-#line 1599 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1492 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 34:
-#line 316 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                                     {
+  case 37:
+#line 345 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
     if (ps->IsGroupEnabled()) {
-      ps->ReportError("Group does not support 'delegate' method type", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-6)].yystate.yyloc).begin.line);
+      ps->ReportError("Group does not support 'delegate' method type", (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yyloc).begin.line);
       ((*yyvalp).decl) = NULL;
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token);
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token);
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token);
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token);
     } else {
-      ((*yyvalp).decl) = new tidl::Declaration((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token)->ToString(),
-          std::unique_ptr<tidl::BaseType>(new tidl::BaseType("void", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token)->GetComments())),
-          std::unique_ptr<tidl::Parameters>((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.params)), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token)->GetComments(),
-          (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-6)].yystate.yyloc).begin.line, tidl::Declaration::MethodType::DELEGATE);
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token);
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token);
+      ((*yyvalp).decl) = new tidl::Declaration((((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token)->ToString(),
+          std::unique_ptr<tidl::BaseType>(new tidl::BaseType("void", (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token)->GetComments())),
+          std::unique_ptr<tidl::Parameters>((((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.params)), (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token)->GetComments(),
+          (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yyloc).begin.line, tidl::Declaration::MethodType::DELEGATE);
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-6)].yystate.yysemantics.yysval.token);
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token);
     }
   }
-#line 1619 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1512 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 35:
-#line 331 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                                     {
-    ps->ReportError("syntax error in method declaration.", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yyloc).begin.line);
+  case 38:
+#line 360 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in method declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yyloc).begin.line);
     ((*yyvalp).decl) = NULL;
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token);
   }
-#line 1629 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1522 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 36:
-#line 336 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                                        {
-    ps->ReportError("syntax error in method declaration.", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yyloc).begin.line);
+  case 39:
+#line 365 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in method declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yyloc).begin.line);
     ((*yyvalp).decl) = NULL;
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-5)].yystate.yysemantics.yysval.token);
   }
-#line 1639 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1532 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 37:
-#line 341 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                          {
-    ps->ReportError("syntax error. \"No async\".", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
+  case 40:
+#line 370 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error. \"No async\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
     ((*yyvalp).decl) = NULL;
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.token);
   }
-#line 1649 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1542 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 38:
-#line 346 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                        {
-    ps->ReportError("syntax error. \"No identifier\".", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line);
+  case 41:
+#line 375 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error. \"No identifier\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yyloc).begin.line);
     ((*yyvalp).decl) = NULL;
   }
-#line 1658 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1551 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 39:
-#line 350 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                             {
-    ps->ReportError("syntax error. \"No identifier\".", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yyloc).begin.line);
+  case 42:
+#line 379 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error. \"No identifier\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yyloc).begin.line);
     ((*yyvalp).decl) = NULL;
   }
-#line 1667 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1560 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 40:
-#line 354 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                                {
-    ps->ReportError("syntax error. \"No identifier\".", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-4)].yystate.yyloc).begin.line);
+  case 43:
+#line 383 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error. \"No identifier\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yyloc).begin.line);
     ((*yyvalp).decl) = NULL;
   }
-#line 1676 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1569 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 41:
-#line 358 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                {
-    ps->ReportError("syntax error in method declaration.", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
+  case 44:
+#line 387 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in method declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
     ((*yyvalp).decl) = NULL;
   }
-#line 1685 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1578 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 42:
-#line 362 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                             {
-    ps->ReportError("syntax error in method declaration.", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
+  case 45:
+#line 391 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in method declaration.", (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
     ((*yyvalp).decl) = NULL;
   }
-#line 1694 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1587 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 43:
-#line 368 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                          {
+  case 46:
+#line 397 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
     ((*yyvalp).params) = new tidl::Parameters();
     if (((*yyvalp).params) != nullptr) {
-      if ((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param) != nullptr) {
-        ((*yyvalp).params)->Add(std::unique_ptr<tidl::Parameter>((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param)));
+      if ((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param) != nullptr) {
+        ((*yyvalp).params)->Add(std::unique_ptr<tidl::Parameter>((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param)));
       }
     }
   }
-#line 1707 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1600 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 44:
-#line 376 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                     {
-    ((*yyvalp).params) = (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.params);
-    if ((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param) != nullptr) {
-      if (((*yyvalp).params)->Exist(*(YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param))) {
-        ps->ReportError("syntax error. \"Already Exists\".", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param)->GetLine());
-        delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param);
+  case 47:
+#line 405 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).params) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.params);
+    if ((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param) != nullptr) {
+      if (((*yyvalp).params)->Exist(*(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param))) {
+        ps->ReportError("syntax error. \"Already Exists\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param)->GetLine());
+        delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param);
       } else {
-        ((*yyvalp).params)->Add(std::unique_ptr<tidl::Parameter>((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param)));
+        ((*yyvalp).params)->Add(std::unique_ptr<tidl::Parameter>((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.param)));
       }
     }
   }
-#line 1723 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1616 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 45:
-#line 387 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-          {
-    ps->ReportError("syntax error in parameter list", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
+  case 48:
+#line 416 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ps->ReportError("syntax error in parameter list", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
     ((*yyvalp).params) = new tidl::Parameters();
   }
-#line 1732 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1625 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 46:
-#line 393 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                          {
+  case 49:
+#line 422 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
     ((*yyvalp).direction) = new tidl::Token("in", "");
   }
-#line 1740 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1633 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 47:
-#line 396 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-          {
+  case 50:
+#line 425 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
     ((*yyvalp).direction) = new tidl::Token("out", "");
   }
-#line 1748 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1641 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 48:
-#line 399 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-          {
+  case 51:
+#line 428 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
     ((*yyvalp).direction) = new tidl::Token("ref", "");
   }
-#line 1756 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1649 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 49:
-#line 404 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-           {
+  case 52:
+#line 433 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
     ((*yyvalp).param) = nullptr;
   }
-#line 1764 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1657 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 50:
-#line 407 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-           {
+  case 53:
+#line 436 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
     ((*yyvalp).param) = nullptr;
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
   }
-#line 1773 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1666 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 51:
-#line 411 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                        {
-    ((*yyvalp).param) = new tidl::Parameter((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->ToString(), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.p_type), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
-    delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+  case 54:
+#line 440 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+    ((*yyvalp).param) = new tidl::Parameter((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.p_type), (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc).begin.line);
+    delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
   }
-#line 1782 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1675 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 52:
-#line 417 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                          {
-      ((*yyvalp).p_type) = new tidl::ParameterType((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.b_type));
+  case 55:
+#line 446 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).p_type) = new tidl::ParameterType((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.b_type));
     }
-#line 1790 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1683 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 53:
-#line 420 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                    {
-      ((*yyvalp).p_type) = new tidl::ParameterType((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.b_type), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.direction)->ToString());
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.direction);
+  case 56:
+#line 449 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).p_type) = new tidl::ParameterType((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.b_type), (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.direction)->ToString());
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.direction);
     }
-#line 1799 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1692 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 54:
-#line 426 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                    {
-      ((*yyvalp).b_type) = (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.b_type);
+  case 57:
+#line 455 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).b_type) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.b_type);
     }
-#line 1807 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1700 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
-  case 55:
-#line 429 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-             {
+  case 58:
+#line 458 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
       if (ps->IsGroupEnabled()) {
-        ps->ReportError("Group does not support 'file' type", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
+        ps->ReportError("Group does not support 'file' type", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
         ((*yyvalp).b_type) = NULL;
-        delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
-      } else if (!ps->IsBetaEnabled()) {
-        ps->ReportError("syntax error. \"No identifier\".", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
-        ps->ReportError("try to use beta version (-b option).", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
+        delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+      } else if (!ps->IsBetaEnabled() && ps->GetVersion() < 2) {
+        ps->ReportError("syntax error. \"No identifier\".", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
+        ps->ReportError("try to use beta version (-b option).", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
         ((*yyvalp).b_type) = NULL;
-        delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+        delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
       } else {
-        ((*yyvalp).b_type) = new tidl::BaseType("file", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
-        delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+        ((*yyvalp).b_type) = new tidl::BaseType("file", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
+        delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
       }
     }
-#line 1827 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
-    break;
-
-  case 56:
-#line 446 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                         {
-      ((*yyvalp).b_type) = (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.b_type);
-    }
-#line 1835 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
-    break;
-
-  case 57:
-#line 449 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-             {
-      ((*yyvalp).b_type) = new tidl::BaseType("void", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
-    }
-#line 1844 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
-    break;
-
-  case 58:
-#line 453 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-             {
-      ((*yyvalp).b_type) = new tidl::BaseType("char", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
-    }
-#line 1853 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1720 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 59:
-#line 457 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-              {
-      ((*yyvalp).b_type) = new tidl::BaseType("short", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+#line 475 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).b_type) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.b_type);
     }
-#line 1862 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1728 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 60:
-#line 461 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-            {
-      ((*yyvalp).b_type) = new tidl::BaseType("int", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+#line 478 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).b_type) = new tidl::BaseType("void", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
     }
-#line 1871 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1737 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 61:
-#line 465 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-             {
-      ((*yyvalp).b_type) = new tidl::BaseType("long", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+#line 482 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).b_type) = new tidl::BaseType("char", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
     }
-#line 1880 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1746 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 62:
-#line 469 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-              {
-      ((*yyvalp).b_type) = new tidl::BaseType("float", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+#line 486 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).b_type) = new tidl::BaseType("short", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
     }
-#line 1889 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1755 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 63:
-#line 473 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-               {
-      ((*yyvalp).b_type) = new tidl::BaseType("double", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+#line 490 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).b_type) = new tidl::BaseType("int", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
     }
-#line 1898 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1764 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 64:
-#line 477 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-               {
-      if (ps->IsCionEnabled()) {
-        ps->ReportError("Cion does not support 'bundle' type", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
-        ((*yyvalp).b_type) = NULL;
-        delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
-      } else {
-        ((*yyvalp).b_type) = new tidl::BaseType("bundle", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
-        delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
-      }
+#line 494 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).b_type) = new tidl::BaseType("long", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
     }
-#line 1913 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1773 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 65:
-#line 487 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-               {
-      ((*yyvalp).b_type) = new tidl::BaseType("string", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+#line 498 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).b_type) = new tidl::BaseType("float", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
     }
-#line 1922 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1782 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 66:
-#line 491 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-             {
-      ((*yyvalp).b_type) = new tidl::BaseType("bool", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+#line 502 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).b_type) = new tidl::BaseType("double", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
     }
-#line 1931 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1791 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 67:
-#line 495 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-           {
-      ((*yyvalp).b_type) = new tidl::BaseType((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->ToString(), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments(), true);
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+#line 506 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      if (ps->IsCionEnabled()) {
+        ps->ReportError("Cion does not support 'bundle' type", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc).begin.line);
+        ((*yyvalp).b_type) = NULL;
+        delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+      } else {
+        ((*yyvalp).b_type) = new tidl::BaseType("bundle", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
+        delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+      }
     }
-#line 1940 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1806 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 68:
-#line 501 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                                                                       {
-      ((*yyvalp).b_type) = new tidl::BaseType((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->ToString(), (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->GetComments());
-      ((*yyvalp).b_type)->SetMetaType((YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.b_type));
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token);
+#line 516 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).b_type) = new tidl::BaseType("string", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
     }
-#line 1950 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1815 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 69:
-#line 508 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-                            {
-      ((*yyvalp).token) = new tidl::Token("list", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+#line 520 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).b_type) = new tidl::BaseType("bool", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
     }
-#line 1959 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1824 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
   case 70:
-#line 512 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
-              {
-      ((*yyvalp).token) = new tidl::Token("array", (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
-      delete (YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+#line 524 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).b_type) = new tidl::BaseType((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments(), true);
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
     }
-#line 1968 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 1833 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
     break;
 
+  case 71:
+#line 530 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).b_type) = new tidl::BaseType((((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->ToString(), (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token)->GetComments());
+      ((*yyvalp).b_type)->SetMetaType((((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.b_type));
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval.token);
+    }
+#line 1843 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
+    break;
 
-#line 1972 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
-
-      default: break;
+  case 72:
+#line 537 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
+    {
+      ((*yyvalp).token) = new tidl::Token("list", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
     }
-#if YY_EXCEPTIONS
-  }
-  catch (const syntax_error& yyexc)
+#line 1852 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
+    break;
+
+  case 73:
+#line 541 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:816
     {
-      YY_DPRINTF ((stderr, "Caught exception: %s\n", yyexc.what()));
-      *yylocp = yyexc.location;
-      yyerror (yylocp, yyparser, ps, yyexc.what ());
-      YYERROR;
+      ((*yyvalp).token) = new tidl::Token("array", (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token)->GetComments());
+      delete (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.token);
+    }
+#line 1861 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
+    break;
+
+
+#line 1865 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:816
+      default: break;
     }
-#endif // YY_EXCEPTIONS
 
   return yyok;
 # undef yyerrok
@@ -2048,9 +1930,9 @@ yydestroyGLRState (char const *yymsg, yyGLRState *yys, yy::parser& yyparser, tid
       if (yydebug)
         {
           if (yys->yysemantics.yyfirstVal)
-            YY_FPRINTF ((stderr, "%s unresolved", yymsg));
+            YYFPRINTF (stderr, "%s unresolved", yymsg);
           else
-            YY_FPRINTF ((stderr, "%s incomplete", yymsg));
+            YYFPRINTF (stderr, "%s incomplete", yymsg);
           YY_SYMBOL_PRINT ("", yystos[yys->yylrState], YY_NULLPTR, &yys->yyloc);
         }
 #endif
@@ -2075,8 +1957,8 @@ yylhsNonterm (yyRuleNum yyrule)
   return yyr1[yyrule];
 }
 
-#define yypact_value_is_default(Yyn) \
-  ((Yyn) == YYPACT_NINF)
+#define yypact_value_is_default(Yystate) \
+  (!!((Yystate) == (-70)))
 
 /** True iff LR state YYSTATE has only a default reduction (regardless
  *  of token).  */
@@ -2093,10 +1975,10 @@ yydefaultAction (yyStateNum yystate)
   return yydefact[yystate];
 }
 
-#define yytable_value_is_error(Yyn) \
+#define yytable_value_is_error(Yytable_value) \
   0
 
-/** The action to take in YYSTATE on seeing YYTOKEN.
+/** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN.
  *  Result R means
  *    R < 0:  Reduce on rule -R.
  *    R = 0:  Error.
@@ -2104,25 +1986,26 @@ yydefaultAction (yyStateNum yystate)
  *  Set *YYCONFLICTS to a pointer into yyconfl to a 0-terminated list
  *  of conflicting reductions.
  */
-static inline int
-yygetLRActions (yyStateNum yystate, yySymbol yytoken, const short** yyconflicts)
+static inline void
+yygetLRActions (yyStateNum yystate, int yytoken,
+                int* yyaction, const short int** yyconflicts)
 {
   int yyindex = yypact[yystate] + yytoken;
-  if (yyisDefaultedState (yystate)
+  if (yypact_value_is_default (yypact[yystate])
       || yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken)
     {
+      *yyaction = -yydefact[yystate];
       *yyconflicts = yyconfl;
-      return -yydefact[yystate];
     }
   else if (! yytable_value_is_error (yytable[yyindex]))
     {
+      *yyaction = yytable[yyindex];
       *yyconflicts = yyconfl + yyconflp[yyindex];
-      return yytable[yyindex];
     }
   else
     {
+      *yyaction = 0;
       *yyconflicts = yyconfl + yyconflp[yyindex];
-      return 0;
     }
 }
 
@@ -2174,12 +2057,12 @@ yynewGLRStackItem (yyGLRStack* yystackp, yybool yyisState)
  *  alternative actions for YYSTATE.  Assumes that YYRHS comes from
  *  stack #YYK of *YYSTACKP. */
 static void
-yyaddDeferredAction (yyGLRStack* yystackp, ptrdiff_t yyk, yyGLRState* yystate,
+yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate,
                      yyGLRState* yyrhs, yyRuleNum yyrule)
 {
   yySemanticOption* yynewOption =
     &yynewGLRStackItem (yystackp, yyfalse)->yyoption;
-  YY_ASSERT (!yynewOption->yyisState);
+  YYASSERT (!yynewOption->yyisState);
   yynewOption->yystate = yyrhs;
   yynewOption->yyrule = yyrule;
   if (yystackp->yytops.yylookaheadNeeds[yyk])
@@ -2204,25 +2087,17 @@ yyinitStateSet (yyGLRStateSet* yyset)
 {
   yyset->yysize = 1;
   yyset->yycapacity = 16;
-  yyset->yystates
-    = YY_CAST (yyGLRState**,
-               YYMALLOC (YY_CAST (size_t, yyset->yycapacity)
-                         * sizeof yyset->yystates[0]));
+  yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]);
   if (! yyset->yystates)
     return yyfalse;
   yyset->yystates[0] = YY_NULLPTR;
-  yyset->yylookaheadNeeds
-    = YY_CAST (yybool*,
-               YYMALLOC (YY_CAST (size_t, yyset->yycapacity)
-                         * sizeof yyset->yylookaheadNeeds[0]));
+  yyset->yylookaheadNeeds =
+    (yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]);
   if (! yyset->yylookaheadNeeds)
     {
       YYFREE (yyset->yystates);
       return yyfalse;
     }
-  memset (yyset->yylookaheadNeeds,
-          0,
-          YY_CAST (size_t, yyset->yycapacity) * sizeof yyset->yylookaheadNeeds[0]);
   return yytrue;
 }
 
@@ -2235,15 +2110,13 @@ static void yyfreeStateSet (yyGLRStateSet* yyset)
 /** Initialize *YYSTACKP to a single empty stack, with total maximum
  *  capacity for all stacks of YYSIZE.  */
 static yybool
-yyinitGLRStack (yyGLRStack* yystackp, ptrdiff_t yysize)
+yyinitGLRStack (yyGLRStack* yystackp, size_t yysize)
 {
   yystackp->yyerrState = 0;
   yynerrs = 0;
   yystackp->yyspaceLeft = yysize;
-  yystackp->yyitems
-    = YY_CAST (yyGLRStackItem*,
-               YYMALLOC (YY_CAST (size_t, yysize)
-                         * sizeof yystackp->yynextFree[0]));
+  yystackp->yyitems =
+    (yyGLRStackItem*) YYMALLOC (yysize * sizeof yystackp->yynextFree[0]);
   if (!yystackp->yyitems)
     return yyfalse;
   yystackp->yynextFree = yystackp->yyitems;
@@ -2254,9 +2127,8 @@ yyinitGLRStack (yyGLRStack* yystackp, ptrdiff_t yysize)
 
 
 #if YYSTACKEXPANDABLE
-# define YYRELOC(YYFROMITEMS, YYTOITEMS, YYX, YYTYPE)                   \
-  &((YYTOITEMS)                                                         \
-    - ((YYFROMITEMS) - YY_REINTERPRET_CAST (yyGLRStackItem*, (YYX))))->YYTYPE
+# define YYRELOC(YYFROMITEMS,YYTOITEMS,YYX,YYTYPE) \
+  &((YYTOITEMS) - ((YYFROMITEMS) - (yyGLRStackItem*) (YYX)))->YYTYPE
 
 /** If *YYSTACKP is expandable, extend it.  WARNING: Pointers into the
     stack from outside should be considered invalid after this call.
@@ -2268,18 +2140,15 @@ yyexpandGLRStack (yyGLRStack* yystackp)
 {
   yyGLRStackItem* yynewItems;
   yyGLRStackItem* yyp0, *yyp1;
-  ptrdiff_t yynewSize;
-  ptrdiff_t yyn;
-  ptrdiff_t yysize = yystackp->yynextFree - yystackp->yyitems;
+  size_t yynewSize;
+  size_t yyn;
+  size_t yysize = yystackp->yynextFree - yystackp->yyitems;
   if (YYMAXDEPTH - YYHEADROOM < yysize)
     yyMemoryExhausted (yystackp);
   yynewSize = 2*yysize;
   if (YYMAXDEPTH < yynewSize)
     yynewSize = YYMAXDEPTH;
-  yynewItems
-    = YY_CAST (yyGLRStackItem*,
-               YYMALLOC (YY_CAST (size_t, yynewSize)
-                         * sizeof yynewItems[0]));
+  yynewItems = (yyGLRStackItem*) YYMALLOC (yynewSize * sizeof yynewItems[0]);
   if (! yynewItems)
     yyMemoryExhausted (yystackp);
   for (yyp0 = yystackp->yyitems, yyp1 = yynewItems, yyn = yysize;
@@ -2287,7 +2156,7 @@ yyexpandGLRStack (yyGLRStack* yystackp)
        yyn -= 1, yyp0 += 1, yyp1 += 1)
     {
       *yyp1 = *yyp0;
-      if (*YY_REINTERPRET_CAST (yybool *, yyp0))
+      if (*(yybool *) yyp0)
         {
           yyGLRState* yys0 = &yyp0->yystate;
           yyGLRState* yys1 = &yyp1->yystate;
@@ -2343,7 +2212,7 @@ yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys)
 
 /** Invalidate stack #YYK in *YYSTACKP.  */
 static inline void
-yymarkStackDeleted (yyGLRStack* yystackp, ptrdiff_t yyk)
+yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk)
 {
   if (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
     yystackp->yylastDeleted = yystackp->yytops.yystates[yyk];
@@ -2360,21 +2229,23 @@ yyundeleteLastStack (yyGLRStack* yystackp)
     return;
   yystackp->yytops.yystates[0] = yystackp->yylastDeleted;
   yystackp->yytops.yysize = 1;
-  YY_DPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
+  YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
   yystackp->yylastDeleted = YY_NULLPTR;
 }
 
 static inline void
 yyremoveDeletes (yyGLRStack* yystackp)
 {
-  ptrdiff_t yyi, yyj;
+  size_t yyi, yyj;
   yyi = yyj = 0;
   while (yyj < yystackp->yytops.yysize)
     {
       if (yystackp->yytops.yystates[yyi] == YY_NULLPTR)
         {
           if (yyi == yyj)
-            YY_DPRINTF ((stderr, "Removing dead stacks.\n"));
+            {
+              YYDPRINTF ((stderr, "Removing dead stacks.\n"));
+            }
           yystackp->yytops.yysize -= 1;
         }
       else
@@ -2388,8 +2259,10 @@ yyremoveDeletes (yyGLRStack* yystackp)
           yystackp->yytops.yylookaheadNeeds[yyj] =
             yystackp->yytops.yylookaheadNeeds[yyi];
           if (yyj != yyi)
-            YY_DPRINTF ((stderr, "Rename stack %ld -> %ld.\n",
-                        YY_CAST (long, yyi), YY_CAST (long, yyj)));
+            {
+              YYDPRINTF ((stderr, "Rename stack %lu -> %lu.\n",
+                          (unsigned long int) yyi, (unsigned long int) yyj));
+            }
           yyj += 1;
         }
       yyi += 1;
@@ -2400,8 +2273,8 @@ yyremoveDeletes (yyGLRStack* yystackp)
  * state YYLRSTATE, at input position YYPOSN, with (resolved) semantic
  * value *YYVALP and source location *YYLOCP.  */
 static inline void
-yyglrShift (yyGLRStack* yystackp, ptrdiff_t yyk, yyStateNum yylrState,
-            ptrdiff_t yyposn,
+yyglrShift (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState,
+            size_t yyposn,
             YYSTYPE* yyvalp, YYLTYPE* yylocp)
 {
   yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
@@ -2421,11 +2294,11 @@ yyglrShift (yyGLRStack* yystackp, ptrdiff_t yyk, yyStateNum yylrState,
  *  state YYLRSTATE, at input position YYPOSN, with the (unresolved)
  *  semantic value of YYRHS under the action for YYRULE.  */
 static inline void
-yyglrShiftDefer (yyGLRStack* yystackp, ptrdiff_t yyk, yyStateNum yylrState,
-                 ptrdiff_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule)
+yyglrShiftDefer (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState,
+                 size_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule)
 {
   yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
-  YY_ASSERT (yynewState->yyisState);
+  YYASSERT (yynewState->yyisState);
 
   yynewState->yylrState = yylrState;
   yynewState->yyposn = yyposn;
@@ -2442,37 +2315,38 @@ yyglrShiftDefer (yyGLRStack* yystackp, ptrdiff_t yyk, yyStateNum yylrState,
 # define YY_REDUCE_PRINT(Args)
 #else
 # define YY_REDUCE_PRINT(Args)          \
-  do {                                  \
-    if (yydebug)                        \
-      yy_reduce_print Args;             \
-  } while (0)
+do {                                    \
+  if (yydebug)                          \
+    yy_reduce_print Args;               \
+} while (0)
 
 /*----------------------------------------------------------------------.
 | Report that stack #YYK of *YYSTACKP is going to be reduced by YYRULE. |
 `----------------------------------------------------------------------*/
 
 static inline void
-yy_reduce_print (yybool yynormal, yyGLRStackItem* yyvsp, ptrdiff_t yyk,
+yy_reduce_print (int yynormal, yyGLRStackItem* yyvsp, size_t yyk,
                  yyRuleNum yyrule, yy::parser& yyparser, tidl::Parser* ps)
 {
   int yynrhs = yyrhsLength (yyrule);
   int yylow = 1;
   int yyi;
-  YY_FPRINTF ((stderr, "Reducing stack %ld by rule %d (line %d):\n",
-               YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule]));
+  YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu):\n",
+             (unsigned long int) yyk, yyrule - 1,
+             (unsigned long int) yyrline[yyrule]);
   if (! yynormal)
     yyfillin (yyvsp, 1, -yynrhs);
   /* The symbols being reduced.  */
   for (yyi = 0; yyi < yynrhs; yyi++)
     {
-      YY_FPRINTF ((stderr, "   $%d = ", yyi + 1));
+      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
       yy_symbol_print (stderr,
                        yystos[yyvsp[yyi - yynrhs + 1].yystate.yylrState],
-                       &yyvsp[yyi - yynrhs + 1].yystate.yysemantics.yysval,
-                       &(YY_CAST (yyGLRStackItem const *, yyvsp)[YYFILL ((yyi + 1) - (yynrhs))].yystate.yyloc)                       , yyparser, ps);
+                       &yyvsp[yyi - yynrhs + 1].yystate.yysemantics.yysval
+                       , &(((yyGLRStackItem const *)yyvsp)[YYFILL ((yyi + 1) - (yynrhs))].yystate.yyloc)                       , yyparser, ps);
       if (!yyvsp[yyi - yynrhs + 1].yystate.yyresolved)
-        YY_FPRINTF ((stderr, " (unresolved)"));
-      YY_FPRINTF ((stderr, "\n"));
+        YYFPRINTF (stderr, " (unresolved)");
+      YYFPRINTF (stderr, "\n");
     }
 }
 #endif
@@ -2484,7 +2358,7 @@ yy_reduce_print (yybool yynormal, yyGLRStackItem* yyvsp, ptrdiff_t yyk,
  *  and *YYLOCP to the computed location (if any).  Return value is as
  *  for userAction.  */
 static inline YYRESULTTAG
-yydoAction (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
+yydoAction (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
             YYSTYPE* yyvalp, YYLTYPE *yylocp, yy::parser& yyparser, tidl::Parser* ps)
 {
   int yynrhs = yyrhsLength (yyrule);
@@ -2492,33 +2366,33 @@ yydoAction (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
   if (yystackp->yysplitPoint == YY_NULLPTR)
     {
       /* Standard special case: single stack.  */
-      yyGLRStackItem* yyrhs
-        = YY_REINTERPRET_CAST (yyGLRStackItem*, yystackp->yytops.yystates[yyk]);
-      YY_ASSERT (yyk == 0);
+      yyGLRStackItem* yyrhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk];
+      YYASSERT (yyk == 0);
       yystackp->yynextFree -= yynrhs;
       yystackp->yyspaceLeft += yynrhs;
       yystackp->yytops.yystates[0] = & yystackp->yynextFree[-1].yystate;
-      YY_REDUCE_PRINT ((yytrue, yyrhs, yyk, yyrule, yyparser, ps));
+      YY_REDUCE_PRINT ((1, yyrhs, yyk, yyrule, yyparser, ps));
       return yyuserAction (yyrule, yynrhs, yyrhs, yystackp,
                            yyvalp, yylocp, yyparser, ps);
     }
   else
     {
+      int yyi;
+      yyGLRState* yys;
       yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1];
-      yyGLRState* yys = yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred
+      yys = yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred
         = yystackp->yytops.yystates[yyk];
-      int yyi;
       if (yynrhs == 0)
         /* Set default location.  */
         yyrhsVals[YYMAXRHS + YYMAXLEFT - 1].yystate.yyloc = yys->yyloc;
       for (yyi = 0; yyi < yynrhs; yyi += 1)
         {
           yys = yys->yypred;
-          YY_ASSERT (yys);
+          YYASSERT (yys);
         }
       yyupdateSplit (yystackp, yys);
       yystackp->yytops.yystates[yyk] = yys;
-      YY_REDUCE_PRINT ((yyfalse, yyrhsVals + YYMAXRHS + YYMAXLEFT - 1, yyk, yyrule, yyparser, ps));
+      YY_REDUCE_PRINT ((0, yyrhsVals + YYMAXRHS + YYMAXLEFT - 1, yyk, yyrule, yyparser, ps));
       return yyuserAction (yyrule, yynrhs, yyrhsVals + YYMAXRHS + YYMAXLEFT - 1,
                            yystackp, yyvalp, yylocp, yyparser, ps);
     }
@@ -2536,10 +2410,10 @@ yydoAction (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
  *  added to the options for the existing state's semantic value.
  */
 static inline YYRESULTTAG
-yyglrReduce (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
+yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
              yybool yyforceEval, yy::parser& yyparser, tidl::Parser* ps)
 {
-  ptrdiff_t yyposn = yystackp->yytops.yystates[yyk]->yyposn;
+  size_t yyposn = yystackp->yytops.yystates[yyk]->yyposn;
 
   if (yyforceEval || yystackp->yysplitPoint == YY_NULLPTR)
     {
@@ -2548,9 +2422,10 @@ yyglrReduce (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
 
       YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule, &yysval, &yyloc, yyparser, ps);
       if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULLPTR)
-        YY_DPRINTF ((stderr,
-                     "Parse on stack %ld rejected by rule %d (line %d).\n",
-                     YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule - 1]));
+        {
+          YYDPRINTF ((stderr, "Parse on stack %lu rejected by rule #%d.\n",
+                     (unsigned long int) yyk, yyrule - 1));
+        }
       if (yyflag != yyok)
         return yyflag;
       YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyrule], &yysval, &yyloc);
@@ -2561,7 +2436,7 @@ yyglrReduce (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
     }
   else
     {
-      ptrdiff_t yyi;
+      size_t yyi;
       int yyn;
       yyGLRState* yys, *yys0 = yystackp->yytops.yystates[yyk];
       yyStateNum yynewLRState;
@@ -2570,15 +2445,14 @@ yyglrReduce (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
            0 < yyn; yyn -= 1)
         {
           yys = yys->yypred;
-          YY_ASSERT (yys);
+          YYASSERT (yys);
         }
       yyupdateSplit (yystackp, yys);
       yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule));
-      YY_DPRINTF ((stderr,
-                   "Reduced stack %ld by rule %d (line %d); action deferred.  "
-                   "Now in state %d.\n",
-                   YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule - 1],
-                   yynewLRState));
+      YYDPRINTF ((stderr,
+                  "Reduced stack %lu by rule #%d; action deferred.  "
+                  "Now in state %d.\n",
+                  (unsigned long int) yyk, yyrule - 1, yynewLRState));
       for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
         if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULLPTR)
           {
@@ -2590,8 +2464,9 @@ yyglrReduce (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
                   {
                     yyaddDeferredAction (yystackp, yyk, yyp, yys0, yyrule);
                     yymarkStackDeleted (yystackp, yyk);
-                    YY_DPRINTF ((stderr, "Merging stack %ld into stack %ld.\n",
-                                 YY_CAST (long, yyk), YY_CAST (long, yyi)));
+                    YYDPRINTF ((stderr, "Merging stack %lu into stack %lu.\n",
+                                (unsigned long int) yyk,
+                                (unsigned long int) yyi));
                     return yyok;
                   }
                 yyp = yyp->yypred;
@@ -2603,50 +2478,48 @@ yyglrReduce (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
   return yyok;
 }
 
-static ptrdiff_t
-yysplitStack (yyGLRStack* yystackp, ptrdiff_t yyk)
+static size_t
+yysplitStack (yyGLRStack* yystackp, size_t yyk)
 {
   if (yystackp->yysplitPoint == YY_NULLPTR)
     {
-      YY_ASSERT (yyk == 0);
+      YYASSERT (yyk == 0);
       yystackp->yysplitPoint = yystackp->yytops.yystates[yyk];
     }
-  if (yystackp->yytops.yycapacity <= yystackp->yytops.yysize)
+  if (yystackp->yytops.yysize >= yystackp->yytops.yycapacity)
     {
-      ptrdiff_t state_size = sizeof yystackp->yytops.yystates[0];
-      ptrdiff_t half_max_capacity = YYSIZEMAX / 2 / state_size;
-      if (half_max_capacity < yystackp->yytops.yycapacity)
+      yyGLRState** yynewStates;
+      yybool* yynewLookaheadNeeds;
+
+      yynewStates = YY_NULLPTR;
+
+      if (yystackp->yytops.yycapacity
+          > (YYSIZEMAX / (2 * sizeof yynewStates[0])))
         yyMemoryExhausted (yystackp);
       yystackp->yytops.yycapacity *= 2;
 
-      {
-        yyGLRState** yynewStates
-          = YY_CAST (yyGLRState**,
-                     YYREALLOC (yystackp->yytops.yystates,
-                                (YY_CAST (size_t, yystackp->yytops.yycapacity)
-                                 * sizeof yynewStates[0])));
-        if (yynewStates == YY_NULLPTR)
-          yyMemoryExhausted (yystackp);
-        yystackp->yytops.yystates = yynewStates;
-      }
+      yynewStates =
+        (yyGLRState**) YYREALLOC (yystackp->yytops.yystates,
+                                  (yystackp->yytops.yycapacity
+                                   * sizeof yynewStates[0]));
+      if (yynewStates == YY_NULLPTR)
+        yyMemoryExhausted (yystackp);
+      yystackp->yytops.yystates = yynewStates;
 
-      {
-        yybool* yynewLookaheadNeeds
-          = YY_CAST (yybool*,
-                     YYREALLOC (yystackp->yytops.yylookaheadNeeds,
-                                (YY_CAST (size_t, yystackp->yytops.yycapacity)
-                                 * sizeof yynewLookaheadNeeds[0])));
-        if (yynewLookaheadNeeds == YY_NULLPTR)
-          yyMemoryExhausted (yystackp);
-        yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds;
-      }
+      yynewLookaheadNeeds =
+        (yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds,
+                             (yystackp->yytops.yycapacity
+                              * sizeof yynewLookaheadNeeds[0]));
+      if (yynewLookaheadNeeds == YY_NULLPTR)
+        yyMemoryExhausted (yystackp);
+      yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds;
     }
   yystackp->yytops.yystates[yystackp->yytops.yysize]
     = yystackp->yytops.yystates[yyk];
   yystackp->yytops.yylookaheadNeeds[yystackp->yytops.yysize]
     = yystackp->yytops.yylookaheadNeeds[yyk];
   yystackp->yytops.yysize += 1;
-  return yystackp->yytops.yysize - 1;
+  return yystackp->yytops.yysize-1;
 }
 
 /** True iff YYY0 and YYY1 represent identical options at the top level.
@@ -2680,7 +2553,7 @@ yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1)
   int yyn;
   for (yys0 = yyy0->yystate, yys1 = yyy1->yystate,
        yyn = yyrhsLength (yyy0->yyrule);
-       0 < yyn;
+       yyn > 0;
        yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1)
     {
       if (yys0 == yys1)
@@ -2762,7 +2635,7 @@ yyresolveStates (yyGLRState* yys, int yyn,
 {
   if (0 < yyn)
     {
-      YY_ASSERT (yys->yypred);
+      YYASSERT (yys->yypred);
       YYCHK (yyresolveStates (yys->yypred, yyn-1, yystackp, yyparser, ps));
       if (! yys->yyresolved)
         YYCHK (yyresolveValue (yys, yystackp, yyparser, ps));
@@ -2833,26 +2706,26 @@ yyreportTree (yySemanticOption* yyx, int yyindent)
     yystates[0] = yys;
 
   if (yyx->yystate->yyposn < yys->yyposn + 1)
-    YY_FPRINTF ((stderr, "%*s%s -> <Rule %d, empty>\n",
-                 yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
-                 yyx->yyrule - 1));
+    YYFPRINTF (stderr, "%*s%s -> <Rule %d, empty>\n",
+               yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
+               yyx->yyrule - 1);
   else
-    YY_FPRINTF ((stderr, "%*s%s -> <Rule %d, tokens %ld .. %ld>\n",
-                 yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
-                 yyx->yyrule - 1, YY_CAST (long, yys->yyposn + 1),
-                 YY_CAST (long, yyx->yystate->yyposn)));
+    YYFPRINTF (stderr, "%*s%s -> <Rule %d, tokens %lu .. %lu>\n",
+               yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
+               yyx->yyrule - 1, (unsigned long int) (yys->yyposn + 1),
+               (unsigned long int) yyx->yystate->yyposn);
   for (yyi = 1; yyi <= yynrhs; yyi += 1)
     {
       if (yystates[yyi]->yyresolved)
         {
           if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn)
-            YY_FPRINTF ((stderr, "%*s%s <empty>\n", yyindent+2, "",
-                         yytokenName (yystos[yystates[yyi]->yylrState])));
+            YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "",
+                       yytokenName (yystos[yystates[yyi]->yylrState]));
           else
-            YY_FPRINTF ((stderr, "%*s%s <tokens %ld .. %ld>\n", yyindent+2, "",
-                         yytokenName (yystos[yystates[yyi]->yylrState]),
-                         YY_CAST (long, yystates[yyi-1]->yyposn + 1),
-                         YY_CAST (long, yystates[yyi]->yyposn)));
+            YYFPRINTF (stderr, "%*s%s <tokens %lu .. %lu>\n", yyindent+2, "",
+                       yytokenName (yystos[yystates[yyi]->yylrState]),
+                       (unsigned long int) (yystates[yyi-1]->yyposn + 1),
+                       (unsigned long int) yystates[yyi]->yyposn);
         }
       else
         yyreportTree (yystates[yyi]->yysemantics.yyfirstVal, yyindent+2);
@@ -2868,12 +2741,12 @@ yyreportAmbiguity (yySemanticOption* yyx0,
   YYUSE (yyx1);
 
 #if YYDEBUG
-  YY_FPRINTF ((stderr, "Ambiguity detected.\n"));
-  YY_FPRINTF ((stderr, "Option 1,\n"));
+  YYFPRINTF (stderr, "Ambiguity detected.\n");
+  YYFPRINTF (stderr, "Option 1,\n");
   yyreportTree (yyx0, 2);
-  YY_FPRINTF ((stderr, "\nOption 2,\n"));
+  YYFPRINTF (stderr, "\nOption 2,\n");
   yyreportTree (yyx1, 2);
-  YY_FPRINTF ((stderr, "\n"));
+  YYFPRINTF (stderr, "\n");
 #endif
 
   yyerror (yylocp, yyparser, ps, YY_("syntax is ambiguous"));
@@ -2884,7 +2757,7 @@ yyreportAmbiguity (yySemanticOption* yyx0,
  *  ending at YYS1.  Has no effect on previously resolved states.
  *  The first semantic option of a state is always chosen.  */
 static void
-yyresolveLocations (yyGLRState *yys1, int yyn1,
+yyresolveLocations (yyGLRStateyys1, int yyn1,
                     yyGLRStack *yystackp, yy::parser& yyparser, tidl::Parser* ps)
 {
   if (0 < yyn1)
@@ -2895,9 +2768,9 @@ yyresolveLocations (yyGLRState *yys1, int yyn1,
           yyGLRStackItem yyrhsloc[1 + YYMAXRHS];
           int yynrhs;
           yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal;
-          YY_ASSERT (yyoption);
+          YYASSERT (yyoption != YY_NULLPTR);
           yynrhs = yyrhsLength (yyoption->yyrule);
-          if (0 < yynrhs)
+          if (yynrhs > 0)
             {
               yyGLRState *yys;
               int yyn;
@@ -2920,7 +2793,18 @@ yyresolveLocations (yyGLRState *yys1, int yyn1,
               yyGLRState *yyprevious = yyoption->yystate;
               yyrhsloc[0].yystate.yyloc = yyprevious->yyloc;
             }
-          YYLLOC_DEFAULT ((yys1->yyloc), yyrhsloc, yynrhs);
+          {
+            int yychar_current = yychar;
+            YYSTYPE yylval_current = yylval;
+            YYLTYPE yylloc_current = yylloc;
+            yychar = yyoption->yyrawchar;
+            yylval = yyoption->yyval;
+            yylloc = yyoption->yyloc;
+            YYLLOC_DEFAULT ((yys1->yyloc), yyrhsloc, yynrhs);
+            yychar = yychar_current;
+            yylval = yylval_current;
+            yylloc = yylloc_current;
+          }
         }
     }
 }
@@ -2970,7 +2854,7 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp, yy::parser& yyparser, tid
               yymerge = yyfalse;
               break;
             default:
-              /* This cannot happen so it is not worth a YY_ASSERT (yyfalse),
+              /* This cannot happen so it is not worth a YYASSERT (yyfalse),
                  but some compilers complain if the default case is
                  omitted.  */
               break;
@@ -3048,7 +2932,7 @@ yycompressStack (yyGLRStack* yystackp)
     yyp->yypred = yyr;
 
   yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems;
-  yystackp->yynextFree = YY_REINTERPRET_CAST (yyGLRStackItem*, yystackp->yysplitPoint) + 1;
+  yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1;
   yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems;
   yystackp->yysplitPoint = YY_NULLPTR;
   yystackp->yylastDeleted = YY_NULLPTR;
@@ -3065,16 +2949,16 @@ yycompressStack (yyGLRStack* yystackp)
 }
 
 static YYRESULTTAG
-yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
-                   ptrdiff_t yyposn, YYLTYPE *yylocp, yy::parser& yyparser, tidl::Parser* ps)
+yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
+                   size_t yyposn, YYLTYPE *yylocp, yy::parser& yyparser, tidl::Parser* ps)
 {
   while (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
     {
       yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState;
-      YY_DPRINTF ((stderr, "Stack %ld Entering state %d\n",
-                   YY_CAST (long, yyk), yystate));
+      YYDPRINTF ((stderr, "Stack %lu Entering state %d\n",
+                  (unsigned long int) yyk, yystate));
 
-      YY_ASSERT (yystate != YYFINAL);
+      YYASSERT (yystate != YYFINAL);
 
       if (yyisDefaultedState (yystate))
         {
@@ -3082,17 +2966,18 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
           yyRuleNum yyrule = yydefaultAction (yystate);
           if (yyrule == 0)
             {
-              YY_DPRINTF ((stderr, "Stack %ld dies.\n", YY_CAST (long, yyk)));
+              YYDPRINTF ((stderr, "Stack %lu dies.\n",
+                          (unsigned long int) yyk));
               yymarkStackDeleted (yystackp, yyk);
               return yyok;
             }
           yyflag = yyglrReduce (yystackp, yyk, yyrule, yyimmediate[yyrule], yyparser, ps);
           if (yyflag == yyerr)
             {
-              YY_DPRINTF ((stderr,
-                           "Stack %ld dies "
-                           "(predicate failure or explicit user error).\n",
-                           YY_CAST (long, yyk)));
+              YYDPRINTF ((stderr,
+                          "Stack %lu dies "
+                          "(predicate failure or explicit user error).\n",
+                          (unsigned long int) yyk));
               yymarkStackDeleted (yystackp, yyk);
               return yyok;
             }
@@ -3101,17 +2986,37 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
         }
       else
         {
-          yySymbol yytoken = yygetToken (&yychar, yystackp, yyparser, ps);
-          const short* yyconflicts;
-          const int yyaction = yygetLRActions (yystate, yytoken, &yyconflicts);
+          yySymbol yytoken;
+          int yyaction;
+          const short int* yyconflicts;
+
           yystackp->yytops.yylookaheadNeeds[yyk] = yytrue;
+          if (yychar == YYEMPTY)
+            {
+              YYDPRINTF ((stderr, "Reading a token: "));
+              yychar = yylex (&yylval, &yylloc, lex_scanner);
+            }
+
+          if (yychar <= YYEOF)
+            {
+              yychar = yytoken = YYEOF;
+              YYDPRINTF ((stderr, "Now at end of input.\n"));
+            }
+          else
+            {
+              yytoken = YYTRANSLATE (yychar);
+              YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+            }
+
+          yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
 
           while (*yyconflicts != 0)
             {
               YYRESULTTAG yyflag;
-              ptrdiff_t yynewStack = yysplitStack (yystackp, yyk);
-              YY_DPRINTF ((stderr, "Splitting off stack %ld from %ld.\n",
-                           YY_CAST (long, yynewStack), YY_CAST (long, yyk)));
+              size_t yynewStack = yysplitStack (yystackp, yyk);
+              YYDPRINTF ((stderr, "Splitting off stack %lu from %lu.\n",
+                          (unsigned long int) yynewStack,
+                          (unsigned long int) yyk));
               yyflag = yyglrReduce (yystackp, yynewStack,
                                     *yyconflicts,
                                     yyimmediate[*yyconflicts], yyparser, ps);
@@ -3120,7 +3025,8 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
                                           yyposn, yylocp, yyparser, ps));
               else if (yyflag == yyerr)
                 {
-                  YY_DPRINTF ((stderr, "Stack %ld dies.\n", YY_CAST (long, yynewStack)));
+                  YYDPRINTF ((stderr, "Stack %lu dies.\n",
+                              (unsigned long int) yynewStack));
                   yymarkStackDeleted (yystackp, yynewStack);
                 }
               else
@@ -3132,7 +3038,8 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
             break;
           else if (yyisErrorAction (yyaction))
             {
-              YY_DPRINTF ((stderr, "Stack %ld dies.\n", YY_CAST (long, yyk)));
+              YYDPRINTF ((stderr, "Stack %lu dies.\n",
+                          (unsigned long int) yyk));
               yymarkStackDeleted (yystackp, yyk);
               break;
             }
@@ -3142,10 +3049,10 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
                                                 yyimmediate[-yyaction], yyparser, ps);
               if (yyflag == yyerr)
                 {
-                  YY_DPRINTF ((stderr,
-                               "Stack %ld dies "
-                               "(predicate failure or explicit user error).\n",
-                               YY_CAST (long, yyk)));
+                  YYDPRINTF ((stderr,
+                              "Stack %lu dies "
+                              "(predicate failure or explicit user error).\n",
+                              (unsigned long int) yyk));
                   yymarkStackDeleted (yystackp, yyk);
                   break;
                 }
@@ -3167,18 +3074,18 @@ yyreportSyntaxError (yyGLRStack* yystackp, yy::parser& yyparser, tidl::Parser* p
 #else
   {
   yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+  size_t yysize0 = yytnamerr (YY_NULLPTR, yytokenName (yytoken));
+  size_t yysize = yysize0;
   yybool yysize_overflow = yyfalse;
   char* yymsg = YY_NULLPTR;
   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
   /* Internationalized format string. */
   const char *yyformat = YY_NULLPTR;
-  /* Arguments of yyformat: reported tokens (one for the "unexpected",
-     one per "expected"). */
+  /* Arguments of yyformat. */
   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-  /* Actual size of YYARG. */
+  /* Number of reported tokens (one for the "unexpected", one per
+     "expected").  */
   int yycount = 0;
-  /* Cumulated lengths of YYARG.  */
-  ptrdiff_t yysize = 0;
 
   /* There are many possibilities here to consider:
      - If this state is a consistent state with a default action, then
@@ -3206,8 +3113,6 @@ yyreportSyntaxError (yyGLRStack* yystackp, yy::parser& yyparser, tidl::Parser* p
   if (yytoken != YYEMPTY)
     {
       int yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
-      ptrdiff_t yysize0 = yytnamerr (YY_NULLPTR, yytokenName (yytoken));
-      yysize = yysize0;
       yyarg[yycount++] = yytokenName (yytoken);
       if (!yypact_value_is_default (yyn))
         {
@@ -3231,11 +3136,9 @@ yyreportSyntaxError (yyGLRStack* yystackp, yy::parser& yyparser, tidl::Parser* p
                   }
                 yyarg[yycount++] = yytokenName (yyx);
                 {
-                  ptrdiff_t yysz = yytnamerr (YY_NULLPTR, yytokenName (yyx));
-                  if (YYSIZEMAX - yysize < yysz)
-                    yysize_overflow = yytrue;
-                  else
-                    yysize += yysz;
+                  size_t yysz = yysize + yytnamerr (YY_NULLPTR, yytokenName (yyx));
+                  yysize_overflow |= yysz < yysize;
+                  yysize = yysz;
                 }
               }
         }
@@ -3247,7 +3150,6 @@ yyreportSyntaxError (yyGLRStack* yystackp, yy::parser& yyparser, tidl::Parser* p
       case N:                           \
         yyformat = S;                   \
       break
-    default: /* Avoid compiler warnings. */
       YYCASE_(0, YY_("syntax error"));
       YYCASE_(1, YY_("syntax error, unexpected %s"));
       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
@@ -3258,17 +3160,13 @@ yyreportSyntaxError (yyGLRStack* yystackp, yy::parser& yyparser, tidl::Parser* p
     }
 
   {
-    /* Don't count the "%s"s in the final size, but reserve room for
-       the terminator.  */
-    ptrdiff_t yysz = YY_CAST (ptrdiff_t, strlen (yyformat)) - 2 * yycount + 1;
-    if (YYSIZEMAX - yysize < yysz)
-      yysize_overflow = yytrue;
-    else
-      yysize += yysz;
+    size_t yysz = yysize + strlen (yyformat);
+    yysize_overflow |= yysz < yysize;
+    yysize = yysz;
   }
 
   if (!yysize_overflow)
-    yymsg = YY_CAST (char *, YYMALLOC (YY_CAST (size_t, yysize)));
+    yymsg = (char *) YYMALLOC (yysize);
 
   if (yymsg)
     {
@@ -3283,8 +3181,8 @@ yyreportSyntaxError (yyGLRStack* yystackp, yy::parser& yyparser, tidl::Parser* p
             }
           else
             {
-              ++yyp;
-              ++yyformat;
+              yyp++;
+              yyformat++;
             }
         }
       yyerror (&yylloc, yyparser, ps, yymsg);
@@ -3306,13 +3204,15 @@ yyreportSyntaxError (yyGLRStack* yystackp, yy::parser& yyparser, tidl::Parser* p
 static void
 yyrecoverSyntaxError (yyGLRStack* yystackp, yy::parser& yyparser, tidl::Parser* ps)
 {
+  size_t yyk;
+  int yyj;
+
   if (yystackp->yyerrState == 3)
     /* We just shifted the error token and (perhaps) took some
        reductions.  Skip tokens until we can proceed.  */
     while (yytrue)
       {
         yySymbol yytoken;
-        int yyj;
         if (yychar == YYEOF)
           yyFail (yystackp, &yylloc, yyparser, ps, YY_NULLPTR);
         if (yychar != YYEMPTY)
@@ -3327,9 +3227,19 @@ yyrecoverSyntaxError (yyGLRStack* yystackp, yy::parser& yyparser, tidl::Parser*
             yytoken = YYTRANSLATE (yychar);
             yydestruct ("Error: discarding",
                         yytoken, &yylval, &yylloc, yyparser, ps);
-            yychar = YYEMPTY;
           }
-        yytoken = yygetToken (&yychar, yystackp, yyparser, ps);
+        YYDPRINTF ((stderr, "Reading a token: "));
+        yychar = yylex (&yylval, &yylloc, lex_scanner);
+        if (yychar <= YYEOF)
+          {
+            yychar = yytoken = YYEOF;
+            YYDPRINTF ((stderr, "Now at end of input.\n"));
+          }
+        else
+          {
+            yytoken = YYTRANSLATE (yychar);
+            YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+          }
         yyj = yypact[yystackp->yytops.yystates[0]->yylrState];
         if (yypact_value_is_default (yyj))
           return;
@@ -3344,25 +3254,22 @@ yyrecoverSyntaxError (yyGLRStack* yystackp, yy::parser& yyparser, tidl::Parser*
       }
 
   /* Reduce to one stack.  */
-  {
-    ptrdiff_t yyk;
-    for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1)
-      if (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
-        break;
-    if (yyk >= yystackp->yytops.yysize)
-      yyFail (yystackp, &yylloc, yyparser, ps, YY_NULLPTR);
-    for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1)
-      yymarkStackDeleted (yystackp, yyk);
-    yyremoveDeletes (yystackp);
-    yycompressStack (yystackp);
-  }
+  for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1)
+    if (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
+      break;
+  if (yyk >= yystackp->yytops.yysize)
+    yyFail (yystackp, &yylloc, yyparser, ps, YY_NULLPTR);
+  for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1)
+    yymarkStackDeleted (yystackp, yyk);
+  yyremoveDeletes (yystackp);
+  yycompressStack (yystackp);
 
   /* Now pop stack until we find a state that shifts the error token.  */
   yystackp->yyerrState = 3;
   while (yystackp->yytops.yystates[0] != YY_NULLPTR)
     {
       yyGLRState *yys = yystackp->yytops.yystates[0];
-      int yyj = yypact[yys->yylrState];
+      yyj = yypact[yys->yylrState];
       if (! yypact_value_is_default (yyj))
         {
           yyj += YYTERROR;
@@ -3370,14 +3277,13 @@ yyrecoverSyntaxError (yyGLRStack* yystackp, yy::parser& yyparser, tidl::Parser*
               && yyisShiftAction (yytable[yyj]))
             {
               /* Shift the error token.  */
-              int yyaction = yytable[yyj];
               /* First adjust its location.*/
               YYLTYPE yyerrloc;
               yystackp->yyerror_range[2].yystate.yyloc = yylloc;
               YYLLOC_DEFAULT (yyerrloc, (yystackp->yyerror_range), 2);
-              YY_SYMBOL_PRINT ("Shifting", yystos[yyaction],
+              YY_SYMBOL_PRINT ("Shifting", yystos[yytable[yyj]],
                                &yylval, &yyerrloc);
-              yyglrShift (yystackp, 0, yyaction,
+              yyglrShift (yystackp, 0, yytable[yyj],
                           yys->yyposn, &yylval, &yyerrloc);
               yys = yystackp->yytops.yystates[0];
               break;
@@ -3420,18 +3326,17 @@ yyparse (yy::parser& yyparser, tidl::Parser* ps)
   int yyresult;
   yyGLRStack yystack;
   yyGLRStack* const yystackp = &yystack;
-  ptrdiff_t yyposn;
+  size_t yyposn;
 
-  YY_DPRINTF ((stderr, "Starting parse\n"));
+  YYDPRINTF ((stderr, "Starting parse\n"));
 
   yychar = YYEMPTY;
   yylval = yyval_default;
   yylloc = yyloc_default;
 
-  // User initialization code.
-yylloc.initialize ();
-#line 3434 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
-
+  /* User initialization code.  */
+  yylloc.initialize ();
+#line 3340 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:2270
 
   if (! yyinitGLRStack (yystackp, YYINITDEPTH))
     goto yyexhaustedlab;
@@ -3453,16 +3358,20 @@ yylloc.initialize ();
       /* Standard mode */
       while (yytrue)
         {
+          yyRuleNum yyrule;
+          int yyaction;
+          const short int* yyconflicts;
+
           yyStateNum yystate = yystack.yytops.yystates[0]->yylrState;
-          YY_DPRINTF ((stderr, "Entering state %d\n", yystate));
+          YYDPRINTF ((stderr, "Entering state %d\n", yystate));
           if (yystate == YYFINAL)
             goto yyacceptlab;
           if (yyisDefaultedState (yystate))
             {
-              yyRuleNum yyrule = yydefaultAction (yystate);
+              yyrule = yydefaultAction (yystate);
               if (yyrule == 0)
                 {
-                  yystack.yyerror_range[1].yystate.yyloc = yylloc;
+               yystack.yyerror_range[1].yystate.yyloc = yylloc;
                   yyreportSyntaxError (&yystack, yyparser, ps);
                   goto yyuser_error;
                 }
@@ -3470,9 +3379,25 @@ yylloc.initialize ();
             }
           else
             {
-              yySymbol yytoken = yygetToken (&yychar, yystackp, yyparser, ps);
-              const short* yyconflicts;
-              int yyaction = yygetLRActions (yystate, yytoken, &yyconflicts);
+              yySymbol yytoken;
+              if (yychar == YYEMPTY)
+                {
+                  YYDPRINTF ((stderr, "Reading a token: "));
+                  yychar = yylex (&yylval, &yylloc, lex_scanner);
+                }
+
+              if (yychar <= YYEOF)
+                {
+                  yychar = yytoken = YYEOF;
+                  YYDPRINTF ((stderr, "Now at end of input.\n"));
+                }
+              else
+                {
+                  yytoken = YYTRANSLATE (yychar);
+                  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+                }
+
+              yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
               if (*yyconflicts != 0)
                 break;
               if (yyisShiftAction (yyaction))
@@ -3486,11 +3411,8 @@ yylloc.initialize ();
                 }
               else if (yyisErrorAction (yyaction))
                 {
-                  yystack.yyerror_range[1].yystate.yyloc = yylloc;
-                  /* Don't issue an error message again for exceptions
-                     thrown from the scanner.  */
-                  if (yychar != YYFAULTYTOK)
-                    yyreportSyntaxError (&yystack, yyparser, ps);
+               yystack.yyerror_range[1].yystate.yyloc = yylloc;
+                  yyreportSyntaxError (&yystack, yyparser, ps);
                   goto yyuser_error;
                 }
               else
@@ -3501,7 +3423,7 @@ yylloc.initialize ();
       while (yytrue)
         {
           yySymbol yytoken_to_shift;
-          ptrdiff_t yys;
+          size_t yys;
 
           for (yys = 0; yys < yystack.yytops.yysize; yys += 1)
             yystackp->yytops.yylookaheadNeeds[yys] = yychar != YYEMPTY;
@@ -3534,8 +3456,8 @@ yylloc.initialize ();
               if (yystack.yytops.yysize == 0)
                 yyFail (&yystack, &yylloc, yyparser, ps, YY_("syntax error"));
               YYCHK1 (yyresolveStack (&yystack, yyparser, ps));
-              YY_DPRINTF ((stderr, "Returning to deterministic operation.\n"));
-              yystack.yyerror_range[1].yystate.yyloc = yylloc;
+              YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
+           yystack.yyerror_range[1].yystate.yyloc = yylloc;
               yyreportSyntaxError (&yystack, yyparser, ps);
               goto yyuser_error;
             }
@@ -3550,24 +3472,25 @@ yylloc.initialize ();
           yyposn += 1;
           for (yys = 0; yys < yystack.yytops.yysize; yys += 1)
             {
+              int yyaction;
+              const short int* yyconflicts;
               yyStateNum yystate = yystack.yytops.yystates[yys]->yylrState;
-              const short* yyconflicts;
-              int yyaction = yygetLRActions (yystate, yytoken_to_shift,
+              yygetLRActions (yystate, yytoken_to_shift, &yyaction,
                               &yyconflicts);
               /* Note that yyconflicts were handled by yyprocessOneStack.  */
-              YY_DPRINTF ((stderr, "On stack %ld, ", YY_CAST (long, yys)));
+              YYDPRINTF ((stderr, "On stack %lu, ", (unsigned long int) yys));
               YY_SYMBOL_PRINT ("shifting", yytoken_to_shift, &yylval, &yylloc);
               yyglrShift (&yystack, yys, yyaction, yyposn,
                           &yylval, &yylloc);
-              YY_DPRINTF ((stderr, "Stack %ld now in state #%d\n",
-                           YY_CAST (long, yys),
-                           yystack.yytops.yystates[yys]->yylrState));
+              YYDPRINTF ((stderr, "Stack %lu now in state #%d\n",
+                          (unsigned long int) yys,
+                          yystack.yytops.yystates[yys]->yylrState));
             }
 
           if (yystack.yytops.yysize == 1)
             {
               YYCHK1 (yyresolveStack (&yystack, yyparser, ps));
-              YY_DPRINTF ((stderr, "Returning to deterministic operation.\n"));
+              YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
               yycompressStack (&yystack);
               break;
             }
@@ -3583,7 +3506,7 @@ yylloc.initialize ();
   goto yyreturn;
 
  yybuglab:
-  YY_ASSERT (yyfalse);
+  YYASSERT (yyfalse);
   goto yyabortlab;
 
  yyabortlab:
@@ -3608,16 +3531,16 @@ yylloc.initialize ();
       yyGLRState** yystates = yystack.yytops.yystates;
       if (yystates)
         {
-          ptrdiff_t yysize = yystack.yytops.yysize;
-          ptrdiff_t yyk;
+          size_t yysize = yystack.yytops.yysize;
+          size_t yyk;
           for (yyk = 0; yyk < yysize; yyk += 1)
             if (yystates[yyk])
               {
                 while (yystates[yyk])
                   {
                     yyGLRState *yys = yystates[yyk];
-                    yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;
-                    if (yys->yypred != YY_NULLPTR)
+                 yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;
+                  if (yys->yypred != YY_NULLPTR)
                       yydestroyGLRState ("Cleanup: popping", yys, yyparser, ps);
                     yystates[yyk] = yys->yypred;
                     yystack.yynextFree -= 1;
@@ -3640,74 +3563,70 @@ yy_yypstack (yyGLRState* yys)
   if (yys->yypred)
     {
       yy_yypstack (yys->yypred);
-      YY_FPRINTF ((stderr, " -> "));
+      YYFPRINTF (stderr, " -> ");
     }
-  YY_FPRINTF ((stderr, "%d@%ld", yys->yylrState, YY_CAST (long, yys->yyposn)));
+  YYFPRINTF (stderr, "%d@%lu", yys->yylrState,
+             (unsigned long int) yys->yyposn);
 }
 
 static void
 yypstates (yyGLRState* yyst)
 {
   if (yyst == YY_NULLPTR)
-    YY_FPRINTF ((stderr, "<null>"));
+    YYFPRINTF (stderr, "<null>");
   else
     yy_yypstack (yyst);
-  YY_FPRINTF ((stderr, "\n"));
+  YYFPRINTF (stderr, "\n");
 }
 
 static void
-yypstack (yyGLRStack* yystackp, ptrdiff_t yyk)
+yypstack (yyGLRStack* yystackp, size_t yyk)
 {
   yypstates (yystackp->yytops.yystates[yyk]);
 }
 
+#define YYINDEX(YYX)                                                         \
+    ((YYX) == YY_NULLPTR ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems)
+
+
 static void
 yypdumpstack (yyGLRStack* yystackp)
 {
-#define YYINDEX(YYX)                                                    \
-  YY_CAST (long,                                                        \
-           ((YYX)                                                       \
-            ? YY_REINTERPRET_CAST (yyGLRStackItem*, (YYX)) - yystackp->yyitems \
-            : -1))
-
   yyGLRStackItem* yyp;
+  size_t yyi;
   for (yyp = yystackp->yyitems; yyp < yystackp->yynextFree; yyp += 1)
     {
-      YY_FPRINTF ((stderr, "%3ld. ",
-                   YY_CAST (long, yyp - yystackp->yyitems)));
-      if (*YY_REINTERPRET_CAST (yybool *, yyp))
+      YYFPRINTF (stderr, "%3lu. ",
+                 (unsigned long int) (yyp - yystackp->yyitems));
+      if (*(yybool *) yyp)
         {
-          YY_ASSERT (yyp->yystate.yyisState);
-          YY_ASSERT (yyp->yyoption.yyisState);
-          YY_FPRINTF ((stderr, "Res: %d, LR State: %d, posn: %ld, pred: %ld",
-                       yyp->yystate.yyresolved, yyp->yystate.yylrState,
-                       YY_CAST (long, yyp->yystate.yyposn),
-                       YYINDEX (yyp->yystate.yypred)));
+          YYASSERT (yyp->yystate.yyisState);
+          YYASSERT (yyp->yyoption.yyisState);
+          YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
+                     yyp->yystate.yyresolved, yyp->yystate.yylrState,
+                     (unsigned long int) yyp->yystate.yyposn,
+                     (long int) YYINDEX (yyp->yystate.yypred));
           if (! yyp->yystate.yyresolved)
-            YY_FPRINTF ((stderr, ", firstVal: %ld",
-                         YYINDEX (yyp->yystate.yysemantics.yyfirstVal)));
+            YYFPRINTF (stderr, ", firstVal: %ld",
+                       (long int) YYINDEX (yyp->yystate
+                                             .yysemantics.yyfirstVal));
         }
       else
         {
-          YY_ASSERT (!yyp->yystate.yyisState);
-          YY_ASSERT (!yyp->yyoption.yyisState);
-          YY_FPRINTF ((stderr, "Option. rule: %d, state: %ld, next: %ld",
-                       yyp->yyoption.yyrule - 1,
-                       YYINDEX (yyp->yyoption.yystate),
-                       YYINDEX (yyp->yyoption.yynext)));
+          YYASSERT (!yyp->yystate.yyisState);
+          YYASSERT (!yyp->yyoption.yyisState);
+          YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld",
+                     yyp->yyoption.yyrule - 1,
+                     (long int) YYINDEX (yyp->yyoption.yystate),
+                     (long int) YYINDEX (yyp->yyoption.yynext));
         }
-      YY_FPRINTF ((stderr, "\n"));
+      YYFPRINTF (stderr, "\n");
     }
-
-  YY_FPRINTF ((stderr, "Tops:"));
-  {
-    ptrdiff_t yyi;
-    for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
-      YY_FPRINTF ((stderr, "%ld: %ld; ", YY_CAST (long, yyi),
-                   YYINDEX (yystackp->yytops.yystates[yyi])));
-    YY_FPRINTF ((stderr, "\n"));
-  }
-#undef YYINDEX
+  YYFPRINTF (stderr, "Tops:");
+  for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
+    YYFPRINTF (stderr, "%lu: %ld; ", (unsigned long int) yyi,
+               (long int) YYINDEX (yystackp->yytops.yystates[yyi]));
+  YYFPRINTF (stderr, "\n");
 }
 #endif
 
@@ -3718,7 +3637,7 @@ yypdumpstack (yyGLRStack* yystackp)
 
 
 
-#line 518 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
+#line 547 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.c:2584
 
 
 #include <ctype.h>
@@ -3730,7 +3649,7 @@ void yy::parser::error(const yy::parser::location_type& l,
 }
 
 
-#line 3734 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 3653 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:2584
 
 /*------------------.
 | Report an error.  |
@@ -3745,9 +3664,9 @@ yyerror (const yy::parser::location_type *yylocationp, yy::parser& yyparser, tid
 }
 
 
-namespace yy {
-#line 3750 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
 
+namespace yy {
+#line 3670 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:2584
   /// Build a parser object.
   parser::parser (tidl::Parser* ps_yyarg)
     :
@@ -3755,18 +3674,11 @@ namespace yy {
       yycdebug_ (&std::cerr),
 #endif
       ps (ps_yyarg)
-  {}
+  {
+  }
 
   parser::~parser ()
-  {}
-
-  parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
-  {}
-
-  int
-  parser::operator() ()
   {
-    return parse ();
   }
 
   int
@@ -3780,16 +3692,16 @@ namespace yy {
   | Print this symbol.  |
   `--------------------*/
 
-  void
+  inline void
   parser::yy_symbol_value_print_ (int yytype,
                            const semantic_type* yyvaluep,
                            const location_type* yylocationp)
   {
     YYUSE (yylocationp);
     YYUSE (yyvaluep);
-    std::ostream& yyo = debug_stream ();
-    std::ostream& yyoutput = yyo;
-    YYUSE (yyoutput);
+    std::ostream& yyoutput = debug_stream ();
+    std::ostream& yyo = yyoutput;
+    YYUSE (yyo);
     YYUSE (yytype);
   }
 
@@ -3833,5 +3745,6 @@ namespace yy {
   }
 
 #endif
+
 } // yy
-#line 3838 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.cpp"
+#line 3751 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.cpp" // glr.c:2584
index f636ddf9ad0ee2ce2ac18c36541322a1eb436c9d..1bae094548ac7db4cfa660a10582831ea62b58e9 100644 (file)
@@ -1,8 +1,8 @@
-// A Bison parser, made by GNU Bison 3.5.1.
+// A Bison parser, made by GNU Bison 3.0.4.
 
 // Skeleton interface for Bison GLR parsers in C++
 
-// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
+// Copyright (C) 2002-2015 Free Software Foundation, Inc.
 
 // This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 
 // C++ GLR parser skeleton written by Akim Demaille.
 
-// Undocumented macros, especially those whose name start with YY_,
-// are private implementation details.  Do not rely on them.
+#ifndef YY_YY_HOME_GBS_WORKSPACE_CLONE_PUBLIC_APPFW_TIDL_IDLC_AST_TIDLC_Y_HPP_INCLUDED
+# define YY_YY_HOME_GBS_WORKSPACE_CLONE_PUBLIC_APPFW_TIDL_IDLC_AST_TIDLC_Y_HPP_INCLUDED
 
-#ifndef YY_YY_HOME_UPPLE_TIZEN_APPFW_TIDL_IDLC_AST_TIDLC_Y_HPP_INCLUDED
-# define YY_YY_HOME_UPPLE_TIZEN_APPFW_TIDL_IDLC_AST_TIDLC_Y_HPP_INCLUDED
 
-#include <iostream>
 #include <stdexcept>
 #include <string>
-
-#if defined __cplusplus
-# define YY_CPLUSPLUS __cplusplus
-#else
-# define YY_CPLUSPLUS 199711L
-#endif
-
-// Support move semantics when possible.
-#if 201103L <= YY_CPLUSPLUS
-# define YY_MOVE           std::move
-# define YY_MOVE_OR_COPY   move
-# define YY_MOVE_REF(Type) Type&&
-# define YY_RVREF(Type)    Type&&
-# define YY_COPY(Type)     Type
-#else
-# define YY_MOVE
-# define YY_MOVE_OR_COPY   copy
-# define YY_MOVE_REF(Type) Type&
-# define YY_RVREF(Type)    const Type&
-# define YY_COPY(Type)     const Type&
-#endif
-
-// Support noexcept when possible.
-#if 201103L <= YY_CPLUSPLUS
-# define YY_NOEXCEPT noexcept
-# define YY_NOTHROW
-#else
-# define YY_NOEXCEPT
-# define YY_NOTHROW throw ()
-#endif
-
-// Support constexpr when possible.
-#if 201703 <= YY_CPLUSPLUS
-# define YY_CONSTEXPR constexpr
-#else
-# define YY_CONSTEXPR
-#endif
-# include "location.hh"
-
-
-#ifndef YY_ATTRIBUTE_PURE
-# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
-#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
-# else
-#  define YY_ATTRIBUTE_PURE
-# endif
-#endif
-
-#ifndef YY_ATTRIBUTE_UNUSED
-# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
-#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
-# else
-#  define YY_ATTRIBUTE_UNUSED
-# endif
-#endif
-
-/* Suppress unused-variable warnings by "using" E.  */
-#if ! defined lint || defined __GNUC__
-# define YYUSE(E) ((void) (E))
-#else
-# define YYUSE(E) /* empty */
-#endif
-
-#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
-/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
-    _Pragma ("GCC diagnostic push")                                     \
-    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
-    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
-    _Pragma ("GCC diagnostic pop")
-#else
-# define YY_INITIAL_VALUE(Value) Value
-#endif
-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END
-#endif
-#ifndef YY_INITIAL_VALUE
-# define YY_INITIAL_VALUE(Value) /* Nothing. */
-#endif
-
-#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
-# define YY_IGNORE_USELESS_CAST_BEGIN                          \
-    _Pragma ("GCC diagnostic push")                            \
-    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
-# define YY_IGNORE_USELESS_CAST_END            \
-    _Pragma ("GCC diagnostic pop")
-#endif
-#ifndef YY_IGNORE_USELESS_CAST_BEGIN
-# define YY_IGNORE_USELESS_CAST_BEGIN
-# define YY_IGNORE_USELESS_CAST_END
-#endif
-
-# ifndef YY_NULLPTR
-#  if defined __cplusplus
-#   if 201103L <= __cplusplus
-#    define YY_NULLPTR nullptr
-#   else
-#    define YY_NULLPTR 0
-#   endif
-#  else
-#   define YY_NULLPTR ((void*)0)
-#  endif
-# endif
-
-// This skeleton is based on C, yet compiles it as C++.
-// So expect warnings about C style casts.
-#if defined __clang__ && 306 <= __clang_major__ * 100 + __clang_minor__
-# pragma clang diagnostic ignored "-Wold-style-cast"
-#elif defined __GNUC__ && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
-# pragma GCC diagnostic ignored "-Wold-style-cast"
-#endif
-
-// On MacOS, PTRDIFF_MAX is defined as long long, which Clang's
-// -pedantic reports as being a C++11 extension.
-#if defined __APPLE__ && YY_CPLUSPLUS < 201103L \
-    && defined __clang__ && 4 <= __clang_major__
-# pragma clang diagnostic ignored "-Wc++11-long-long"
-#endif
-
-// Whether we are compiled with exception support.
-#ifndef YY_EXCEPTIONS
-# if defined __GNUC__ && !defined __EXCEPTIONS
-#  define YY_EXCEPTIONS 0
-# else
-#  define YY_EXCEPTIONS 1
-# endif
-#endif
+#include <iostream>
+#include "location.hh"
 
 /* Debug traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
 #endif
 
-namespace yy {
-#line 181 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.hpp"
-
 
+namespace yy {
+#line 52 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.hpp" // glr.cc:329
 
 
   /// A Bison parser.
@@ -190,7 +59,7 @@ namespace yy {
     /// Symbol semantic values.
     union semantic_type
     {
-#line 37 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc.yy"
+    #line 37 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc.yy" // glr.cc:329
 
   tidl::Document* doc;
   tidl::Interface* interf;
@@ -203,14 +72,14 @@ namespace yy {
   tidl::Parameters* params;
   tidl::Token* token;
   tidl::Structure* structure;
+  tidl::Block* protocol;
   tidl::Element* elm;
   tidl::Elements* elms;
   tidl::Block* blk;
   tidl::Attribute* attr;
   tidl::Attributes* attrs;
 
-#line 213 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.hpp"
-
+#line 83 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.hpp" // glr.cc:329
     };
 #else
     typedef YYSTYPE semantic_type;
@@ -221,18 +90,7 @@ namespace yy {
     /// Syntax errors thrown from user actions.
     struct syntax_error : std::runtime_error
     {
-      syntax_error (const location_type& l, const std::string& m)
-        : std::runtime_error (m)
-        , location (l)
-      {}
-
-      syntax_error (const syntax_error& s)
-        : std::runtime_error (s.what ())
-        , location (s.location)
-      {}
-
-      ~syntax_error () YY_NOEXCEPT YY_NOTHROW;
-
+      syntax_error (const location_type& l, const std::string& m);
       location_type location;
     };
 
@@ -257,24 +115,26 @@ namespace yy {
         T_DELEGATE = 271,
         T_UNKNOWN = 272,
         T_ID = 273,
-        T_STRUCTURE = 274,
-        T_INTERFACE = 275,
-        T_CHAR = 276,
-        T_SHORT = 277,
-        T_INT = 278,
-        T_LONG = 279,
-        T_FLOAT = 280,
-        T_DOUBLE = 281,
-        T_VOID = 282,
-        T_BUNDLE = 283,
-        T_STRING = 284,
-        T_BOOL = 285,
-        T_LIST = 286,
-        T_ARRAY = 287,
-        T_VALUE = 288,
-        T_SB_OPEN = 289,
-        T_SB_CLOSE = 290,
-        T_FILE = 291
+        T_NUMBER = 274,
+        T_STRUCTURE = 275,
+        T_INTERFACE = 276,
+        T_CHAR = 277,
+        T_SHORT = 278,
+        T_INT = 279,
+        T_LONG = 280,
+        T_FLOAT = 281,
+        T_DOUBLE = 282,
+        T_VOID = 283,
+        T_BUNDLE = 284,
+        T_STRING = 285,
+        T_BOOL = 286,
+        T_LIST = 287,
+        T_ARRAY = 288,
+        T_VALUE = 289,
+        T_SB_OPEN = 290,
+        T_SB_CLOSE = 291,
+        T_FILE = 292,
+        T_PROTOCOL = 293
       };
     };
 
@@ -288,22 +148,105 @@ namespace yy {
     enum { empty_symbol = -2 };
 
     /// Internal symbol number for tokens (subsumed by symbol_number_type).
-    typedef signed char token_number_type;
+    typedef unsigned char token_number_type;
+
+    /// A complete symbol.
+    ///
+    /// Expects its Base type to provide access to the symbol type
+    /// via type_get().
+    ///
+    /// Provide access to semantic value and location.
+    template <typename Base>
+    struct basic_symbol : Base
+    {
+      /// Alias to Base.
+      typedef Base super_type;
+
+      /// Default constructor.
+      basic_symbol ();
+
+      /// Copy constructor.
+      basic_symbol (const basic_symbol& other);
+
+      /// Constructor for valueless symbols.
+      basic_symbol (typename Base::kind_type t,
+                    const location_type& l);
+
+      /// Constructor for symbols with semantic value.
+      basic_symbol (typename Base::kind_type t,
+                    const semantic_type& v,
+                    const location_type& l);
+
+      /// Destroy the symbol.
+      ~basic_symbol ();
+
+      /// Destroy contents, and record that is empty.
+      void clear ();
+
+      /// Whether empty.
+      bool empty () const;
+
+      /// Destructive move, \a s is emptied into this.
+      void move (basic_symbol& s);
+
+      /// The semantic value.
+      semantic_type value;
+
+      /// The location.
+      location_type location;
+
+    private:
+      /// Assignment operator.
+      basic_symbol& operator= (const basic_symbol& other);
+    };
+
+    /// Type access provider for token (enum) based symbols.
+    struct by_type
+    {
+      /// Default constructor.
+      by_type ();
+
+      /// Copy constructor.
+      by_type (const by_type& other);
+
+      /// The symbol type as needed by the constructor.
+      typedef token_type kind_type;
+
+      /// Constructor from (external) token numbers.
+      by_type (kind_type t);
+
+      /// Record that this symbol is empty.
+      void clear ();
+
+      /// Steal the symbol type from \a that.
+      void move (by_type& that);
+
+      /// The (internal) type number (corresponding to \a type).
+      /// \a empty when empty.
+      symbol_number_type type_get () const;
+
+      /// The token.
+      token_type token () const;
+
+      /// The symbol type.
+      /// \a empty_symbol when empty.
+      /// An int, not token_number_type, to be able to store empty_symbol.
+      int type;
+    };
+
+    /// "External" symbols: returned by the scanner.
+    typedef basic_symbol<by_type> symbol_type;
+
 
 
     /// Build a parser object.
     parser (tidl::Parser* ps_yyarg);
     virtual ~parser ();
 
-    /// Parse.  An alias for parse ().
-    /// \returns  0 iff parsing succeeded.
-    int operator() ();
-
     /// Parse.
     /// \returns  0 iff parsing succeeded.
     virtual int parse ();
 
-#if YYDEBUG
     /// The current debugging stream.
     std::ostream& debug_stream () const;
     /// Set the current debugging stream.
@@ -315,8 +258,8 @@ namespace yy {
     debug_level_type debug_level () const;
     /// Set the current debugging level.
     void set_debug_level (debug_level_type l);
-#endif
 
+  public:
     /// Report a syntax error.
     /// \param loc    where the syntax error is found.
     /// \param msg    a description of the syntax error.
@@ -357,9 +300,9 @@ namespace yy {
 # define YYLTYPE yy::parser::location_type
 #endif
 
-} // yy
-#line 362 "/home/upple/tizen/appfw/tidl/idlc/ast/tidlc_y.hpp"
 
+} // yy
+#line 306 "/home/gbs/workspace/clone/public/appfw/tidl/idlc/ast/tidlc_y.hpp" // glr.cc:329
 
 
-#endif // !YY_YY_HOME_UPPLE_TIZEN_APPFW_TIDL_IDLC_AST_TIDLC_Y_HPP_INCLUDED
+#endif // !YY_YY_HOME_GBS_WORKSPACE_CLONE_PUBLIC_APPFW_TIDL_IDLC_AST_TIDLC_Y_HPP_INCLUDED
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_c_transportable.cc b/idlc/gen_aitt_plugin/aitt_plugin_c_transportable.cc
deleted file mode 100644 (file)
index 80d8a5c..0000000
+++ /dev/null
@@ -1,1201 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "idlc/gen_aitt_plugin/aitt_plugin_c_transportable.h"
-
-#include <utility>
-
-#include "idlc/gen/replace_all.h"
-
-namespace {
-
-constexpr const char __CLINET_FILE_SEND[] =
-R"__c_cb(
-    <INTERNAL_PREFIX>_payload_h pl;
-    int ret = <INTERNAL_PREFIX>_payload_create(&pl, AITT_PLUGIN_PAYLOAD_TYPE_FILE);
-
-    if (ret != AITT_PLUGIN_ERROR_NONE) {
-      _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret);
-      return ret;
-    }
-
-    ret = <INTERNAL_PREFIX>_payload_set_file_path(pl, <FILE_PATH>);
-    if (ret != AITT_PLUGIN_ERROR_NONE) {
-      _E("Failed to <INTERNAL_PREFIX>_payload_set_file_path : %d - %s", ret, value);
-      <INTERNAL_PREFIX>_payload_destroy(pl);
-      return ret;
-    }
-
-    ret = <INTERNAL_PREFIX>_client_send_payload_async(<CLIENT_H>, pl, NULL, NULL);
-    if (ret != AITT_PLUGIN_ERROR_NONE) {
-      _E("Failed to <INTERNAL_PREFIX>_client_send_payload_async : %d - %s", ret, value);
-      <INTERNAL_PREFIX>_payload_destroy(pl);
-      return ret;
-    }
-
-    <INTERNAL_PREFIX>_payload_destroy(pl);
-)__c_cb";
-
-constexpr const char __SERVER_FILE_SEND[] =
-R"__c_cb(
-    <INTERNAL_PREFIX>_payload_h pl;
-    int r = <INTERNAL_PREFIX>_payload_create(&pl, AITT_PLUGIN_PAYLOAD_TYPE_FILE);
-
-    if (r != AITT_PLUGIN_ERROR_NONE) {
-      _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", r);
-      return r;
-    }
-
-    r = <INTERNAL_PREFIX>_payload_set_file_path(pl, <FILE_PATH>);
-    if (r != AITT_PLUGIN_ERROR_NONE) {
-      _E("Failed to <INTERNAL_PREFIX>_payload_set_file_path : %d - %s", r, value);
-      <INTERNAL_PREFIX>_payload_destroy(pl);
-      return r;
-    }
-
-    r = <INTERNAL_PREFIX>_server_send_payload_async(<SERVER_H>, <PEER_H>, pl, NULL, NULL);
-    if (r != AITT_PLUGIN_ERROR_NONE) {
-      _E("Failed to <INTERNAL_PREFIX>_server_send_payload_async : %d - %s", r, value);
-      <INTERNAL_PREFIX>_payload_destroy(pl);
-      return r;
-    }
-
-    <INTERNAL_PREFIX>_payload_destroy(pl);
-)__c_cb";
-
-constexpr const char __SERVER_REGISTER[] =
-R"__c_cb(
-
-  ret = <INTERNAL_PREFIX>_server_create(&__<NAME>.stub, service_name, display_name, broker_ip, broker_port, user_name, password, my_ip, protocols);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to create stub handle. error(%d)", ret);
-    <PREFIX>_<NAME>_unregister();
-    return ret;
-  }
-
-  ret = <INTERNAL_PREFIX>_server_add_connection_result_cb(__<NAME>.stub, __<PREFIX>_<NAME>_connection_result_cb, &__<NAME>);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to add connection result event callback");
-    <PREFIX>_<NAME>_unregister();
-    return ret;
-  }
-
-  ret = <INTERNAL_PREFIX>_server_add_payload_received_cb(__<NAME>.stub, __<PREFIX>_<NAME>_payload_received_cb, &__<NAME>);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to add payload recieved event callback");
-    <PREFIX>_<NAME>_unregister();
-    return ret;
-  }
-
-  ret = <INTERNAL_PREFIX>_server_add_disconnected_cb(__<NAME>.stub, __<PREFIX>_<NAME>_disconnected_cb, &__<NAME>);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to add disconnected event callback");
-    <PREFIX>_<NAME>_unregister();
-    return ret;
-  }
-
-  ret = <INTERNAL_PREFIX>_server_set_data_received_cb(__<NAME>.stub, __<PREFIX>_<NAME>_data_received_cb, &__<NAME>);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to add data recieved event callback");
-    <PREFIX>_<NAME>_unregister();
-    return ret;
-  }
-
-  ret = <INTERNAL_PREFIX>_server_listen(__<NAME>.stub, __<PREFIX>_<NAME>_connection_request_cb, &__<NAME>);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to listen events. error(%d)", ret);
-    <PREFIX>_<NAME>_unregister();
-    return ret;
-  }
-)__c_cb";
-
-constexpr const char __SERVER_UNREGISTER[] =
-R"__c_cb(
-  if (__<NAME>.stub) {
-    <INTERNAL_PREFIX>_server_destroy(__<NAME>.stub);
-    __<NAME>.stub = nullptr;
-  }
-)__c_cb";
-
-constexpr const char __SERVER_ACCEPT[] =
-R"__c_cb(
-  ret = <INTERNAL_PREFIX>_server_accept(__<NAME>.stub, peer_info);
-  if (ret != AITT_PLUGIN_ERROR_NONE)
-    _E("Failed to accept. error(%d)", ret);
-)__c_cb";
-
-constexpr const char __SERVER_REJECT[] =
-R"__c_cb(
-  ret = <INTERNAL_PREFIX>_server_reject(__<NAME>.stub, peer_info, reason);
-  if (ret != AITT_PLUGIN_ERROR_NONE)
-    _E("Failed to reject. error(%d)", ret);
-)__c_cb";
-
-constexpr const char __SERVER_SET_DISPLAY_NAME[] =
-R"__c_cb(
-  ret = <INTERNAL_PREFIX>_server_set_display_name(__<NAME>.stub, display_name);
-  if (ret != AITT_PLUGIN_ERROR_NONE)
-    _E("Failed to set display name. error(%d)", ret);
-)__c_cb";
-
-constexpr const char __CLIENT_TRY_CONNECT[] =
-R"__c_cb(
-  ret = <INTERNAL_PREFIX>_client_connect(<CLIENT>, <PEER>);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to connect to stub. error(%d)", ret);
-    return ret;
-  }
-)__c_cb";
-
-constexpr const char __CLIENT_DISCONNECT[] =
-R"__c_cb(
-  ret = <INTERNAL_PREFIX>_client_disconnect(<CLIENT>);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to disconnect to stub. error(%d)", ret);
-    return ret;
-  }
-)__c_cb";
-
-constexpr const char __CLIENT_TRY_DISCOVERY[] =
-R"__c_cb(
-  ret = <INTERNAL_PREFIX>_client_try_discovery(<CLIENT>, __<PREFIX>_<NAME>_discovered, h);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to discovery to stub. error(%d)", ret);
-    return ret;
-  }
-)__c_cb";
-
-constexpr const char __CLIENT_STOP_DISCOVERY[] =
-R"__c_cb(
-  ret = <INTERNAL_PREFIX>_client_stop_discovery(<CLIENT>);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to stop discovery to stub. error(%d)", ret);
-    return ret;
-  }
-)__c_cb";
-
-constexpr const char __CLIENT_SEND_ASYNC[] =
-R"__c_cb(
-  res_ = <INTERNAL_PREFIX>_payload_create(&<PAYLOAD>, AITT_PLUGIN_PAYLOAD_TYPE_DATA);
-  if (res_ != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", res_);
-    <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
-    goto out;
-  }
-
-  res_ = <INTERNAL_PREFIX>_payload_set_data(<PAYLOAD>, (const unsigned char*)data_, <SIZE>);
-  if (res_ != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_payload_set_data : %d", res_);
-    <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
-    goto out;
-  }
-
-  res_ = <INTERNAL_PREFIX>_client_send_payload_async(<CLIENT>, <PAYLOAD>, NULL, NULL);
-  <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
-  if (res_ != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_client_send_payload_async : %d", res_);
-    goto out;
-  }
-)__c_cb";
-
-constexpr const char __CLIENT_SEND[] =
-R"__c_cb(
-  res_ = <INTERNAL_PREFIX>_client_send_data(<CLIENT>, <DATA>, <DATA_SIZE> , 5 * 1000, &<RET_DATA>, &<RET_DATA_SIZE>);
-  if (res_ != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to send parcel. error(%d)", res_);
-    goto out;
-  }
-)__c_cb";
-
-constexpr const char __SERVER_SEND_ASYNC[] =
-R"__c_cb(
-  ret_ = <INTERNAL_PREFIX>_payload_create(&<PAYLOAD>, AITT_PLUGIN_PAYLOAD_TYPE_DATA);
-  if (ret_ != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret_);
-    <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
-    goto out;
-  }
-
-  ret_ = <INTERNAL_PREFIX>_payload_set_data(<PAYLOAD>, (const unsigned char*)data_, <SIZE>);
-  if (ret_ != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_payload_set_data : %d", ret_);
-    <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
-    goto out;
-  }
-
-  ret_ = <INTERNAL_PREFIX>_server_send_payload_async(<SERVER>, peer_info, <PAYLOAD>, NULL, NULL);
-  <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
-  if (ret_ != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_client_send_payload_async : %d", ret_);
-    goto out;
-  }
-)__c_cb";
-
-constexpr const char __GROUP_PUBLISH[] =
-R"__c_cb(
-  res_ = <INTERNAL_PREFIX>_payload_create(&pl_, AITT_PLUGIN_PAYLOAD_TYPE_DATA);
-  if (res_ != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", res_);
-    <INTERNAL_PREFIX>_payload_destroy(pl_);
-    goto out;
-  }
-
-  res_ = <INTERNAL_PREFIX>_payload_set_data(pl_, (const unsigned char*)data_, data_size_);
-  if (res_ != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_payload_set_data : %d", res_);
-    <INTERNAL_PREFIX>_payload_destroy(pl_);
-    goto out;
-  }
-
-  res_ = <INTERNAL_PREFIX>_group_publish(h->group, pl_);
-  <INTERNAL_PREFIX>_payload_destroy(pl_);
-  if (res_ != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_group_publish : %d", res_);
-    goto out;
-  }
-)__c_cb";
-
-constexpr const char __CLIENT_CREATE[] =
-R"__c_cb(
-  ret = <INTERNAL_PREFIX>_client_create(&handle->client, service_name, broker_ip, broker_port, user_name, password, my_ip, protocols);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to create proxy handle. error(%d)", ret);
-    <PREFIX>_<NAME>_destroy(handle);
-    return ret;
-  }
-
-  handle->callback = *callback;
-  handle->user_data = user_data;
-
-  ret = <INTERNAL_PREFIX>_client_add_connection_result_cb(handle->client, __<PREFIX>_<NAME>_connection_result, handle);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to add connection result cb. error(%d)", ret);
-    <PREFIX>_<NAME>_destroy(handle);
-    return ret;
-  }
-
-  ret = <INTERNAL_PREFIX>_client_add_disconnected_cb(handle->client, __<PREFIX>_<NAME>_disconnected, handle);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to add disconnected event cb. error(%d)", ret);
-    <PREFIX>_<NAME>_destroy(handle);
-    return ret;
-  }
-
-  ret = <INTERNAL_PREFIX>_client_add_payload_received_cb(handle->client, __<PREFIX>_<NAME>_received, handle);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to add received event cb. error(%d)", ret);
-    <PREFIX>_<NAME>_destroy(handle);
-    return ret;
-  }
-)__c_cb";
-
-constexpr const char __GROUP_CREATE[] =
-R"__c_cb(
-  ret = <INTERNAL_PREFIX>_group_create(&handle->group, topic_name, broker_ip, broker_port, user_name, password, my_ip, protocols);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to create group handle. error(%d)", ret);
-    <PREFIX>_<NAME>_destroy(handle);
-    return ret;
-  }
-
-  handle->callback = *callback;
-  handle->user_data = user_data;
-
-  ret = <INTERNAL_PREFIX>_group_add_joined_cb(handle->group, __<PREFIX>_<NAME>_joined_cb, handle);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to add connection result cb. error(%d)", ret);
-    <PREFIX>_<NAME>_destroy(handle);
-    return ret;
-  }
-
-  ret = <INTERNAL_PREFIX>_group_add_left_cb(handle->group, __<PREFIX>_<NAME>_left_cb, handle);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to add disconnected event cb. error(%d)", ret);
-    <PREFIX>_<NAME>_destroy(handle);
-    return ret;
-  }
-
-  ret = <INTERNAL_PREFIX>_group_add_payload_received_cb(handle->group, __<PREFIX>_<NAME>_received, handle);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to add received event cb. error(%d)", ret);
-    <PREFIX>_<NAME>_destroy(handle);
-    return ret;
-  }
-
-  ret = <INTERNAL_PREFIX>_group_subscribe(handle->group);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to subscribe event. error(%d)", ret);
-    <PREFIX>_<NAME>_destroy(handle);
-    return ret;
-  }
-
-  *h = handle;
-)__c_cb";
-
-constexpr const char __GROUP_DESTROY[] =
-R"__c_cb(
-  if (h->group) {
-    <INTERNAL_PREFIX>_group_unsubscribe(h->group);
-    <INTERNAL_PREFIX>_group_destroy(h->group);
-  }
-)__c_cb";
-
-constexpr const char __CLIENT_DESTROY[] =
-R"__c_cb(
-  if (h->client)
-    <INTERNAL_PREFIX>_client_destroy(h->client);
-)__c_cb";
-
-constexpr const char __PEER_INFO_CLONE[] =
-    "<INTERNAL_PREFIX>_peer_info_clone(<SRC_PEER>, <DEST_PEER>);";
-
-constexpr const char __SERVER_FOREACH_CONNECTED_PEER_INFO[] =
-    "<INTERNAL_PREFIX>_server_foreach_connected_peer_info(__<NAME>.stub, callback, user_data);";
-
-constexpr const char __SERVER_SET_ONDEMAND_LAUNCH_ENABLED[] =
-R"__c_cb(
-  int ret;
-
-  ret = <INTERNAL_PREFIX>_server_set_on_demand_launch_enabled(__<NAME>.stub, enable);
-  if (ret != AITT_PLUGIN_ERROR_NONE)
-    _E("Failed to set ondemand launch enable. error(%d)", ret);
-
-  return ret;
-)__c_cb";
-
-constexpr const char __COMMON_HEADER_HANDLES[] =
-R"__c_cb(
-
-typedef enum _<MODULE_PREFIX>_error {
-  AITT_PLUGIN_ERROR_NONE = TIZEN_ERROR_NONE, /**< Success */
-  AITT_PLUGIN_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
-  AITT_PLUGIN_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
-  AITT_PLUGIN_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
-  AITT_PLUGIN_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
-  AITT_PLUGIN_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Function not implemented */
-  AITT_PLUGIN_ERROR_ALREADY_IN_PROGRESS = TIZEN_ERROR_ALREADY_IN_PROGRESS, /**< Already in progress */
-  AITT_PLUGIN_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
-  AITT_PLUGIN_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< Timed out */
-  AITT_PLUGIN_ERROR_OPERATION_FAILED = TIZEN_ERROR_CION | 0x01, /**< Operation failed */
-} <MODULE_PREFIX>_error_e;
-
-enum AittProtocol {
-  AITT_TYPE_MQTT = (0x1 << 0),   // Publish message through the MQTT
-  AITT_TYPE_TCP = (0x1 << 1),   // Publish message to peers using the TCP
-  AITT_TYPE_UDP = (0x1 << 2),   // Publish message to peers using the UDP
-  AITT_TYPE_SRTP = (0x1 << 3),   // Publish message to peers using the SRTP
-  AITT_TYPE_WEBRTC = (0x1 << 4),  // Publish message to peers using the WEBRTC
-};
-
-/**
-  * @brief The aitt plugin peer info handle.
-  */
-typedef void *<MODULE_PREFIX>_peer_info_h;
-
-)__c_cb";
-
-constexpr const char __COMMON_HEADER_CONNECTION_RESULT_HANDLE[] =
-R"__c_cb(
-typedef enum _aitt_connection_status_e {
-  AITT_PLUGIN_CONNECTION_STATUS_OK, /**< Connection is ok **/
-  AITT_PLUGIN_CONNECTION_STATUS_REJECTED, /**< Connection is rejected **/
-  AITT_PLUGIN_CONNECTION_STATUS_ERROR, /**< Connection error occurs **/
-} <MODULE_PREFIX>_connection_status_e;
-
-/**
- * @brief The Aitt plugin connection result handle.
- */
-typedef void *<MODULE_PREFIX>_connection_result_h;
-)__c_cb";
-
-constexpr const char __COMMON_HEADER_PAYLOAD_HANDLE[] =
-R"__c_cb(
-/**
- * @brief Enumeration for <MODULE_PREFIX>_payload transfer status types.
- */
-typedef enum _payload_transfer_status_e {
-  AITT_PLUGIN_PAYLOAD_TRANSFER_STATUS_SUCCESS, /**< Transfer is success **/
-  AITT_PLUGIN_PAYLOAD_TRANSFER_STATUS_FAILURE, /**< Transfer is failed **/
-  AITT_PLUGIN_PAYLOAD_TRANSFER_STATUS_IN_PROGRESS, /**< Transfer is in progress **/
-} <MODULE_PREFIX>_payload_transfer_status_e;
-
-/**
-  * @brief The <MODULE_PREFIX>_payload handle.
-  */
- typedef void *<MODULE_PREFIX>_payload_h;
-
-)__c_cb";
-
-constexpr const char __COMMON_HEADER_PAYLOAD_BASE[] =
-R"__c_cb(
-/**
-  * @brief Saves the payload as a file.
-  * @remarks The @a path is absolute path.
-  * @remarks If the media storage is used, %http://tizen.org/privilege/mediastorage privilege is necessary. \n
-  *          If the external storage is used, %http://tizen.org/privilege/externalstorage privilege is necessary.
-  * @param[in] payload The <MODULE_PREFIX>_payload handle
-  * @param[in] path The path of file
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_PERMISSION_DENIED Permission denied
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OPERATION_FAILED Operation failed
-  */
-int <MODULE_PREFIX>_payload_save_as_file(<MODULE_PREFIX>_payload_h payload, const char *path);
-
-/**
-  * @brief Gets the name of received file from the payload.
-  * @remarks @a file_name must be released using free().
-  * @param[in] payload The <MODULE_PREFIX>_payload handle
-  * @param[out] file_name The name of file
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-
-int <MODULE_PREFIX>_payload_get_received_file_name(<MODULE_PREFIX>_payload_h payload,
-    char **file_name);
-
-/**
-  * @brief Gets the size of currently received file from the payload.
-  * @param[in] payload The <MODULE_PREFIX>_payload handle
-  * @param[out] bytes The size of file
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  */
-int <MODULE_PREFIX>_payload_get_received_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes);
-
-/**
-  * @brief Gets the total size of file from the payload.
-  * @param[in] payload The <MODULE_PREFIX>_payload handle
-  * @param[out] bytes The size of file
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  */
-int <MODULE_PREFIX>_payload_get_total_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes);
-)__c_cb";
-
-constexpr const char __COMMON_HEADER_COMMON_BASE[] =
-R"__c_cb(
-/**
-  * @brief Creates a clone of aitt plugin peer info handle.
-  * @remarks @a peer_info_clone must be released using <MODULE_PREFIX>_peer_info_destroy().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] peer_info_clone The cloned peer information handle
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  * @retval #AITT_PLUGIN_ERROR_IO_ERROR IO error
-  * @see <MODULE_PREFIX>_peer_info_destroy()
-  */
-int <MODULE_PREFIX>_peer_info_clone(const <MODULE_PREFIX>_peer_info_h peer_info,
-    <MODULE_PREFIX>_peer_info_h *peer_info_clone);
-
-/**
-  * @brief Destroys the peer info handle and releases all its resources.
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @see <MODULE_PREFIX>_peer_info_clone()
-  */
-int <MODULE_PREFIX>_peer_info_destroy(<MODULE_PREFIX>_peer_info_h peer_info);
-
-/**
-  * @brief Gets the device ID.
-  * @remarks @a device_id must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] device_id The device ID
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_device_id(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_id);
-
-/**
-  * @brief Gets the device name.
-  * @remarks @a device_name must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] device_name The device name
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_device_name(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_name);
-
-/**
-  * @brief Gets the device's platform.
-  * @remarks @a device_platform must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] device_platform The platform name
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_device_platform(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_platform);
-
-/**
-  * @brief Gets the device's platform version.
-  * @remarks @a device_platform_version must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] device_platform_version The platform version
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_device_platform_version(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_platform_version);
-
-/**
-  * @brief Gets the device's type.
-  * @remarks @a device_type must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] device_type Device type
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_device_type(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_type);
-
-/**
-  * @brief Gets application ID of peer.
-  * @remarks @a app_id must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] app_id The application ID
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_app_id(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **app_id);
-
-/**
-  * @brief Gets application version of peer.
-  * @remarks @a app_version must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] app_version The application version
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_app_version(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **app_version);
-
-/**
-  * @brief Gets UUID of peer.
-  * @remarks @a uuid must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] uuid The UUID
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_uuid(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **uuid);
-
-/**
-  * @brief Gets display name of peer.
-  * @details The custom name for service name. \n
-  *          It is possible that @a display_name does not exist.
-  * @remarks @a display_name must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] display_name The display name
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_display_name(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **display_name);
-)__c_cb";
-
-constexpr const char __COMMON_HEADER_CONNECTION_RESULT_BASE[] =
-R"__c_cb(
-/**
- * @brief Gets the connection result status.
- * @param[in] result The connection result handle
- * @param[out] status Connection result status
- * @return @c 0 on success, otherwise a negative error value
- * @retval #AITT_PLUGIN_ERROR_NONE Successful
- * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int <MODULE_PREFIX>_connection_result_get_status(const <MODULE_PREFIX>_connection_result_h result,
-         <MODULE_PREFIX>_connection_status_e *status);
-
-/**
- * @brief Gets the connection result reason.
- * @remarks @a reason must be released using free().
- * @param[in] result The connection result handle
- * @param[out] reason Connection result reason, should be freed after use
- * @return @c 0 on success, otherwise a negative error value
- * @retval #AITT_PLUGIN_ERROR_NONE Successful
- * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
- */
-int <MODULE_PREFIX>_connection_result_get_reason(const <MODULE_PREFIX>_connection_result_h result,
-        char **reason);
-)__c_cb";
-
-constexpr const char __COMMON_BODY_PEERINFO_BASE[] =
-R"__c_cb(
-int <MODULE_PREFIX>_peer_info_clone(const <MODULE_PREFIX>_peer_info_h peer_info,
-    <MODULE_PREFIX>_peer_info_h *peer_info_clone) {
-  return <INTERNAL_PREFIX>_peer_info_clone(peer_info, peer_info_clone);
-}
-
-int <MODULE_PREFIX>_peer_info_destroy(<MODULE_PREFIX>_peer_info_h peer_info) {
-  return <INTERNAL_PREFIX>_peer_info_destroy(peer_info);
-}
-
-int <MODULE_PREFIX>_peer_info_get_device_id(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_id) {
-  return <INTERNAL_PREFIX>_peer_info_get_device_id(peer_info, device_id);
-}
-
-int <MODULE_PREFIX>_peer_info_get_device_name(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_name) {
-  return <INTERNAL_PREFIX>_peer_info_get_device_name(peer_info, device_name);
-}
-
-int <MODULE_PREFIX>_peer_info_get_device_platform(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_platform) {
-  return <INTERNAL_PREFIX>_peer_info_get_device_platform(peer_info, device_platform);
-}
-
-int <MODULE_PREFIX>_peer_info_get_device_platform_version(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_platform_version) {
-  return <INTERNAL_PREFIX>_peer_info_get_device_platform_version(peer_info, device_platform_version);
-}
-
-int <MODULE_PREFIX>_peer_info_get_device_type(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_type) {
-  return <INTERNAL_PREFIX>_peer_info_get_device_type(peer_info, device_type);
-}
-
-int <MODULE_PREFIX>_peer_info_get_app_id(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **app_id) {
-  return <INTERNAL_PREFIX>_peer_info_get_app_id(peer_info, app_id);
-}
-
-int <MODULE_PREFIX>_peer_info_get_app_version(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **app_version) {
-  return <INTERNAL_PREFIX>_peer_info_get_app_version(peer_info,  app_version);
-}
-
-int <MODULE_PREFIX>_peer_info_get_uuid(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **uuid) {
-  return <INTERNAL_PREFIX>_peer_info_get_uuid(peer_info, uuid);
-}
-
-int <MODULE_PREFIX>_peer_info_get_display_name(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **display_name) {
-  return <INTERNAL_PREFIX>_peer_info_get_display_name(peer_info, display_name);
-}
-)__c_cb";
-
-/**
- * <PREFIX> The prefix of the connection result.
- */
-constexpr const char __COMMON_BODY_CONNECTION_RESULT_BASE[] =
-R"__c_cb(
-int <MODULE_PREFIX>_connection_result_get_status(const <MODULE_PREFIX>_connection_result_h result,
-    <MODULE_PREFIX>_connection_status_e *status) {
-  return <INTERNAL_PREFIX>_connection_result_get_status(result,(<INTERNAL_PREFIX>_connection_status_e *)status);
-}
-
-int <MODULE_PREFIX>_connection_result_get_reason(const <MODULE_PREFIX>_connection_result_h result,
-    char **reason) {
-  return <INTERNAL_PREFIX>_connection_result_get_reason(result, reason);
-}
-)__c_cb";
-
-/**
- * <PREFIX> The prefix of the payload.
- */
-constexpr const char __COMMON_BODY_PAYLOAD_BASE[] =
-R"__c_cb(
-int <MODULE_PREFIX>_payload_save_as_file(<MODULE_PREFIX>_payload_h payload, const char *path) {
-  return <INTERNAL_PREFIX>_payload_save_as_file(payload, path);
-}
-
-int <MODULE_PREFIX>_payload_get_received_file_name(<MODULE_PREFIX>_payload_h payload,
-    char **file_name) {
-  return <INTERNAL_PREFIX>_payload_get_received_file_name(payload, file_name);
-}
-
-int <MODULE_PREFIX>_payload_get_received_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes) {
-  return <INTERNAL_PREFIX>_payload_get_received_bytes( payload, bytes);
-}
-
-int <MODULE_PREFIX>_payload_get_total_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes) {
-  return <INTERNAL_PREFIX>_payload_get_total_bytes( payload, bytes);
-}
-)__c_cb";
-
-constexpr const char __INCLUDE_HEADER_DEF[] =
-R"__c_cb(
-#include <stdlib.h>
-#include <stdint.h>
-)__c_cb";
-
-constexpr const char __SERVER_HEADER_EXTRA[] =
-R"__c_cb(
-/**
- * @brief Registers the set of the callback functions and the service_name.
- * @details This function registers the set of the callback functions to handle stub events.
- *          And, the <MODULE_PREFIX>_server_listen() is called internally to handle events.
-
- * @privilege %http://tizen.org/privilege/d2d.datasharing \n
- *            %http://tizen.org/privilege/internet
- * @param[in] service_name The name of service
- * @param[in] display_name The display name of service
- * @param[in] broker_ip IP address of the broker to connect to
- * @param[in] port The network port to connect to. Usually 1883
- * @param[in] user_name The user name to connect to
- * @param[in] password The Password to connect to
- * @param[in] my_ip Own device ip address for connecting by others
- * @param[in] protocols value of @a aitt_protocol_e. The value can be bitwise-or'd
- * @param[in] callback The set of callback functions to handle stub events
- * @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #<ERROR_PREFIX>_ERROR_NONE Successful
- * @retval #<ERROR_PREFIX>_ERROR_NOT_SUPPORTED Not supported
- * @retval #<ERROR_PREFIX>_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #<ERROR_PREFIX>_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #<ERROR_PREFIX>_ERROR_IO_ERROR IO error
- * @retval #<ERROR_PREFIX>_ERROR_INVALID_OPERATION Invalid operation
- * @retval #<ERROR_PREFIX>_ERROR_OPERATION_FAILED Operation failed
- * @retval #<ERROR_PREFIX>_ERROR_PERMISSION_DENIED Permission denied
- * @see <PREFIX>_<NAME>_unregister()
- * @see #<PREFIX>_<NAME>_callback_s
- */
-int <PREFIX>_<NAME>_register(const char *service_name, const char *display_name,
-    const char *broker_ip, int broker_port, const char *user_name,
-    const char *password, const char *my_ip, int protocols,
-    <PREFIX>_<NAME>_callback_s *callback, void *user_data);
-)__c_cb";
-
-constexpr const char __SERVER_BODY_EXTRA[] =
-R"__c_cb(
-int <PREFIX>_<NAME>_register(const char *service_name, const char *display_name,
-    const char *broker_ip, int broker_port, const char *user_name,
-    const char *password, const char *my_ip, int protocols,
-    <PREFIX>_<NAME>_callback_s *callback, void *user_data)
-)__c_cb";
-
-constexpr const char __CLIENT_HEADER_EXTRA[] =
-R"__c_cb(
-/**
- * @brief Creates a <PREFIX>_<NAME> handle.
- * @remarks The @a h handle should be released using
- *          the <PREFIX>_<NAME>_destroy() if it's no longer needed.
- * @privilege %http://tizen.org/privilege/d2d.datasharing \n
- *            %http://tizen.org/privilege/internet
- * @param[in] service_name The name of service
- * @param[in] broker_ip IP address of the broker to connect to
- * @param[in] port The network port to connect to. Usually 1883.
- * @param[in] user_name The user name to connect to
- * @param[in] password The Password to connect to
- * @param[in] my_ip Own device ip address for connecting by others
- * @param[in] protocols value of @a aitt_protocol_e. The value can be bitwise-or'd.
- * @param[in] callback The set of callback functions to handle proxy events
- * @param[in] user_data The user data to be passed to the callback function
- * @param[out] h The <PREFIX>_<NAME> handle
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #<ERROR_PREFIX>_ERROR_NONE Successful
- * @retval #<ERROR_PREFIX>_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #<ERROR_PREFIX>_ERROR_OUT_OF_MEMORY Out of memory
- * @see <PREFIX>_<NAME>_destroy()
- * @see #<PREFIX>_<NAME>_callback_s
- */
-int <PREFIX>_<NAME>_create(const char *service_name, const char *broker_ip, int broker_port,
-    const char *user_name, const char *password, const char *my_ip, int protocols,
-    <PREFIX>_<NAME>_callback_s *callback, void *user_data, <PREFIX>_<NAME>_h *h);
-)__c_cb";
-
-constexpr const char __CLIENT_BODY_EXTRA[] =
-R"__c_cb(
-int <PREFIX>_<NAME>_create(const char *service_name, const char *broker_ip, int broker_port,
-    const char *user_name, const char *password, const char *my_ip, int protocols,
-    <PREFIX>_<NAME>_callback_s *callback, void *user_data, <PREFIX>_<NAME>_h *h)
-)__c_cb";
-
-
-constexpr const char __GROUP_HEADER_EXTRA[] =
-R"__c_cb(
-/**
- * @brief Creates a <PREFIX>_<NAME> handle.
- * @remarks The @a h handle should be released using
- *          the <PREFIX>_<NAME>_destroy() if it's no longer needed.
- *
- * @privilege %http://tizen.org/privilege/d2d.datasharing
- *            %http://tizen.org/privilege/internet
- * @param[in] topic_name topic_name The name of topic
- * @param[in] broker_ip IP address of the broker to connect to
- * @param[in] port The network port to connect to. Usually 1883.
- * @param[in] user_name The user name to connect to
- * @param[in] password The Password to connect to
- * @param[in] my_ip Own device ip address for connecting by others
- * @param[in] protocols value of @a aitt_protocol_e. The value can be bitwise-or'd.
- * @param[in] callback The set of callback functions to handle events
- * @param[in] user_data The user data to be passed to the callback function
- * @param[out] h The <PREFIX>_<NAME> handle
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AITT_PLUGIN_ERROR_NONE Successful
- * @retval #AITT_PLUGIN_ERROR_NOT_SUPPORTED Not supported
- * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #AITT_PLUGIN_ERROR_PERMISSION_DENIED Permission denied
-
- * @see <PREFIX>_<NAME>_destroy()
- * @see #<PREFIX>_<NAME>_callback_s
- */
-int <PREFIX>_<NAME>_create(const char *topic_name, const char *broker_ip, int broker_port,
-    const char *user_name, const char *password,
-    const char *my_ip, int protocols,
-    <PREFIX>_<NAME>_callback_s *callback, void *user_data, <PREFIX>_<NAME>_h *h);
-)__c_cb";
-
-constexpr const char __GROUP_BODY_EXTRA[] =
-R"__c_cb(
-int <PREFIX>_<NAME>_create(const char *topic_name, const char *broker_ip, int broker_port,
-    const char *user_name, const char *password,
-    const char *my_ip, int protocols,
-    <PREFIX>_<NAME>_callback_s *callback, void *user_data, <PREFIX>_<NAME>_h *h)
-)__c_cb";
-
-
-}  // namespace
-
-namespace tidl {
-
-std::string AittPluginCTransportable::GenInclude(bool body, int type) const {
-  if (!body)
-    return __INCLUDE_HEADER_DEF;
-  else
-    return "#include \"<FILENAME>_internal.h\"";
-}
-
-std::string AittPluginCTransportable::GenHeaderBase() const {
-  return __COMMON_HEADER_COMMON_BASE;
-}
-
-std::string AittPluginCTransportable::GenHeaderPayloadHandle() const {
-  return __COMMON_HEADER_PAYLOAD_HANDLE;
-}
-
-std::string AittPluginCTransportable::GenHeaderCommonHandle() const {
-  return __COMMON_HEADER_HANDLES;
-}
-
-std::string AittPluginCTransportable::GenHeaderConnectionHandle() const {
-  return __COMMON_HEADER_CONNECTION_RESULT_HANDLE;
-}
-
-std::string AittPluginCTransportable::GenHeaderPayloadBase() const {
-  return __COMMON_HEADER_PAYLOAD_BASE;
-}
-
-std::string AittPluginCTransportable::GenHeaderConnectionBase() const {
-  return __COMMON_HEADER_CONNECTION_RESULT_BASE;
-}
-
-std::string AittPluginCTransportable::GenBodyPayloadBase() const {
-  return __COMMON_BODY_PAYLOAD_BASE;
-}
-
-std::string AittPluginCTransportable::GenBodyConnectionBase() const {
-  return __COMMON_BODY_CONNECTION_RESULT_BASE;
-}
-
-std::string AittPluginCTransportable::GenBodyPeerInfoBase() const {
-  return __COMMON_BODY_PEERINFO_BASE;
-}
-
-std::string AittPluginCTransportable::GenProxyPrefix() const {
-  return "aitt_plugin_proxy";
-}
-
-std::string AittPluginCTransportable::GenStubPrefix() const {
-  return "aitt_plugin_stub";
-}
-
-std::string AittPluginCTransportable::GenGroupPrefix() const {
-  return "aitt_plugin_group";
-}
-
-std::string AittPluginCTransportable::GenModulePrefix() const {
-  return "aitt_plugin";
-}
-
-std::string AittPluginCTransportable::GenErrorPrefix() const {
-  return "AITT_PLUGIN";
-}
-
-std::string AittPluginCTransportable::GenServerExtra(bool body) const {
-  if (body)
-    return __SERVER_BODY_EXTRA;
-  else
-    return __SERVER_HEADER_EXTRA;
-}
-
-std::string AittPluginCTransportable::GenClientExtra(bool body) const {
-  if (body)
-    return __CLIENT_BODY_EXTRA;
-  else
-    return __CLIENT_HEADER_EXTRA;
-}
-
-std::string AittPluginCTransportable::GenGroupExtra(bool body) const {
-  if (body)
-    return __GROUP_BODY_EXTRA;
-  else
-    return __GROUP_HEADER_EXTRA;
-}
-
-std::string AittPluginCTransportable::GenClientSendAsync(std::string client,
-    std::string payload, std::string size) const {
-  return std::string(ReplaceAll(__CLIENT_SEND_ASYNC, {
-      { "<CLIENT>", client },
-      { "<PAYLOAD>", payload},
-      { "<SIZE>", size} }));
-}
-
-std::string AittPluginCTransportable::GenClientSend(std::string client,
-    std::string data, std::string data_size,
-    std::string ret_data, std::string ret_data_size) const {
-  return std::string(ReplaceAll(__CLIENT_SEND, {
-      { "<CLIENT>", client },
-      { "<DATA>", data},
-      { "<DATA_SIZE>", data_size},
-      { "<RET_DATA>", ret_data},
-      { "<RET_DATA_SIZE>", ret_data_size} }));
-}
-
-std::string AittPluginCTransportable::GenServerSendAsync(std::string server,
-    std::string client,
-    std::string payload, std::string size) const {
-  return std::string(ReplaceAll(__SERVER_SEND_ASYNC, {
-      { "<SERVER>", server },
-      { "<CLIENT>", client},
-      { "<PAYLOAD>", payload},
-      { "<SIZE>", size} }));
-}
-
-std::string AittPluginCTransportable::GenServerFileSend(std::string path,
-    std::string server, std::string peer) const {
-  return std::string(ReplaceAll(__SERVER_FILE_SEND, {
-      { "<FILE_PATH>", path },
-      { "<SERVER_H>", server },
-      { "<PEER_H>", peer } }));
-}
-
-std::string AittPluginCTransportable::GenClientFileSend(std::string path,
-    std::string client) const {
-  return std::string(ReplaceAll(__CLINET_FILE_SEND, {
-      { "<FILE_PATH>", path },
-      { "<CLIENT_H>", client } }));
-}
-
-std::string AittPluginCTransportable::GenGroupType() const {
-  return "<INTERNAL_PREFIX>_group_h";
-}
-
-std::string AittPluginCTransportable::GenPayloadTransferStatusType(bool internal_type) const {
-  if (internal_type)
-    return "<INTERNAL_PREFIX>_transfer_status_e";
-  else
-    return "<MODULE_PREFIX>_payload_transfer_status_e";
-}
-
-std::string AittPluginCTransportable::GenPeerInfoType() const {
-  return "<MODULE_PREFIX>_peer_info_h";
-}
-
-std::string AittPluginCTransportable::GenPeerInfoDestroy(std::string peer) const {
-  return std::string(ReplaceAll("<MODULE_PREFIX>_peer_info_destroy(<PEER>);", {
-      { "<PEER>", peer } }));
-}
-
-std::string AittPluginCTransportable::GenPayloadType(bool internal_type) const {
-  if (internal_type)
-  return "<INTERNAL_PREFIX>_payload_h";
-  else
-  return "<MODULE_PREFIX>_payload_h";
-}
-
-std::string AittPluginCTransportable::GenClientType() const {
-  return "<INTERNAL_PREFIX>_client_h";
-}
-
-std::string AittPluginCTransportable::GenSecurityType(bool definition) const {
-  return "";
-}
-
-std::string AittPluginCTransportable::GenServerType() const {
-  return "<INTERNAL_PREFIX>_server_h";
-}
-
-std::string AittPluginCTransportable::GenClientTryConnect(std::string client,
-    std::string peer) const {
-  return std::string(ReplaceAll(__CLIENT_TRY_CONNECT, {
-      { "<CLIENT>", client },
-      { "<PEER>", peer } }));
-}
-
-std::string AittPluginCTransportable::GenClientDisconnect(
-    std::string client) const {
-  return std::string(ReplaceAll(__CLIENT_DISCONNECT, {
-      { "<CLIENT>", client } }));
-}
-
-std::string AittPluginCTransportable::GenClientTryDiscovery(
-    std::string client) const {
-  return std::string(ReplaceAll(__CLIENT_TRY_DISCOVERY, {
-      { "<CLIENT>", client } }));
-}
-
-std::string AittPluginCTransportable::GenClientStopDiscovery(
-    std::string client) const {
-  return std::string(ReplaceAll(__CLIENT_STOP_DISCOVERY, {
-      { "<CLIENT>", client } }));
-}
-
-std::string AittPluginCTransportable::GenServerRegister() const {
-  return __SERVER_REGISTER;
-}
-
-std::string AittPluginCTransportable::GenServerUnregister() const {
-  return __SERVER_UNREGISTER;
-}
-
-std::string AittPluginCTransportable::GenClientExtraHeader() const {
-  return "";
-}
-
-std::string AittPluginCTransportable::GenClientExtraBody() const {
-  return "";
-}
-
-std::string AittPluginCTransportable::GenServerExtraHeader() const {
-  return "";
-}
-
-std::string AittPluginCTransportable::GenServerExtraBody() const {
-  return "";
-}
-
-std::string AittPluginCTransportable::GenServerAccept() const {
-  return __SERVER_ACCEPT;
-}
-
-std::string AittPluginCTransportable::GenServerReject() const {
-  return __SERVER_REJECT;
-}
-
-std::string AittPluginCTransportable::GenServerSetDisplayName() const {
-  return __SERVER_SET_DISPLAY_NAME;
-}
-
-std::string AittPluginCTransportable::GenGroupPublish() const {
-  return __GROUP_PUBLISH;
-}
-
-std::string AittPluginCTransportable::GenPayloadTypeEnum() const {
-  return "<INTERNAL_PREFIX>_payload_type_e";
-}
-
-std::string AittPluginCTransportable::GenPayloadTypeData() const {
-  return "AITT_PLUGIN_PAYLOAD_TYPE_DATA";
-}
-
-std::string AittPluginCTransportable::GenPayloadTypeFile() const {
-  return "AITT_PLUGIN_PAYLOAD_TYPE_FILE";
-}
-
-std::string AittPluginCTransportable::GenPayloadGetType() const {
-  return "ret = <INTERNAL_PREFIX>_payload_get_type(payload, &type);";
-}
-
-std::string AittPluginCTransportable::GenErrorNone() const {
-  return "AITT_PLUGIN_ERROR_NONE";
-}
-
-std::string AittPluginCTransportable::GenPayloadGetData() const {
-  return "ret = <INTERNAL_PREFIX>_payload_get_data(payload, &data, &data_len);";
-}
-
-std::string AittPluginCTransportable::GenClientCreate() const {
-  return __CLIENT_CREATE;
-}
-
-std::string AittPluginCTransportable::GenGroupCreate() const {
-  return __GROUP_CREATE;
-}
-
-std::string AittPluginCTransportable::GenGroupDestroy() const {
-  return __GROUP_DESTROY;
-}
-
-std::string AittPluginCTransportable::GenClientDestroy() const {
-  return __CLIENT_DESTROY;
-}
-
-std::string AittPluginCTransportable::GenSetSecurityCA(std::string arg) const {
-  return "";
-}
-
-std::string AittPluginCTransportable::GenSetSecurityCert(std::string arg) const {
-  return "";
-}
-
-std::string AittPluginCTransportable::GenSetSecurityPrivateKey(std::string arg) const {
-  return "";
-}
-
-std::string AittPluginCTransportable::GenPeerInfoClone(std::string src_peer,
-      std::string dest_peer) const {
-  return std::string(ReplaceAll(__PEER_INFO_CLONE, {
-      { "<SRC_PEER>", src_peer },
-      { "<DEST_PEER>", dest_peer } }));
-}
-
-std::string AittPluginCTransportable::GenServerForeachConnectedPeerInfo(
-    std::string name) const {
-  return std::string(ReplaceAll(__SERVER_FOREACH_CONNECTED_PEER_INFO, {
-      { "<NAME>", name } }));
-}
-
-}  // namespace tidl
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_c_transportable.h b/idlc/gen_aitt_plugin/aitt_plugin_c_transportable.h
deleted file mode 100644 (file)
index 8cdaada..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IDLC_GEN_AITT_PLUGIN_C_TRANSPORTABLE_H_
-#define IDLC_GEN_AITT_PLUGIN_C_TRANSPORTABLE_H_
-
-#include <string>
-
-#include "idlc/gen_cion/c_transportable.h"
-
-namespace tidl {
-
-class AittPluginCTransportable : public CTransportable {
- public:
-  virtual ~AittPluginCTransportable() = default;
-  std::string GenInclude(bool body = true, int type = 0) const override;
-  std::string GenHeaderBase() const override;
-  std::string GenHeaderPayloadHandle() const override;
-  std::string GenHeaderCommonHandle() const override;
-  std::string GenHeaderConnectionHandle() const override;
-  std::string GenHeaderPayloadBase() const override;
-  std::string GenHeaderConnectionBase() const override;
-  std::string GenBodyPayloadBase() const override;
-  std::string GenBodyConnectionBase() const override;
-  std::string GenBodyPeerInfoBase() const override;
-  std::string GenProxyPrefix() const override;
-  std::string GenStubPrefix() const override;
-  std::string GenGroupPrefix() const override;
-  std::string GenModulePrefix() const override;
-  std::string GenErrorPrefix() const override;
-  std::string GenServerExtra(bool body = true) const override;
-  std::string GenClientExtra(bool body = true) const override;
-  std::string GenGroupExtra(bool body = true) const override;
-  std::string GenClientSendAsync(std::string client,
-      std::string payload, std::string size) const override;
-  std::string GenClientSend(std::string client, std::string data,
-      std::string data_size, std::string ret_data,
-      std::string ret_data_size) const override;
-  std::string GenServerSendAsync(std::string server, std::string client,
-      std::string payload, std::string size) const override;
-  std::string GenServerFileSend(std::string path,
-      std::string server, std::string peer) const override;
-  std::string GenClientFileSend(std::string path,
-      std::string client) const override;
-  std::string GenGroupType() const override;
-  std::string GenPayloadTransferStatusType(bool internal_type = false) const override;
-  std::string GenPeerInfoType() const override;
-  std::string GenPeerInfoDestroy(std::string peer) const override;
-  std::string GenPayloadType(bool internal_type = false) const override;
-  std::string GenClientType() const override;
-  std::string GenSecurityType(bool definition = true) const override;
-  std::string GenServerType() const override;
-  std::string GenClientTryConnect(std::string client,
-      std::string peer) const override;
-  std::string GenClientDisconnect(std::string client) const override;
-  std::string GenClientTryDiscovery(std::string client) const override;
-  std::string GenClientStopDiscovery(std::string client) const override;
-  std::string GenServerRegister() const override;
-  std::string GenServerUnregister() const override;
-  std::string GenClientExtraHeader() const override;
-  std::string GenClientExtraBody() const override;
-  std::string GenServerExtraHeader() const override;
-  std::string GenServerExtraBody() const override;
-  std::string GenServerAccept() const override;
-  std::string GenServerReject() const override;
-  std::string GenServerSetDisplayName() const override;
-  std::string GenGroupPublish() const override;
-  std::string GenPayloadTypeEnum() const override;
-  std::string GenPayloadTypeData() const override;
-  std::string GenPayloadTypeFile() const override;
-  std::string GenPayloadGetType() const override;
-  std::string GenErrorNone() const override;
-  std::string GenPayloadGetData() const override;
-  std::string GenClientCreate() const override;
-  std::string GenGroupCreate() const override;
-  std::string GenGroupDestroy() const override;
-  std::string GenClientDestroy() const override;
-  std::string GenSetSecurityCA(std::string arg) const override;
-  std::string GenSetSecurityCert(std::string arg) const override;
-  std::string GenSetSecurityPrivateKey(std::string arg) const override;
-  std::string GenPeerInfoClone(std::string src_peer,
-      std::string dest_peer) const override;
-  std::string GenServerForeachConnectedPeerInfo(std::string name) const override;
-};
-
-}  // namespace tidl
-
-#endif  // IDLC_GEN_AITT_PLUGIN_C_TRANSPORTABLE_H_
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_cpp_transportable.cc b/idlc/gen_aitt_plugin/aitt_plugin_cpp_transportable.cc
deleted file mode 100644 (file)
index b0f1316..0000000
+++ /dev/null
@@ -1,1189 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "idlc/gen_aitt_plugin/aitt_plugin_cpp_transportable.h"
-
-#include <utility>
-
-#include "idlc/gen/replace_all.h"
-
-namespace {
-
-constexpr const char __CLINET_FILE_SEND[] =
-R"__cpp_cb(<PAYLOAD_T> pl;
-  int ret = <INTERNAL_PREFIX>_payload_create(&pl, AITT_PLUGIN_PAYLOAD_TYPE_FILE);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret);
-    return;
-  }
-
-  ret = <INTERNAL_PREFIX>_payload_set_file_path(pl, <FILE_PATH>.c_str());
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_payload_set_file_path : %d - %s", ret, <FILE_PATH>.c_str());
-    <INTERNAL_PREFIX>_payload_destroy(pl);
-    return;
-  }
-
-  ret = <INTERNAL_PREFIX>_client_send_payload_async(<CLIENT_H>, pl, nullptr, nullptr);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_client_send_payload_async : %d", ret);
-    <INTERNAL_PREFIX>_payload_destroy(pl);
-    return;
-  }
-
-  <INTERNAL_PREFIX>_payload_destroy(pl);
-)__cpp_cb";
-
-constexpr const char __SERVER_FILE_SEND[] =
-R"__cpp_cb(<PAYLOAD_T> pl;
-  int ret = <INTERNAL_PREFIX>_payload_create(&pl, AITT_PLUGIN_PAYLOAD_TYPE_FILE);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret);
-    return;
-  }
-
-  ret = <INTERNAL_PREFIX>_payload_set_file_path(pl, <FILE_PATH>.c_str());
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_payload_set_file_path : %d - %s", ret, <FILE_PATH>.c_str());
-    <INTERNAL_PREFIX>_payload_destroy(pl);
-    return;
-  }
-
-  ret = <INTERNAL_PREFIX>_server_send_payload_async(<SERVER_H>, <PEER_H>, pl, nullptr, nullptr);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_server_send_payload_async : %d", ret);
-    <INTERNAL_PREFIX>_payload_destroy(pl);
-    return;
-  }
-
-  <INTERNAL_PREFIX>_payload_destroy(pl);
-)__cpp_cb";
-
-constexpr const char __SERVER_REGISTER[] =
-R"__cpp_cb(<SERVER_T> server;
-  int ret = <INTERNAL_PREFIX>_server_create(&server, service_name.c_str(),
-      display_name.c_str(), broker_ip.c_str(), broker_port, user_name.c_str(), password.c_str(), my_ip.c_str(), protocols);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to create handle. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  ret = <INTERNAL_PREFIX>_server_add_connection_result_cb(server, OnConnectionResultCB,
-      this);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_server_add_connection_result_cb. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  ret = <INTERNAL_PREFIX>_server_add_payload_received_cb(server,
-      [](const char *service_name, const <INTERNAL_PREFIX>_peer_info_h peer_info,
-        const <INTERNAL_PREFIX>_payload_h payload, <INTERNAL_PREFIX>_transfer_status_e status, void *user_data) {
-            ## *sr = static_cast<##*>(user_data);
-            sr->OnPayloadReceivedCB(service_name, peer_info, payload,
-                static_cast<<MODULE_PREFIX>_payload_transfer_status_e>(status), user_data);
-          },
-      this);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_server_add_payload_received_cb. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  ret = <INTERNAL_PREFIX>_server_set_data_received_cb(server, OnDataReceivedCB, this);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_server_set_data_received_cb. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  ret = <INTERNAL_PREFIX>_server_add_disconnected_cb(server, OnDisconnectedCB, this);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_server_add_disconnected_cb. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  server_ = server;
-)__cpp_cb";
-
-
-
-constexpr const char __SERVER_UNREGISTER[] =
-R"__cpp_cb(
-  if (server_ != nullptr)
-    <INTERNAL_PREFIX>_server_destroy(server_);
-)__cpp_cb";
-
-constexpr const char __SERVER_ACCEPT[] =
-R"__cpp_cb(auto p = service->GetPeer();
-  int ret = <INTERNAL_PREFIX>_server_accept(server_, p);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_server_accept. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  service->OnCreate();
-  services_.emplace_back(std::move(service));
-)__cpp_cb";
-
-constexpr const char __SERVER_REJECT[] =
-R"__cpp_cb(auto p = service->GetPeer();
-  int ret = <INTERNAL_PREFIX>_server_reject(server_, p, reason.c_str());
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_server_reject. error(%d)", ret);
-    throw InvalidIOException();
-  }
-)__cpp_cb";
-
-constexpr const char __SERVER_SET_DISPLAY_NAME[] =
-R"__cpp_cb(int ret = <INTERNAL_PREFIX>_server_set_display_name(server_, display_name.c_str());
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_server_set_display_name. error(%d)", ret);
-    InvalidIOException();
-  }
-)__cpp_cb";
-
-constexpr const char __CLIENT_TRY_CONNECT[] =
-R"__cpp_cb(int ret = <INTERNAL_PREFIX>_client_connect(<CLIENT>, <PEER>);
-    if (ret != AITT_PLUGIN_ERROR_NONE) {
-      _E("Failed to connect to stub. error(%d)", ret);
-      switch(ret) {
-      case AITT_PLUGIN_ERROR_PERMISSION_DENIED :
-        throw UnauthorizedAccessException();
-        break;
-      case AITT_PLUGIN_ERROR_INVALID_PARAMETER :
-        throw NotConnectedSocketException();
-        break;
-      default :
-        throw InvalidIOException();
-      }
-    }
-)__cpp_cb";
-
-constexpr const char __CLIENT_DISCONNECT[] =
-R"__cpp_cb(int ret = <INTERNAL_PREFIX>_client_disconnect(<CLIENT>);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to disconnect to stub. error(%d)", ret);
-    throw NotConnectedSocketException();
-  }
-)__cpp_cb";
-
-constexpr const char __CLIENT_TRY_DISCOVERY[] =
-R"__cpp_cb(int ret = <INTERNAL_PREFIX>_client_try_discovery(<CLIENT>, OnDiscoveredCB, this);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to discovery to stub. error(%d)", ret);
-    switch(ret) {
-      case AITT_PLUGIN_ERROR_PERMISSION_DENIED :
-        throw UnauthorizedAccessException();
-        break;
-      default :
-        throw InvalidIOException();
-    }
-  }
-)__cpp_cb";
-
-constexpr const char __CLIENT_STOP_DISCOVERY[] =
-R"__cpp_cb(int ret = <INTERNAL_PREFIX>_client_stop_discovery(<CLIENT>);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to stop discovery. error(%d)", ret);
-    return;
-  }
-)__cpp_cb";
-
-constexpr const char __CLIENT_SEND_ASYNC[] =
-R"__cpp_cb(
-    ret = <INTERNAL_PREFIX>_payload_create(&<PAYLOAD>, AITT_PLUGIN_PAYLOAD_TYPE_DATA);
-    if (ret != AITT_PLUGIN_ERROR_NONE) {
-      _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret);
-      rpc_port_parcel_destroy(p);
-      throw InvalidIOException();
-    }
-
-    ret = <INTERNAL_PREFIX>_payload_set_data(<PAYLOAD>, (const unsigned char*)data, <SIZE>);
-    if (ret != AITT_PLUGIN_ERROR_NONE) {
-      _E("Failed to <INTERNAL_PREFIX>_payload_set_data : %d", ret);
-      rpc_port_parcel_destroy(p);
-      <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
-      throw InvalidIOException();
-    }
-
-    ret = <INTERNAL_PREFIX>_client_send_payload_async(<CLIENT>, <PAYLOAD>, nullptr, nullptr);
-    if (ret != AITT_PLUGIN_ERROR_NONE) {
-      _E("Failed to <INTERNAL_PREFIX>_client_send_payload_async : %d", ret);
-      rpc_port_parcel_destroy(p);
-      <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
-      throw InvalidIOException();
-    }
-
-    <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
-)__cpp_cb";
-
-constexpr const char __CLIENT_SEND[] =
-R"__cpp_cb(
-    ret = <INTERNAL_PREFIX>_client_send_data(<CLIENT>, (unsigned char *)<DATA>, <DATA_SIZE>,
-        100, &<RET_DATA>, &<RET_DATA_SIZE>);
-    if (ret != RPC_PORT_ERROR_NONE) {
-        _E("Failed to <INTERNAL_PREFIX>_client_send_data : error(%d)", ret);
-        rpc_port_parcel_destroy(p);
-        throw InvalidIOException();
-    }
-)__cpp_cb";
-
-constexpr const char __SERVER_SEND_ASYNC[] =
-R"__cpp_cb(ret_ = <INTERNAL_PREFIX>_payload_create(&<PAYLOAD>, AITT_PLUGIN_PAYLOAD_TYPE_DATA);
-  if (ret_ != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret_);
-    rpc_port_parcel_destroy(p);
-    return;
-  }
-
-  ret_ = <INTERNAL_PREFIX>_payload_set_data(<PAYLOAD>, (const unsigned char*)data, <SIZE>);
-  if (ret_ != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_payload_set_data : %d", ret_);
-    rpc_port_parcel_destroy(p);
-    <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
-    return;
-  }
-
-  ret_ = <INTERNAL_PREFIX>_server_send_payload_async(<SERVER>, service_.lock()->GetPeer(), <PAYLOAD>, nullptr, nullptr);
-  <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
-  if (ret_ != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_client_send_payload_async : %d", ret_);
-    rpc_port_parcel_destroy(p);
-    return;
-  }
-)__cpp_cb";
-
-constexpr const char __GROUP_HANDLES[] =
-R"__c_cb(
-  /**
-  * @brief The aitt group handle.
-  */
-typedef void *<MODULE_PREFIX>_group_h;
-
-)__c_cb";
-
-constexpr const char __GROUP_PUBLISH[] =
-R"__c_cb(ret = <INTERNAL_PREFIX>_payload_create(&pl, AITT_PLUGIN_PAYLOAD_TYPE_DATA);
-    if (ret != AITT_PLUGIN_ERROR_NONE) {
-      _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret);
-      rpc_port_parcel_destroy(p);
-      throw InvalidIOException();
-    }
-
-    ret = <INTERNAL_PREFIX>_payload_set_data(pl, (const unsigned char*)data, size);
-    if (ret != AITT_PLUGIN_ERROR_NONE) {
-      _E("Failed to <INTERNAL_PREFIX>_payload_set_data : %d", ret);
-      rpc_port_parcel_destroy(p);
-      <INTERNAL_PREFIX>_payload_destroy(pl);
-      throw InvalidIOException();
-    }
-
-    ret = <INTERNAL_PREFIX>_group_publish(group_, pl);
-    <INTERNAL_PREFIX>_payload_destroy(pl);
-    if (ret != AITT_PLUGIN_ERROR_NONE) {
-      _E("Failed to <INTERNAL_PREFIX>_group_publish : %d", ret);
-      rpc_port_parcel_destroy(p);
-      throw InvalidIOException();
-    }
-)__c_cb";
-
-constexpr const char __CLIENT_CREATE[] =
-R"__c_cb(<CLIENT_T> client = nullptr;
-  int ret = <INTERNAL_PREFIX>_client_create(&client, service_name.c_str(),
-      broker_ip.c_str(), broker_port, user_name.c_str(), password.c_str(), my_ip.c_str(), protocols);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to create handle. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  ret = <INTERNAL_PREFIX>_client_add_disconnected_cb(client, OnDisconnectedCB,
-      this);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_client_add_disconnected_cb. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  ret = <INTERNAL_PREFIX>_client_add_connection_result_cb(client, OnConnectionResultCB,
-      this);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_client_add_connection_result_cb. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  ret = <INTERNAL_PREFIX>_client_add_payload_received_cb(client,
-      [](const char *service_name, const <INTERNAL_PREFIX>_peer_info_h peer_info,
-        const <INTERNAL_PREFIX>_payload_h payload, <INTERNAL_PREFIX>_transfer_status_e status, void *user_data) {
-            $$ *sr = static_cast<$$*>(user_data);
-            sr->OnPayloadReceivedCB(service_name, peer_info, payload,
-                static_cast<<MODULE_PREFIX>_payload_transfer_status_e>(status), user_data);
-          }, this);
-
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_client_add_payload_received_cb. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  client_ = client;
-)__c_cb";
-
-constexpr const char __GROUP_CREATE[] =
-R"__c_cb(<GROUP_T> group = nullptr;
-  int ret = <INTERNAL_PREFIX>_group_create(&group, topic_name_.c_str(),
-      broker_ip.c_str(), broker_port, user_name.c_str(), password.c_str(), my_ip.c_str(), protocols);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to create handle. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  ret = <INTERNAL_PREFIX>_group_add_joined_cb(group,
-      [](const char *topic_name, const <PEER_INFO_T> peer_info,
-          void *user_data) {
-            <CLS_NAME> *gr = static_cast<<CLS_NAME>*>(user_data);
-            gr->OnJoined(peer_info);
-          },
-      this);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_group_add_joined_cb. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  ret = <INTERNAL_PREFIX>_group_add_left_cb(group,
-      [](const char *topic_name, const <PEER_INFO_T> peer_info,
-          void *user_data) {
-            <CLS_NAME> *gr = static_cast<<CLS_NAME>*>(user_data);
-            gr->OnLeft(peer_info);
-          },
-      this);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_group_add_left_cb. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  ret = <INTERNAL_PREFIX>_group_add_payload_received_cb(group,
-      [](const char *topic_name, const <PEER_INFO_T> peer_info,
-          const <PAYLOAD_T> payload, void *user_data) {
-            <CLS_NAME> *gr = static_cast<<CLS_NAME>*>(user_data);
-            gr->OnPayloadReceivedCB(peer_info, payload);
-          },
-      this);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_group_add_payload_received_cb. error(%d)", ret);
-    throw InvalidIOException();
-  }
-
-  ret = <INTERNAL_PREFIX>_group_subscribe(group);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to subscribe. error(%d)", ret);
-    switch (ret) {
-    case AITT_PLUGIN_ERROR_PERMISSION_DENIED :
-      throw UnauthorizedAccessException();
-      break;
-    case AITT_PLUGIN_ERROR_INVALID_PARAMETER :
-      throw NotConnectedSocketException();
-      break;
-    default :
-      throw InvalidIOException();
-    }
-  }
-
-  group_ = group;
-)__c_cb";
-
-constexpr const char __GROUP_DESTROY[] =
-R"__c_cb(if (group_ != nullptr) {
-    <INTERNAL_PREFIX>_group_unsubscribe(group_);
-    <INTERNAL_PREFIX>_group_destroy(group_);
-  }
-)__c_cb";
-
-constexpr const char __CLIENT_DESTROY[] =
-R"__c_cb(
-  if (client_ != nullptr)
-    <INTERNAL_PREFIX>_client_destroy(client_);
-)__c_cb";
-
-const char __PEER_INFO_CLONE[] =
-  "<INTERNAL_PREFIX>_peer_info_clone(<SRC_PEER>, <DEST_PEER>);";
-
-constexpr const char __SERVER_SET_ONDEMAND_LAUNCH_ENABLED[] =
-R"__c_cb(int ret = <INTERNAL_PREFIX>_server_set_on_demand_launch_enabled(server_, enabled);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_server_set_on_demand_launch_enabled. error(%d)", ret);
-    switch(ret) {
-      case AITT_PLUGIN_ERROR_PERMISSION_DENIED :
-        throw UnauthorizedAccessException();
-        break;
-      default :
-        throw InvalidIOException();
-    }
-  }
-)__c_cb";
-
-constexpr const char __SERVER_LISTEN[] =
-R"__c_cb(int ret = <INTERNAL_PREFIX>_server_listen(server_, OnConnectionRequestCB, this);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_server_listen. error(%d)", ret);
-    switch(ret) {
-      case AITT_PLUGIN_ERROR_PERMISSION_DENIED :
-        throw UnauthorizedAccessException();
-        break;
-      default :
-        throw InvalidIOException();
-    }
-  }
-)__c_cb";
-
-constexpr const char __SERVER_DISCONNECT[] =
-R"__c_cb(int ret = <INTERNAL_PREFIX>_server_disconnect(<SERVER>, <PEER>);
-  if (ret != AITT_PLUGIN_ERROR_NONE) {
-    _E("Failed to <INTERNAL_PREFIX>_server_disconnect. error(%d)", ret);
-    throw InvalidIOException();
-  }
-)__c_cb";
-
-constexpr const char __PEER_INFO_GET_APPID[] =
-    "<INTERNAL_PREFIX>_peer_info_get_app_id(<PEER>, <APPID>);";
-
-constexpr const char __PEER_INFO_GET_UUID[] =
-    "<INTERNAL_PREFIX>_peer_info_get_uuid(<PEER>, <UUID>);";
-
-}  // namespace
-
-constexpr const char __COMMON_HEADER_PAYLOAD_HANDLE[] =
-R"__c_cb(
-/**
- * @brief Enumeration for <MODULE_PREFIX>_payload transfer status types.
- */
-typedef enum _<MODULE_PREFIX>_payload_transfer_status_e {
-  AITT_PLUGIN_PAYLOAD_TRANSFER_STATUS_SUCCESS, /**< Transfer is success **/
-  AITT_PLUGIN_PAYLOAD_TRANSFER_STATUS_FAILURE, /**< Transfer is failed **/
-  AITT_PLUGIN_PAYLOAD_TRANSFER_STATUS_IN_PROGRESS, /**< Transfer is in progress **/
-} <MODULE_PREFIX>_payload_transfer_status_e;
-
-/**
-  * @brief The <MODULE_PREFIX>_payload handle.
-  */
- typedef void *<MODULE_PREFIX>_payload_h;
- typedef void *<MODULE_PREFIX>_payload_async_result_h;
-
-)__c_cb";
-
-constexpr const char __COMMON_HEADER_HANDLES[] =
-R"__c_cb(
-
-typedef enum _<MODULE_PREFIX>_error {
-  AITT_PLUGIN_ERROR_NONE = TIZEN_ERROR_NONE, /**< Success */
-  AITT_PLUGIN_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
-  AITT_PLUGIN_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
-  AITT_PLUGIN_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
-  AITT_PLUGIN_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
-  AITT_PLUGIN_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Function not implemented */
-  AITT_PLUGIN_ERROR_ALREADY_IN_PROGRESS = TIZEN_ERROR_ALREADY_IN_PROGRESS, /**< Already in progress */
-  AITT_PLUGIN_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
-  AITT_PLUGIN_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< Timed out */
-  AITT_PLUGIN_ERROR_OPERATION_FAILED = TIZEN_ERROR_CION | 0x01, /**< Operation failed */
-} <MODULE_PREFIX>_error_e;
-
-enum AittProtocol {
-  AITT_TYPE_MQTT = (0x1 << 0),   // Publish message through the MQTT
-  AITT_TYPE_TCP = (0x1 << 1),   // Publish message to peers using the TCP
-  AITT_TYPE_UDP = (0x1 << 2),   // Publish message to peers using the UDP
-  AITT_TYPE_SRTP = (0x1 << 3),   // Publish message to peers using the SRTP
-  AITT_TYPE_WEBRTC = (0x1 << 4),  // Publish message to peers using the WEBRTC
-};
-
-/**
-  * @brief The aitt plugin peer info handle.
-  */
-typedef void *<MODULE_PREFIX>_peer_info_h;
-
-)__c_cb";
-
-constexpr const char __CLIENT_HEADER_HANDLES[] =
-R"__c_cb(
-  /**
-  * @brief The aitt client handle.
-  */
-typedef void *<MODULE_PREFIX>_client_h;
-
-)__c_cb";
-
-constexpr const char __CLIENT_SERVER_HANDLES[] =
-R"__c_cb(
-  /**
-  * @brief The aitt server handle.
-  */
-typedef void *<MODULE_PREFIX>_server_h;
-
-)__c_cb";
-
-constexpr const char __COMMON_HEADER_CONNECTION_RESULT_HANDLE[] =
-R"__c_cb(
-typedef enum _aitt_connection_status_e {
-  AITT_PLUGIN_CONNECTION_STATUS_OK, /**< Connection is ok **/
-  AITT_PLUGIN_CONNECTION_STATUS_REJECTED, /**< Connection is rejected **/
-  AITT_PLUGIN_CONNECTION_STATUS_ERROR, /**< Connection error occurs **/
-} <MODULE_PREFIX>_connection_status_e;
-
-/**
- * @brief The Aitt plugin connection result handle.
- */
-typedef void *<MODULE_PREFIX>_connection_result_h;
-
-)__c_cb";
-
-constexpr const char __COMMON_HEADER_COMMON_BASE[] =
-R"__c_cb(
-/**
-  * @brief Creates a clone of aitt plugin peer info handle.
-  * @remarks @a peer_info_clone must be released using <MODULE_PREFIX>_peer_info_destroy().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] peer_info_clone The cloned peer information handle
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  * @retval #AITT_PLUGIN_ERROR_IO_ERROR IO error
-  * @see <MODULE_PREFIX>_peer_info_destroy()
-  */
-int <MODULE_PREFIX>_peer_info_clone(const <MODULE_PREFIX>_peer_info_h peer_info,
-    <MODULE_PREFIX>_peer_info_h *peer_info_clone);
-
-/**
-  * @brief Destroys the peer info handle and releases all its resources.
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @see <MODULE_PREFIX>_peer_info_clone()
-  */
-int <MODULE_PREFIX>_peer_info_destroy(<MODULE_PREFIX>_peer_info_h peer_info);
-
-/**
-  * @brief Gets the device ID.
-  * @remarks @a device_id must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] device_id The device ID
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_device_id(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_id);
-
-/**
-  * @brief Gets the device name.
-  * @remarks @a device_name must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] device_name The device name
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_device_name(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_name);
-
-/**
-  * @brief Gets the device's platform.
-  * @remarks @a device_platform must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] device_platform The platform name
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_device_platform(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_platform);
-
-/**
-  * @brief Gets the device's platform version.
-  * @remarks @a device_platform_version must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] device_platform_version The platform version
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_device_platform_version(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_platform_version);
-
-/**
-  * @brief Gets the device's type.
-  * @remarks @a device_type must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] device_type Device type
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_device_type(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_type);
-
-/**
-  * @brief Gets application ID of peer.
-  * @remarks @a app_id must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] app_id The application ID
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_app_id(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **app_id);
-
-/**
-  * @brief Gets application version of peer.
-  * @remarks @a app_version must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] app_version The application version
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_app_version(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **app_version);
-
-/**
-  * @brief Gets UUID of peer.
-  * @remarks @a uuid must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] uuid The UUID
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_uuid(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **uuid);
-
-/**
-  * @brief Gets display name of peer.
-  * @details The custom name for service name. \n
-  *          It is possible that @a display_name does not exist.
-  * @remarks @a display_name must be released using free().
-  * @param[in] peer_info The aitt plugin peer information handle
-  * @param[out] display_name The display name
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-int <MODULE_PREFIX>_peer_info_get_display_name(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **display_name);
-
-)__c_cb";
-
-
-constexpr const char __COMMON_HEADER_PAYLOAD_BASE[] =
-R"__c_cb(
-/**
-  * @brief Saves the payload as a file.
-  * @remarks The @a path is absolute path.
-  * @remarks If the media storage is used, %http://tizen.org/privilege/mediastorage privilege is necessary. \n
-  *          If the external storage is used, %http://tizen.org/privilege/externalstorage privilege is necessary.
-  * @param[in] payload The <MODULE_PREFIX>_payload handle
-  * @param[in] path The path of file
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_PERMISSION_DENIED Permission denied
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OPERATION_FAILED Operation failed
-  */
-int <MODULE_PREFIX>_payload_save_as_file(<MODULE_PREFIX>_payload_h payload, const char *path);
-
-/**
-  * @brief Gets the name of received file from the payload.
-  * @remarks @a file_name must be released using free().
-  * @param[in] payload The <MODULE_PREFIX>_payload handle
-  * @param[out] file_name The name of file
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
-  */
-
-int <MODULE_PREFIX>_payload_get_received_file_name(<MODULE_PREFIX>_payload_h payload,
-    char **file_name);
-
-/**
-  * @brief Gets the size of currently received file from the payload.
-  * @param[in] payload The <MODULE_PREFIX>_payload handle
-  * @param[out] bytes The size of file
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  */
-int <MODULE_PREFIX>_payload_get_received_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes);
-
-/**
-  * @brief Gets the total size of file from the payload.
-  * @param[in] payload The <MODULE_PREFIX>_payload handle
-  * @param[out] bytes The size of file
-  * @return @c 0 on success, otherwise a negative error value
-  * @retval #AITT_PLUGIN_ERROR_NONE Successful
-  * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
-  */
-int <MODULE_PREFIX>_payload_get_total_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes);
-
-)__c_cb";
-
-constexpr const char __COMMON_HEADER_CONNECTION_RESULT_BASE[] =
-R"__c_cb(
-/**
- * @brief Gets the connection result status.
- * @param[in] result The connection result handle
- * @param[out] status Connection result status
- * @return @c 0 on success, otherwise a negative error value
- * @retval #AITT_PLUGIN_ERROR_NONE Successful
- * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int <MODULE_PREFIX>_connection_result_get_status(const <MODULE_PREFIX>_connection_result_h result,
-         <MODULE_PREFIX>_connection_status_e *status);
-
-/**
- * @brief Gets the connection result reason.
- * @remarks @a reason must be released using free().
- * @param[in] result The connection result handle
- * @param[out] reason Connection result reason, should be freed after use
- * @return @c 0 on success, otherwise a negative error value
- * @retval #AITT_PLUGIN_ERROR_NONE Successful
- * @retval #AITT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #AITT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
- */
-int <MODULE_PREFIX>_connection_result_get_reason(const <MODULE_PREFIX>_connection_result_h result,
-        char **reason);
-
-)__c_cb";
-
-constexpr const char __COMMON_BODY_PAYLOAD_BASE[] =
-R"__c_cb(
-int <MODULE_PREFIX>_payload_save_as_file(<MODULE_PREFIX>_payload_h payload, const char *path) {
-  return <INTERNAL_PREFIX>_payload_save_as_file(payload, path);
-}
-
-int <MODULE_PREFIX>_payload_get_received_file_name(<MODULE_PREFIX>_payload_h payload,
-    char **file_name) {
-  return <INTERNAL_PREFIX>_payload_get_received_file_name(payload, file_name);
-}
-
-int <MODULE_PREFIX>_payload_get_received_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes) {
-  return <INTERNAL_PREFIX>_payload_get_received_bytes(payload, bytes);
-}
-
-int <MODULE_PREFIX>_payload_get_total_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes) {
-  return <INTERNAL_PREFIX>_payload_get_total_bytes(payload, bytes);
-}
-
-)__c_cb";
-
-constexpr const char __COMMON_BODY_CONNECTION_RESULT_BASE[] =
-R"__c_cb(
-int <MODULE_PREFIX>_connection_result_get_status(const <MODULE_PREFIX>_connection_result_h result,
-    <MODULE_PREFIX>_connection_status_e *status) {
-  return <INTERNAL_PREFIX>_connection_result_get_status(result,(<INTERNAL_PREFIX>_connection_status_e *)status);
-}
-
-int <MODULE_PREFIX>_connection_result_get_reason(const <MODULE_PREFIX>_connection_result_h result,
-    char **reason) {
-  return <INTERNAL_PREFIX>_connection_result_get_reason(result, reason);
-}
-
-)__c_cb";
-
-constexpr const char __COMMON_BODY_PEERINFO_BASE[] =
-R"__c_cb(
-int <MODULE_PREFIX>_peer_info_clone(const <MODULE_PREFIX>_peer_info_h peer_info,
-    <MODULE_PREFIX>_peer_info_h *peer_info_clone) {
-  return  <INTERNAL_PREFIX>_peer_info_clone(peer_info, peer_info_clone);
-}
-
-int <MODULE_PREFIX>_peer_info_destroy(<MODULE_PREFIX>_peer_info_h peer_info) {
-  return <INTERNAL_PREFIX>_peer_info_destroy(peer_info);
-}
-
-int <MODULE_PREFIX>_peer_info_get_device_id(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_id) {
-  return <INTERNAL_PREFIX>_peer_info_get_device_id(peer_info, device_id);
-}
-
-int <MODULE_PREFIX>_peer_info_get_device_name(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_name) {
-  return <INTERNAL_PREFIX>_peer_info_get_device_name(peer_info, device_name);
-}
-
-int <MODULE_PREFIX>_peer_info_get_device_platform(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_platform) {
-  return <INTERNAL_PREFIX>_peer_info_get_device_platform(peer_info, device_platform);
-}
-
-int <MODULE_PREFIX>_peer_info_get_device_platform_version(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_platform_version) {
-  return <INTERNAL_PREFIX>_peer_info_get_device_platform_version(peer_info, device_platform_version);
-}
-
-int <MODULE_PREFIX>_peer_info_get_device_type(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **device_type) {
-  return <INTERNAL_PREFIX>_peer_info_get_device_type(peer_info, device_type);
-}
-
-int <MODULE_PREFIX>_peer_info_get_app_id(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **app_id) {
-  return <INTERNAL_PREFIX>_peer_info_get_app_id(peer_info, app_id);
-}
-
-int <MODULE_PREFIX>_peer_info_get_app_version(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **app_version) {
-  return <INTERNAL_PREFIX>_peer_info_get_app_version(peer_info,  app_version);
-}
-
-int <MODULE_PREFIX>_peer_info_get_uuid(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **uuid) {
-  return <INTERNAL_PREFIX>_peer_info_get_uuid(peer_info, uuid);
-}
-
-int <MODULE_PREFIX>_peer_info_get_display_name(<MODULE_PREFIX>_peer_info_h peer_info,
-    char **display_name) {
-  return <INTERNAL_PREFIX>_peer_info_get_display_name(peer_info, display_name);
-}
-
-)__c_cb";
-
-namespace tidl {
-
-std::string AittPluginCppTransportable::GenInclude(int type) const {
-    return "#include \"<FILENAME>_internal.h\"";
-}
-
-std::string AittPluginCppTransportable::GenHeaderBase() const {
-  return __COMMON_HEADER_COMMON_BASE;
-}
-
-std::string AittPluginCppTransportable::GenHeaderPayloadHandle() const {
-  return __COMMON_HEADER_PAYLOAD_HANDLE;
-}
-
-std::string AittPluginCppTransportable::GenHeaderCommonHandle() const {
-  return __COMMON_HEADER_HANDLES;
-}
-
-std::string AittPluginCppTransportable::GenHeaderClientHandle() const {
-  return __CLIENT_HEADER_HANDLES;
-}
-
-std::string AittPluginCppTransportable::GenHeaderServerHandle() const {
-  return __CLIENT_SERVER_HANDLES;
-}
-std::string AittPluginCppTransportable::GenHeaderGroupHandle() const {
-  return __GROUP_HANDLES;
-}
-
-std::string AittPluginCppTransportable::GenHeaderConnectionHandle() const {
-  return __COMMON_HEADER_CONNECTION_RESULT_HANDLE;
-}
-
-std::string AittPluginCppTransportable::GenHeaderPayloadBase() const {
-  return __COMMON_HEADER_PAYLOAD_BASE;
-}
-
-std::string AittPluginCppTransportable::GenHeaderConnectionBase() const {
-  return __COMMON_HEADER_CONNECTION_RESULT_BASE;
-}
-
-std::string AittPluginCppTransportable::GenBodyPayloadBase() const {
-  return __COMMON_BODY_PAYLOAD_BASE;
-}
-
-std::string AittPluginCppTransportable::GenBodyConnectionBase() const {
-  return __COMMON_BODY_CONNECTION_RESULT_BASE;
-}
-
-std::string AittPluginCppTransportable::GenBodyPeerInfoBase() const {
-  return __COMMON_BODY_PEERINFO_BASE;
-}
-
-std::string AittPluginCppTransportable::GenNamespace() const {
-  return "aitt";
-}
-
-std::string AittPluginCppTransportable::GenProxyPrefix() const {
-  return "aitt_plugin_proxy";
-}
-
-std::string AittPluginCppTransportable::GenStubPrefix() const {
-  return "aitt_plugin_stub";
-}
-
-std::string AittPluginCppTransportable::GenGroupPrefix() const {
-  return "aitt_plugin_group";
-}
-
-std::string AittPluginCppTransportable::GenModulePrefix() const {
-  return "aitt_plugin";
-}
-
-std::string AittPluginCppTransportable::GenErrorPrefix() const {
-  return "AITT_PLUGIN";
-}
-
-std::string AittPluginCppTransportable::GenConnectionResultPrefix() const {
-  return "";
-}
-
-std::string AittPluginCppTransportable::GenClientSendAsync(std::string client,
-    std::string payload, std::string size) const {
-  return std::string(ReplaceAll(__CLIENT_SEND_ASYNC, {
-      { "<CLIENT>", client },
-      { "<PAYLOAD>", payload},
-      { "<SIZE>", size} }));
-}
-
-std::string AittPluginCppTransportable::GenClientSend(std::string client,
-    std::string data, std::string data_size,
-    std::string ret_data, std::string ret_data_size) const {
-  return std::string(ReplaceAll(__CLIENT_SEND, {
-      { "<CLIENT>", client },
-      { "<DATA>", data},
-      { "<DATA_SIZE>", data_size},
-      { "<RET_DATA>", ret_data},
-      { "<RET_DATA_SIZE>", ret_data_size} }));
-}
-
-std::string AittPluginCppTransportable::GenServerSendAsync(std::string server,
-    std::string client,
-    std::string payload, std::string size) const {
-  return std::string(ReplaceAll(__SERVER_SEND_ASYNC, {
-      { "<SERVER>", server },
-      { "<CLIENT>", client},
-      { "<PAYLOAD>", payload},
-      { "<SIZE>", size} }));
-}
-
-std::string AittPluginCppTransportable::GenServerFileSend(std::string path,
-    std::string server, std::string peer) const {
-  return std::string(ReplaceAll(__SERVER_FILE_SEND, {
-      { "<FILE_PATH>", path },
-      { "<SERVER_H>", server },
-      { "<PEER_H>", peer } }));
-}
-
-std::string AittPluginCppTransportable::GenClientFileSend(std::string path,
-    std::string client) const {
-  return std::string(ReplaceAll(__CLINET_FILE_SEND, {
-      { "<FILE_PATH>", path },
-      { "<CLIENT_H>", client } }));
-}
-
-std::string AittPluginCppTransportable::GenGroupType() const {
-  return "<MODULE_PREFIX>_group_h";
-}
-
-std::string AittPluginCppTransportable::GenPayloadTransferStatusType(bool internal_type) const {
-  if (internal_type)
-    return "<INTERNAL_PREFIX>_transfer_status_e";
-  else
-    return "<MODULE_PREFIX>_payload_transfer_status_e";
-}
-
-std::string AittPluginCppTransportable::GenPayloadAsyncResultType() const {
-  return "<MODULE_PREFIX>_payload_async_result_h";
-}
-
-std::string AittPluginCppTransportable::GenPeerInfoType() const {
-  return "<MODULE_PREFIX>_peer_info_h";
-}
-
-std::string AittPluginCppTransportable::GenPeerInfoDestroy(
-    std::string peer) const {
-  return std::string(ReplaceAll("<MODULE_PREFIX>_peer_info_destroy(<PEER>);", {
-      { "<PEER>", peer } }));
-}
-
-std::string AittPluginCppTransportable::GenPayloadType() const {
-  return "<MODULE_PREFIX>_payload_h";
-}
-
-std::string AittPluginCppTransportable::GenClientType() const {
-  return "<MODULE_PREFIX>_client_h";
-}
-
-std::string AittPluginCppTransportable::GenSecurityType(bool definition) const {
-  return "";
-}
-
-std::string AittPluginCppTransportable::GenServerType() const {
-  return "<MODULE_PREFIX>_server_h";
-}
-
-std::string AittPluginCppTransportable::GenClientTryConnect(std::string client,
-    std::string peer) const {
-  return std::string(ReplaceAll(__CLIENT_TRY_CONNECT, {
-      { "<CLIENT>", client },
-      { "<PEER>", peer } }));
-}
-
-std::string AittPluginCppTransportable::GenClientDisconnect(
-    std::string client) const {
-  return std::string(ReplaceAll(__CLIENT_DISCONNECT, {
-      { "<CLIENT>", client } }));
-}
-
-std::string AittPluginCppTransportable::GenClientTryDiscovery(
-    std::string client) const {
-  return std::string(ReplaceAll(__CLIENT_TRY_DISCOVERY, {
-      { "<CLIENT>", client } }));
-}
-
-std::string AittPluginCppTransportable::GenClientStopDiscovery(
-    std::string client) const {
-  return std::string(ReplaceAll(__CLIENT_STOP_DISCOVERY, {
-      { "<CLIENT>", client } }));
-}
-
-std::string AittPluginCppTransportable::GenServerRegister() const {
-  return __SERVER_REGISTER;
-}
-
-std::string AittPluginCppTransportable::GenServerUnregister() const {
-  return __SERVER_UNREGISTER;
-}
-
-std::string AittPluginCppTransportable::GenClientExtraHeader() const {
-  return "";
-}
-
-std::string AittPluginCppTransportable::GenClientExtraBody() const {
-  return "";
-}
-
-std::string AittPluginCppTransportable::GenServerExtraHeader() const {
-  return "";
-}
-
-std::string AittPluginCppTransportable::GenServerExtraBody() const {
-  return "";
-}
-
-std::string AittPluginCppTransportable::GenServerAccept() const {
-  return __SERVER_ACCEPT;
-}
-
-std::string AittPluginCppTransportable::GenServerReject() const {
-  return __SERVER_REJECT;
-}
-
-std::string AittPluginCppTransportable::GenServerSetDisplayName() const {
-  return __SERVER_SET_DISPLAY_NAME;
-}
-
-std::string AittPluginCppTransportable::GenGroupPublish() const {
-  return __GROUP_PUBLISH;
-}
-
-std::string AittPluginCppTransportable::GenPayloadTypeEnum() const {
-  return "<INTERNAL_PREFIX>_payload_type_e";
-}
-
-std::string AittPluginCppTransportable::GenPayloadTypeData() const {
-  return "AITT_PLUGIN_PAYLOAD_TYPE_DATA";
-}
-
-std::string AittPluginCppTransportable::GenPayloadTypeFile() const {
-  return "AITT_PLUGIN_PAYLOAD_TYPE_FILE";
-}
-
-std::string AittPluginCppTransportable::GenPayloadGetType() const {
-  return "ret = <INTERNAL_PREFIX>_payload_get_type(payload, &type);";
-}
-
-std::string AittPluginCppTransportable::GenErrorNone() const {
-  return "AITT_PLUGIN_ERROR_NONE";
-}
-
-std::string AittPluginCppTransportable::GenPayloadGetData() const {
-  return "ret = <INTERNAL_PREFIX>_payload_get_data(payload, &data, &size);";
-}
-
-std::string AittPluginCppTransportable::GenClientCreate() const {
-  return __CLIENT_CREATE;
-}
-
-std::string AittPluginCppTransportable::GenGroupCreate() const {
-  return __GROUP_CREATE;
-}
-
-std::string AittPluginCppTransportable::GenGroupDestroy() const {
-  return __GROUP_DESTROY;
-}
-
-std::string AittPluginCppTransportable::GenClientDestroy() const {
-  return __CLIENT_DESTROY;
-}
-
-std::string AittPluginCppTransportable::GenSetSecurityCA(std::string arg) const {
-  return "";
-}
-
-std::string AittPluginCppTransportable::GenSetSecurityCert(std::string arg) const {
-  return "";
-}
-
-std::string AittPluginCppTransportable::GenSetSecurityPrivateKey(
-    std::string arg) const {
-  return "";
-}
-
-std::string AittPluginCppTransportable::GenPeerInfoClone(std::string src_peer,
-      std::string dest_peer) const {
-  return std::string(ReplaceAll(__PEER_INFO_CLONE, {
-      { "<SRC_PEER>", src_peer },
-      { "<DEST_PEER>", dest_peer } }));
-}
-
-std::string AittPluginCppTransportable::GenServerSetOnDemandLaunchEnabled() const {
-  return "";
-}
-
-std::string AittPluginCppTransportable::GenServerListen() const {
-  return __SERVER_LISTEN;
-}
-
-std::string AittPluginCppTransportable::GenServerDisconnect(std::string server,
-      std::string peer) const {
-  return std::string(ReplaceAll(__SERVER_DISCONNECT, {
-      { "<SERVER>", server },
-      { "<PEER>", peer } }));
-}
-
-std::string AittPluginCppTransportable::GenPeerInfoGetAppID(std::string peer,
-      std::string appid) const {
-  return std::string(ReplaceAll(__PEER_INFO_GET_APPID, {
-      { "<PEER>", peer},
-      { "<APPID>", appid} }));
-}
-
-std::string AittPluginCppTransportable::GenPeerInfoGetUUID(std::string peer,
-      std::string uuid) const {
-  return std::string(ReplaceAll(__PEER_INFO_GET_UUID, {
-      { "<PEER>", peer},
-      { "<UUID>", uuid} }));
-}
-
-}  // namespace tidl
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_cpp_transportable.h b/idlc/gen_aitt_plugin/aitt_plugin_cpp_transportable.h
deleted file mode 100644 (file)
index d7de754..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IDLC_GEN_AITT_PLUGIN_CPP_TRANSPORTABLE_H_
-#define IDLC_GEN_AITT_PLUGIN_CPP_TRANSPORTABLE_H_
-
-#include <string>
-
-#include "idlc/gen_cion/cpp_transportable.h"
-
-namespace tidl {
-
-class AittPluginCppTransportable : public CppTransportable {
- public:
-  virtual ~AittPluginCppTransportable() = default;
-  std::string GenInclude(int type = 0) const override;
-  std::string GenClientSendAsync(std::string client,
-      std::string payload, std::string size) const override;
-  std::string GenClientSend(std::string client, std::string data,
-      std::string data_size, std::string ret_data,
-      std::string ret_data_size) const override;
-  std::string GenServerSendAsync(std::string server, std::string client,
-      std::string payload, std::string size) const override;
-  std::string GenServerFileSend(std::string path,
-      std::string server, std::string peer) const override;
-  std::string GenClientFileSend(std::string path,
-      std::string client) const override;
-  std::string GenGroupType() const override;
-  std::string GenPayloadTransferStatusType(bool internal_type = false) const override;
-  std::string GenPayloadAsyncResultType() const override;
-  std::string GenPeerInfoType() const override;
-  std::string GenPeerInfoDestroy(std::string peer) const override;
-  std::string GenPayloadType() const override;
-  std::string GenClientType() const override;
-  std::string GenSecurityType(bool definition = true) const override;
-  std::string GenServerType() const override;
-  std::string GenClientTryConnect(std::string client,
-      std::string peer) const override;
-  std::string GenClientDisconnect(std::string client) const override;
-  std::string GenClientTryDiscovery(std::string client) const override;
-  std::string GenClientStopDiscovery(std::string client) const override;
-  std::string GenServerRegister() const override;
-  std::string GenServerUnregister() const override;
-  std::string GenClientExtraHeader() const override;
-  std::string GenClientExtraBody() const override;
-  std::string GenServerExtraHeader() const override;
-  std::string GenServerExtraBody() const override;
-  std::string GenServerAccept() const override;
-  std::string GenServerReject() const override;
-  std::string GenServerSetDisplayName() const override;
-  std::string GenGroupPublish() const override;
-  std::string GenPayloadTypeEnum() const override;
-  std::string GenPayloadTypeData() const override;
-  std::string GenPayloadTypeFile() const override;
-  std::string GenPayloadGetType() const override;
-  std::string GenErrorNone() const override;
-  std::string GenPayloadGetData() const override;
-  std::string GenClientCreate() const override;
-  std::string GenGroupCreate() const override;
-  std::string GenGroupDestroy() const override;
-  std::string GenClientDestroy() const override;
-  std::string GenSetSecurityCA(std::string arg) const override;
-  std::string GenSetSecurityCert(std::string arg) const override;
-  std::string GenSetSecurityPrivateKey(std::string arg) const override;
-  std::string GenPeerInfoClone(std::string src_peer,
-      std::string dest_peer) const override;
-  std::string GenServerSetOnDemandLaunchEnabled() const override;
-  std::string GenServerListen() const override;
-  std::string GenServerDisconnect(std::string server,
-      std::string peer) const override;
-  std::string GenPeerInfoGetAppID(std::string peer,
-      std::string appid) const override;
-  std::string GenPeerInfoGetUUID(std::string peer,
-      std::string uuid) const override;
-  std::string GenHeaderBase() const override;
-  std::string GenHeaderPayloadHandle() const override;
-  std::string GenHeaderCommonHandle() const override;
-  std::string GenHeaderClientHandle() const override;
-  std::string GenHeaderServerHandle() const override;
-  std::string GenHeaderGroupHandle() const override;
-  std::string GenHeaderConnectionHandle() const override;
-  std::string GenHeaderPayloadBase() const override;
-  std::string GenHeaderConnectionBase() const override;
-  std::string GenBodyPayloadBase() const override;
-  std::string GenBodyConnectionBase() const override;
-  std::string GenBodyPeerInfoBase() const override;
-  std::string GenNamespace() const override;
-  std::string GenProxyPrefix() const override;
-  std::string GenStubPrefix() const override;
-  std::string GenGroupPrefix() const override;
-  std::string GenModulePrefix() const override;
-  std::string GenErrorPrefix() const override;
-  std::string GenConnectionResultPrefix() const override;
-};
-
-}  // namespace tidl
-
-#endif  // IDLC_GEN_AITT_PLUGIN_CPP_TRANSPORTABLE_H_
\ No newline at end of file
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_cs_base_gen.cc b/idlc/gen_aitt_plugin/aitt_plugin_cs_base_gen.cc
deleted file mode 100644 (file)
index e8e8ce0..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "idlc/gen_aitt_plugin/aitt_plugin_cs_base_gen.h"
-
-#include "idlc/gen_aitt_plugin/aitt_plugin_cs_base_gen_cb.h"
-
-namespace tidl {
-
-AittPluginCsBaseGen::AittPluginCsBaseGen(std::shared_ptr<Document> doc,
-    std::shared_ptr<tidl::Transportable> trans) : CionPluginBase(doc, trans) {
-}
-
-void AittPluginCsBaseGen::OnInitGen(std::ofstream& stream) {
-  GenUsing(stream);
-  stream << "namespace Tizen.Applications.AittPlugin\n";
-  stream << "{\n";
-  GenBase(stream);
-  stream << "}\n";
-}
-
-void AittPluginCsBaseGen::OnFiniGen(std::ofstream& stream) {
-}
-
-void AittPluginCsBaseGen::GenUsing(std::ofstream& stream) {
-  stream << CB_BASE_USING;
-}
-
-void AittPluginCsBaseGen::GenBase(std::ofstream& stream) {
-  stream << CB_ERROR_FACTORY;
-  stream << CB_DATA_PAYLOAD;
-  stream << CB_FILE_PAYLOAD;
-  stream << CB_PEER_INFO;
-  stream << CB_PEER_INFO_SAFE_HANDLE;
-  stream << CB_PAYLOAD;
-  stream << CB_PAYLOAD_ASYNC_RESULT;
-  stream << CB_PAYLOAD_ASYNC_RESULT_CODE;
-  stream << CB_PAYLOAD_SAFE_HANDLE;
-  stream << CB_PAYLOAD_TRANSFER_STATUS;
-  stream << CB_PAYLOAD_TYPE;
-  stream << CB_CONNECTION_RESULT;
-  stream << CB_CONNECTION_STATUS;
-
-  switch (GetType()) {
-    // client
-    case 1:
-      stream << CB_CLIENT_SAFE_HANDLE;
-      stream << CB_CLIENT_BASE;
-      break;
-    // server
-    case 2:
-      stream << CB_SERVER_SAFE_HANDLE;
-      stream << CB_SERVER_BASE;
-      break;
-    // group
-    case 3:
-      stream << CB_GROUP_SAFE_HANDLE;
-      stream << CB_GROUP_BASE;
-      break;
-    default:
-      break;
-  }
-}
-
-}  // namespace tidl
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_cs_base_gen.h b/idlc/gen_aitt_plugin/aitt_plugin_cs_base_gen.h
deleted file mode 100644 (file)
index 153cc48..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_BASE_GEN_H_
-#define IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_BASE_GEN_H_
-
-#include <memory>
-
-#include "idlc/gen_cion/cion_plugin_base.h"
-
-namespace tidl {
-
-class AittPluginCsBaseGen : public CionPluginBase {
- public:
-  explicit AittPluginCsBaseGen(std::shared_ptr<Document> doc,
-      std::shared_ptr<tidl::Transportable> trans);
-  virtual ~AittPluginCsBaseGen() = default;
-
-  void OnInitGen(std::ofstream& stream) override;
-  void OnFiniGen(std::ofstream& stream) override;
-
- private:
-  void GenUsing(std::ofstream& stream);
-  void GenBase(std::ofstream& stream);
-};
-
-}  // namespace tidl
-
-#endif  // IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_BASE_GEN_H_
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_cs_base_gen_cb.h b/idlc/gen_aitt_plugin/aitt_plugin_cs_base_gen_cb.h
deleted file mode 100644 (file)
index 74f9093..0000000
+++ /dev/null
@@ -1,1301 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_BASE_GEN_CB_H_
-#define IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_BASE_GEN_CB_H_
-
-constexpr char CB_BASE_USING[] =
-R"__cs_cb(
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-using System.Threading.Tasks;
-)__cs_cb";
-
-constexpr char CB_ERROR_FACTORY[] =
-R"__cs_cb(
-    internal static class AittPluginErrorFactory
-    {
-        internal static Exception GetException(Interop.AittPlugin.ErrorCode err, string message)
-        {
-            string errMessage = string.Format("{0} err = {1}", message, err);
-            switch (err)
-            {
-                case Interop.AittPlugin.ErrorCode.IoError:
-                    return new InvalidOperationException(errMessage);
-                case Interop.AittPlugin.ErrorCode.OutOfMemory:
-                    return new InvalidOperationException(errMessage);
-                case Interop.AittPlugin.ErrorCode.PermissionDenied:
-                    return new UnauthorizedAccessException(errMessage);
-                case Interop.AittPlugin.ErrorCode.InvalidParameter:
-                    return new ArgumentException(errMessage);
-                case Interop.AittPlugin.ErrorCode.InvalidOperation:
-                    return new InvalidOperationException(errMessage);
-                case Interop.AittPlugin.ErrorCode.AlreadyInProgress:
-                    return new InvalidOperationException(errMessage);
-                case Interop.AittPlugin.ErrorCode.NotSupported:
-                    return new NotSupportedException(errMessage);
-                case Interop.AittPlugin.ErrorCode.TimedOut:
-                    return new TimeoutException(errMessage);
-                case Interop.AittPlugin.ErrorCode.OperationFailed:
-                    return new InvalidOperationException(errMessage);
-                default:
-                    return new InvalidOperationException(errMessage);
-            }
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_CLIENT_BASE[] =
-R"__cs_cb(
-    public abstract class ClientBase : IDisposable
-    {
-        private readonly string LogTag = "Tizen.Applications.AittPlugin";
-        private readonly ClientSafeHandle _handle;
-
-        private PeerInfo _peer;
-
-        private Interop.AittPluginClient.AittPluginClientServerDiscoveredCb _discoveredCb;
-        private Interop.AittPluginClient.AittPluginClientConnectionResultCb _connectionResultCb;
-        private Interop.AittPluginClient.AittPluginClientPayloadReceivedCb _payloadRecievedCb;
-        private Interop.AittPluginClient.AittPluginClientDisconnectedCb _disconnectedCb;
-        private Dictionary<string, TaskCompletionSource<PayloadAsyncResult>> _tcsDictionary = new Dictionary<string, TaskCompletionSource<PayloadAsyncResult>>();
-        private Dictionary<string, Interop.AittPluginClient.AittPluginClientPayloadAsyncResultCb> _payloadAsyncCbDictionary = new Dictionary<string, Interop.AittPluginClient.AittPluginClientPayloadAsyncResultCb>();
-
-        public string ServiceName { get; }
-
-        public PeerInfo PeerInfo
-        {
-            get
-            {
-                return _peer;
-            }
-        }
-
-        public ClientBase(string serviceName, string brokerIp, int brokerPort, string userName, string password, string myIp, int protocol)
-        {
-            ServiceName = serviceName;
-
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginClient.AittPluginClientCreate(out _handle, serviceName, brokerIp, brokerPort, userName, password, myIp, protocol);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to create client.");
-            }
-
-            _connectionResultCb = new Interop.AittPluginClient.AittPluginClientConnectionResultCb(
-                (string service, IntPtr peerInfo, IntPtr result, IntPtr userData) =>
-                {
-                    Interop.AittPlugin.ErrorCode clone_ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
-                    if (clone_ret != Interop.AittPlugin.ErrorCode.None)
-                    {
-                        Log.Error(LogTag, string.Format("Failed to clone peer info."));
-                        return;
-                    }
-
-                    PeerInfo peer = new PeerInfo(clone);
-                    ConnectionResult connectionResult = new ConnectionResult(result);
-                    if (connectionResult.Status == ConnectionStatus.OK)
-                    {
-                        _peer = peer;
-                    }
-
-                    OnConnectionResult(peer, connectionResult);
-                });
-            ret = Interop.AittPluginClient.AittPluginClientAddConnectionResultCb(_handle, _connectionResultCb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                _handle.Dispose();
-                throw AittPluginErrorFactory.GetException(ret, "Failed to add connection status changed callback.");
-            }
-
-            _payloadRecievedCb = new Interop.AittPluginClient.AittPluginClientPayloadReceivedCb(
-                (string service, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData) =>
-                {
-                    Payload receivedPayload;
-                    Interop.AittPluginPayload.AittPluginPayloadGetType(payload, out Interop.AittPluginPayload.PayloadType type);
-                    switch (type)
-                    {
-                        case Interop.AittPluginPayload.PayloadType.Data:
-                            receivedPayload = new DataPayload(new PayloadSafeHandle(payload, false));
-                            break;
-                        case Interop.AittPluginPayload.PayloadType.File:
-                            receivedPayload = new FilePayload(new PayloadSafeHandle(payload, false));
-                            break;
-                        default:
-                            Log.Error(LogTag, "Invalid payload type received.");
-                            return;
-                    }
-                    OnPayloadReceived(receivedPayload, (PayloadTransferStatus)status);
-                });
-            ret = Interop.AittPluginClient.AittPluginClientAddPayloadReceivedCb(_handle, _payloadRecievedCb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                _handle.Dispose();
-                throw AittPluginErrorFactory.GetException(ret, "Failed to add payload received callback.");
-            }
-
-            _disconnectedCb = new Interop.AittPluginClient.AittPluginClientDisconnectedCb(
-                (string service, IntPtr peerInfo, IntPtr userData) =>
-                {
-                    Interop.AittPlugin.ErrorCode clone_ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
-                    if (clone_ret != Interop.AittPlugin.ErrorCode.None)
-                    {
-                        Log.Error(LogTag, string.Format("Failed to clone peer info."));
-                        return;
-                    }
-                    OnDisconnected(new PeerInfo(clone));
-                });
-            ret = Interop.AittPluginClient.AittPluginClientAddDisconnectedCb(_handle, _disconnectedCb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                _handle.Dispose();
-                throw AittPluginErrorFactory.GetException(ret, "Failed to add disconnected callback.");
-            }
-        }
-
-        public void TryDiscovery()
-        {
-            if (_discoveredCb == null)
-            {
-                Interop.AittPluginClient.AittPluginClientServerDiscoveredCb cb = new Interop.AittPluginClient.AittPluginClientServerDiscoveredCb(
-                    (string serviceName, IntPtr peerInfo, IntPtr userData) =>
-                    {
-                        Interop.AittPlugin.ErrorCode clone_ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
-                        if (clone_ret != Interop.AittPlugin.ErrorCode.None)
-                        {
-                            Log.Error(LogTag, "Failed to clone peer info.");
-                            return;
-                        }
-                        OnDiscovered(new PeerInfo(clone));
-                    });
-                _discoveredCb = cb;
-            }
-
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginClient.AittPluginClientTryDiscovery(_handle, _discoveredCb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to try discovery.");
-            }
-        }
-
-        public void StopDiscovery()
-        {
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginClient.AittPluginClientStopDiscovery(_handle);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to stop discovery.");
-            }
-        }
-
-        public void Connect(PeerInfo peer)
-        {
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginClient.AittPluginClientConnect(_handle, peer?._handle);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to connect.");
-            }
-        }
-
-        public void Disconnect()
-        {
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginClient.AittPluginClientDisconnect(_handle);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                Log.Error(LogTag, string.Format("Failed to disconnect: {0}", ret));
-            }
-            _peer = null;
-        }
-
-        public byte[] SendData(byte[] data, int timeout)
-        {
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginClient.AittPluginClientSendData(_handle, data, data?.Length ?? -1, timeout, out IntPtr returnDataPtr, out int returnDataSize);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to send data.");
-            }
-            byte[] returnData = new byte[returnDataSize];
-            Marshal.Copy(returnDataPtr, returnData, 0, returnDataSize);
-            Log.Info(LogTag, string.Format("Returned data size: {0}", returnDataSize));
-
-            return returnData;
-        }
-
-        public Task<PayloadAsyncResult> SendPayloadAsync(Payload payload)
-        {
-            if (payload == null || payload.Id.Length == 0)
-            {
-                throw new ArgumentException("Payload is invalid.");
-            }
-
-            if (_tcsDictionary.ContainsKey(payload.Id))
-            {
-                throw new InvalidOperationException("Payload is already sent.");
-            }
-
-            TaskCompletionSource<PayloadAsyncResult> tcs = new TaskCompletionSource<PayloadAsyncResult>();
-            _tcsDictionary[payload.Id] = tcs;
-
-            Interop.AittPluginClient.AittPluginClientPayloadAsyncResultCb cb = new Interop.AittPluginClient.AittPluginClientPayloadAsyncResultCb(
-                (IntPtr result, IntPtr userData) =>
-                {
-                    TaskCompletionSource<PayloadAsyncResult> tcsToReturn = _tcsDictionary[payload.Id];
-                    PayloadAsyncResult resultPayload = null;
-                    try
-                    {
-                        resultPayload = PayloadAsyncResult.CreateFromHandle(result);
-                    }
-                    catch (Exception e)
-                    {
-                        Log.Error(LogTag, string.Format("Failed to create PayloadAsyncResult from result handle: {0}.", e.Message));
-                        tcsToReturn.SetException(e);
-                        return;
-                    }
-                    tcsToReturn.SetResult(resultPayload);
-                    _payloadAsyncCbDictionary.Remove(resultPayload.PayloadId);
-                    _tcsDictionary.Remove(resultPayload.PayloadId);
-                });
-
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginClient.AittPluginClientSendPayloadAsync(_handle, payload?._handle, cb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to send payload.");
-            }
-
-            _payloadAsyncCbDictionary[payload?.Id] = cb;
-
-            return tcs.Task;
-        }
-
-        protected abstract void OnConnectionResult(PeerInfo peerInfo, ConnectionResult result);
-        protected abstract void OnPayloadReceived(Payload payload, PayloadTransferStatus status);
-        protected abstract void OnDiscovered(PeerInfo peerInfo);
-        protected abstract void OnDisconnected(PeerInfo peerInfo);
-
-        private bool disposedValue = false;
-
-        protected virtual void Dispose(bool disposing)
-        {
-            if (!disposedValue)
-            {
-                if (disposing)
-                {
-                    _handle.Dispose();
-                }
-                disposedValue = true;
-            }
-        }
-
-        public void Dispose()
-        {
-            Dispose(true);
-            GC.SuppressFinalize(this);
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_CLIENT_SAFE_HANDLE[] =
-R"__cs_cb(
-    internal sealed class ClientSafeHandle : SafeHandle
-    {
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public ClientSafeHandle() : base(IntPtr.Zero, true)
-        {
-        }
-
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public override bool IsInvalid
-        {
-            get { return this.DangerousGetHandle() == IntPtr.Zero; }
-        }
-
-        protected override bool ReleaseHandle()
-        {
-            Interop.AittPluginClient.AittPluginClientDestroy(this.handle);
-            SetHandle(IntPtr.Zero);
-            return true;
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_CONNECTION_RESULT[] =
-R"__cs_cb(
-    public class ConnectionResult
-    {
-        private readonly string _reason;
-        private readonly ConnectionStatus _status;
-
-        internal ConnectionResult(IntPtr handle)
-        {
-            Interop.AittPluginConnectionResult.AittPluginConnectionResultGetReason(handle, out _reason);
-            Interop.AittPluginConnectionResult.AittPluginConnectionResultGetStatus(handle, out _status);
-        }
-
-        public ConnectionStatus Status
-        {
-            get
-            {
-                return _status;
-            }
-        }
-
-        public string Reason
-        {
-            get
-            {
-                return _reason;
-            }
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_CONNECTION_STATUS[] =
-R"__cs_cb(
-    public enum ConnectionStatus
-    {
-        OK,
-        Rejected,
-        Error,
-    }
-)__cs_cb";
-
-constexpr char CB_DATA_PAYLOAD[] =
-R"__cs_cb(
-    public class DataPayload : Payload
-    {
-        internal DataPayload(PayloadSafeHandle handle)
-        {
-            _handle = handle;
-        }
-
-        public DataPayload(byte[] data)
-        {
-            Interop.AittPluginPayload.AittPluginPayloadCreate(out _handle, Interop.AittPluginPayload.PayloadType.Data);
-            Interop.AittPluginPayload.AittPluginPayloadSetData(_handle, data, data?.Length ?? -1);
-        }
-
-        public override PayloadType PayloadType
-        {
-            get
-            {
-                return PayloadType.DataPayload;
-            }
-        }
-
-        public byte[] Data
-        {
-            get
-            {
-                Interop.AittPluginPayload.AittPluginPayloadGetData(_handle, out IntPtr byteArrPtr, out int size);
-                byte[] byteArr = new byte[size];
-                Marshal.Copy(byteArrPtr, byteArr, 0, size);
-                return byteArr;
-            }
-            set
-            {
-                Interop.AittPluginPayload.AittPluginPayloadSetData(_handle, value, value?.Length ?? 0);
-            }
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_FILE_PAYLOAD[] =
-R"__cs_cb(
-    public class FilePayload : Payload
-    {
-        private readonly string LogTag = "Tizen.Applications.AittPlugin";
-
-        internal FilePayload(PayloadSafeHandle handle)
-        {
-            _handle = handle;
-        }
-
-        public FilePayload(string path)
-        {
-            Interop.AittPluginPayload.AittPluginPayloadCreate(out _handle, Interop.AittPluginPayload.PayloadType.File);
-            Interop.AittPluginPayload.AittPluginPayloadSetFilePath(_handle, path);
-        }
-
-        public string ReceivedFileName
-        {
-            get
-            {
-                Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPayload.AittPluginPayloadGetReceivedFileName(_handle, out string path);
-                if (ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    // property should not throw exception.
-                    return "";
-                }
-                return path;
-            }
-        }
-
-        public UInt64 ReceivedBytes
-        {
-            get
-            {
-                Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPayload.AittPluginPayloadGetReceivedBytes(_handle, out UInt64 bytes);
-                if (ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    Log.Error(LogTag, "Failed to get received bytes.");
-                    return Byte.MinValue;
-                }
-                return bytes;
-            }
-        }
-
-        public UInt64 TotalBytes
-        {
-            get
-            {
-                Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPayload.AittPluginPayloadGetTotalBytes(_handle, out UInt64 bytes);
-                if (ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    Log.Error(LogTag, "Failed to get total bytes.");
-                    return Byte.MinValue;
-                }
-                return bytes;
-            }
-        }
-
-        public override PayloadType PayloadType
-        {
-            get
-            {
-                return PayloadType.FilePayload;
-            }
-        }
-
-        public void SaveAsFile(string path)
-        {
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPayload.AittPluginPayloadSaveAsFile(_handle, path);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to save as file.");
-            }
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_GROUP_BASE[] =
-R"__cs_cb(
-    public abstract class GroupBase : IDisposable
-    {
-        private readonly string LogTag = "Tizen.Applications.AittPlugin";
-        private readonly GroupSafeHandle _handle;
-
-        private Interop.AittPluginGroup.AittPluginGroupPayloadReceivedCb _payloadReceivedCb;
-        private Interop.AittPluginGroup.AittPluginGroupLeftCb _leftCb;
-        private Interop.AittPluginGroup.AittPluginGroupJoinedCb _joinedCb;
-
-        public string Topic { get; }
-
-        public GroupBase(string topicName, string brokerIp, int brokerPort, string userName, string password, string myIp, int protocol)
-        {
-            Topic = topicName;
-
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginGroup.AittPluginGroupCreate(out _handle, topicName, brokerIp, brokerPort, userName, password, myIp, protocol);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to create group.");
-            }
-
-            _payloadReceivedCb = new Interop.AittPluginGroup.AittPluginGroupPayloadReceivedCb(
-                (IntPtr group, IntPtr peerInfo, IntPtr payload, IntPtr userData) =>
-                {
-                    Payload receivedPayload;
-                    Interop.AittPluginPayload.AittPluginPayloadGetType(payload, out Interop.AittPluginPayload.PayloadType type);
-                    switch (type)
-                    {
-                        case Interop.AittPluginPayload.PayloadType.Data:
-                            receivedPayload = new DataPayload(new PayloadSafeHandle(payload, false));
-                            break;
-                        case Interop.AittPluginPayload.PayloadType.File:
-                            receivedPayload = new FilePayload(new PayloadSafeHandle(payload, false));
-                            break;
-                        default:
-                            Log.Error(LogTag, "Invalid payload type received.");
-                            return;
-                    }
-                    Interop.AittPlugin.ErrorCode clone_ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
-                    if (clone_ret != Interop.AittPlugin.ErrorCode.None)
-                    {
-                        Log.Error(LogTag, "Failed to clone peer info.");
-                        return;
-                    }
-                    OnPayloadReceived(receivedPayload, new PeerInfo(clone));
-                });
-            ret = Interop.AittPluginGroup.AittPluginGroupAddPayloadReceivedCb(_handle, _payloadReceivedCb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                _handle.Dispose();
-                throw AittPluginErrorFactory.GetException(ret, "Failed to add payload received callback.");
-            }
-
-            _joinedCb = new Interop.AittPluginGroup.AittPluginGroupJoinedCb(
-                (string name, IntPtr peerInfo, IntPtr userData) =>
-                {
-                    Interop.AittPlugin.ErrorCode clone_ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
-                    if (clone_ret != Interop.AittPlugin.ErrorCode.None)
-                    {
-                        return;
-                    }
-                    OnJoined(new PeerInfo(clone));
-                });
-            ret = Interop.AittPluginGroup.AittPluginGroupAddJoinedCb(_handle, _joinedCb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                _handle.Dispose();
-                throw AittPluginErrorFactory.GetException(ret, "Failed to add joined callback.");
-            }
-
-            _leftCb = new Interop.AittPluginGroup.AittPluginGroupLeftCb(
-                (string name, IntPtr peerInfo, IntPtr userData) =>
-                {
-                    Interop.AittPlugin.ErrorCode clone_ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
-                    if (clone_ret != Interop.AittPlugin.ErrorCode.None)
-                    {
-                        return;
-                    }
-                    OnLeft(new PeerInfo(clone));
-                });
-            ret = Interop.AittPluginGroup.AittPluginGroupAddLeftCb(_handle, _leftCb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                _handle.Dispose();
-                throw AittPluginErrorFactory.GetException(ret, "Failed to add joined callback.");
-            }
-        }
-
-        public void Subscribe()
-        {
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginGroup.AittPluginGroupSubscribe(_handle);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to subscribe.");
-            }
-        }
-
-        public void Unsubscribe()
-        {
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginGroup.AittPluginGroupUnsubscribe(_handle);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                Log.Error(LogTag, string.Format("Failed to unsubscribe: {0}", ret));
-            }
-        }
-
-        public void Publish(Payload payload)
-        {
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginGroup.AittPluginGroupPublish(_handle, payload?._handle);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to publish payload.");
-            }
-        }
-
-        protected abstract void OnPayloadReceived(Payload payload, PeerInfo peer);
-        protected abstract void OnJoined(PeerInfo peerInfo);
-        protected abstract void OnLeft(PeerInfo peerInfo);
-
-        private bool disposedValue = false;
-
-        protected virtual void Dispose(bool disposing)
-        {
-            if (!disposedValue)
-            {
-                if (disposing)
-                {
-                    _handle.Dispose();
-                }
-                disposedValue = true;
-            }
-        }
-
-        public void Dispose()
-        {
-            Dispose(true);
-            GC.SuppressFinalize(this);
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_GROUP_SAFE_HANDLE[] =
-R"__cs_cb(
-    internal sealed class GroupSafeHandle : SafeHandle
-    {
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public GroupSafeHandle() : base(IntPtr.Zero, true)
-        {
-        }
-
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public override bool IsInvalid
-        {
-            get { return this.DangerousGetHandle() == IntPtr.Zero; }
-        }
-
-        protected override bool ReleaseHandle()
-        {
-            Interop.AittPluginGroup.AittPluginGroupDestroy(this.handle);
-            SetHandle(IntPtr.Zero);
-            return true;
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_PAYLOAD[] =
-R"__cs_cb(
-    public abstract class Payload
-    {
-        private readonly string LogTag = "Tizen.Applications.AittPlugin";
-        internal PayloadSafeHandle _handle;
-
-        public abstract PayloadType PayloadType { get; }
-
-        public string Id
-        {
-            get
-            {
-                Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPayload.AittPluginPayloadGetPayloadID(_handle, out string id);
-                if (ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    Log.Error(LogTag, "Failed to get id of payload.");
-                    return "";
-                }
-                return id;
-            }
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_PAYLOAD_ASYNC_RESULT[] =
-R"__cs_cb(
-    public class PayloadAsyncResult : IDisposable
-    {
-        private PayloadAsyncResult(PayloadAsyncResultCode result, PeerInfo peer, string payloadId)
-        {
-            Result = result;
-            PeerInfo = peer;
-            PayloadId = payloadId;
-        }
-
-        internal static PayloadAsyncResult CreateFromHandle(IntPtr handle)
-        {
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPayloadAsyncResult.AittPluginPayloadAsyncResultGetResult(handle, out int code);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Fail to get result code from the AsyncResult");
-            }
-
-            ret = Interop.AittPluginPayloadAsyncResult.AittPluginPayloadAsyncResultGetPayloadID(handle, out string payloadId);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Fail to get payload id from the AsyncResult");
-            }
-
-            ret = Interop.AittPluginPayloadAsyncResult.AittPluginPayloadAsyncResultGetPeerInfo(handle, out IntPtr peer);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Fail to get peerinfo from the AsyncResult");
-            }
-            ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoClone(peer, out PeerInfoSafeHandle clone);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to clone peer info.");
-            }
-
-            return new PayloadAsyncResult((PayloadAsyncResultCode)code, new PeerInfo(clone), payloadId);
-        }
-
-        public PayloadAsyncResultCode Result { get; }
-
-        public PeerInfo PeerInfo { get; }
-
-        public string PayloadId { get; }
-
-        private bool disposedValue = false;
-
-        protected virtual void Dispose(bool disposing)
-        {
-            if (!disposedValue)
-            {
-                if (disposing)
-                {
-                    PeerInfo?.Dispose();
-                }
-                disposedValue = true;
-            }
-        }
-
-        public void Dispose()
-        {
-            Dispose(true);
-            GC.SuppressFinalize(this);
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_PAYLOAD_ASYNC_RESULT_CODE[] =
-R"__cs_cb(
-    public enum PayloadAsyncResultCode
-    {
-        Error = -1,
-        Pending = 0,
-        Success,
-        Fail,
-    }
-)__cs_cb";
-
-constexpr char CB_PAYLOAD_SAFE_HANDLE[] =
-R"__cs_cb(
-    internal sealed class PayloadSafeHandle : SafeHandle
-    {
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public PayloadSafeHandle() : base(IntPtr.Zero, true)
-        {
-        }
-
-        internal PayloadSafeHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
-        {
-            SetHandle(existingHandle);
-        }
-
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public override bool IsInvalid
-        {
-            get { return this.DangerousGetHandle() == IntPtr.Zero; }
-        }
-
-        protected override bool ReleaseHandle()
-        {
-            Interop.AittPluginPayload.AittPluginPayloadDestroy(this.handle);
-            SetHandle(IntPtr.Zero);
-            return true;
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_PAYLOAD_TRANSFER_STATUS[] =
-R"__cs_cb(
-    public enum PayloadTransferStatus
-    {
-        Success,
-        Failure,
-        InProgress,
-    }
-)__cs_cb";
-
-constexpr char CB_PAYLOAD_TYPE[] =
-R"__cs_cb(
-    public enum PayloadType
-    {
-        DataPayload,
-        FilePayload,
-    }
-)__cs_cb";
-
-constexpr char CB_PEER_INFO[] =
-R"__cs_cb(
-    public class PeerInfo : IDisposable
-    {
-        private readonly string LogTag = "Tizen.Applications.AittPlugin";
-        internal PeerInfoSafeHandle _handle;
-
-        internal PeerInfo(PeerInfoSafeHandle handle)
-        {
-            _handle = handle;
-        }
-
-        public string DeviceId
-        {
-            get
-            {
-                Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoGetDeviceId(_handle, out string deviceId);
-                if (ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    Log.Error(LogTag, "Failed to get device id.");
-                    return "";
-                }
-                return deviceId;
-            }
-        }
-
-        public string DeviceName
-        {
-            get
-            {
-                Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoGetDeviceName(_handle, out string deviceName);
-                if (ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    Log.Error(LogTag, "Failed to get device name.");
-                    return "";
-                }
-                return deviceName;
-            }
-        }
-
-        public string DevicePlatform
-        {
-            get
-            {
-                Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoGetDevicePlatform(_handle, out string devicePlatform);
-                if (ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    Log.Error(LogTag, "Failed to get device platform.");
-                    return "";
-                }
-                return devicePlatform;
-            }
-        }
-
-        public string DevicePlatformVersion
-        {
-            get
-            {
-                Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoGetDevicePlatformVersion(_handle, out string devicePlatformVersion);
-                if (ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    Log.Error(LogTag, "Failed to get device platform version.");
-                    return "";
-                }
-                return devicePlatformVersion;
-            }
-        }
-
-        public string DeviceType
-        {
-            get
-            {
-                Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoGetDeviceType(_handle, out string deviceType);
-                if (ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    Log.Error(LogTag, "Failed to get device platform type.");
-                    return "";
-                }
-                return deviceType;
-            }
-        }
-
-        public string AppId
-        {
-            get
-            {
-                Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoGetAppId(_handle, out string AppId);
-                if (ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    Log.Error(LogTag, "Failed to get application id.");
-                    return "";
-                }
-                return AppId;
-            }
-        }
-
-        public string AppVersion
-        {
-            get
-            {
-                Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoGetAppVersion(_handle, out string AppVersion);
-                if (ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    Log.Error(LogTag, "Failed to get application version.");
-                    return "";
-                }
-                return AppVersion;
-            }
-        }
-
-        public string UUID
-        {
-            get
-            {
-                Interop.AittPlugin.ErrorCode ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoGetUuid(_handle, out string uuid);
-                if (ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    Log.Error(LogTag, "Failed to get UUID.");
-                    return "";
-                }
-                return uuid;
-            }
-        }
-
-        private bool disposedValue = false;
-
-        protected virtual void Dispose(bool disposing)
-        {
-            if (!disposedValue)
-            {
-                if (disposing)
-                {
-                    _handle.Dispose();
-                }
-                disposedValue = true;
-            }
-        }
-
-        public void Dispose()
-        {
-            Dispose(true);
-            GC.SuppressFinalize(this);
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_PEER_INFO_SAFE_HANDLE[] =
-R"__cs_cb(
-    internal sealed class PeerInfoSafeHandle : SafeHandle
-    {
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public PeerInfoSafeHandle() : base(IntPtr.Zero, true)
-        {
-        }
-
-        internal PeerInfoSafeHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
-        {
-            SetHandle(existingHandle);
-        }
-
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public override bool IsInvalid
-        {
-            get { return this.DangerousGetHandle() == IntPtr.Zero; }
-        }
-
-        protected override bool ReleaseHandle()
-        {
-            Interop.AittPluginPeerInfo.AittPluginPeerInfoDestroy(this.handle);
-            SetHandle(IntPtr.Zero);
-            return true;
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_SERVER_BASE[] =
-R"__cs_cb(
-    public abstract class ServerBase : IDisposable
-    {
-        private readonly string LogTag = "Tizen.Applications.AittPlugin";
-
-        private string _displayName;
-        private readonly ServerSafeHandle _handle;
-        private Interop.AittPluginServer.AittPluginServerConnectionRequestCb _connectionRequestCb;
-        private Interop.AittPluginServer.AittPluginServerConnectionResultCb _connectionResultCb;
-        private Interop.AittPluginServer.AittPluginServerDataReceivedCb _dataReceivedCb;
-        private Interop.AittPluginServer.AittPluginServerPayloadReceivedCb _payloadRecievedCb;
-        private Interop.AittPluginServer.AittPluginServerDisconnectedCb _disconnectedCb;
-        private Interop.AittPluginServer.AittPluginServerPayloadAsyncResultCb _payloadAsyncResultCb;
-        private Dictionary<Tuple<string, string>, TaskCompletionSource<PayloadAsyncResult>> _tcsDictionary = new Dictionary<Tuple<string, string>, TaskCompletionSource<PayloadAsyncResult>>();
-
-        public string ServiceName { get; }
-
-        public string DisplayName
-        {
-            get
-            {
-                return _displayName;
-            }
-
-            set
-            {
-                Interop.AittPlugin.ErrorCode ret = Interop.AittPluginServer.AittPluginServerSetDisplayName(_handle, value);
-                if (ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    Log.Error(LogTag, string.Format("Failed to set display name: {0}", ret));
-                }
-                else
-                {
-                    _displayName = value;
-                }
-            }
-        }
-
-        public ServerBase(string serviceName, string displayName, string brokerIp, int brokerPort, string userName, string password, string myIp, int port)
-        {
-            ServiceName = serviceName;
-            _displayName = displayName;
-
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginServer.AittPluginServerCreate(out _handle, serviceName, displayName, brokerIp, brokerPort, userName, password, myIp, port);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to create server handle.");
-            }
-
-            _connectionResultCb = new Interop.AittPluginServer.AittPluginServerConnectionResultCb(
-                (string service, IntPtr peerInfo, IntPtr result, IntPtr userData) =>
-                {
-                    Interop.AittPlugin.ErrorCode clone_ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
-                    if (clone_ret != Interop.AittPlugin.ErrorCode.None)
-                    {
-                        Log.Error(LogTag, "Failed to clone peer info.");
-                        return;
-                    }
-                    OnConnectionResult(new PeerInfo(clone), new ConnectionResult(result));
-                });
-            ret = Interop.AittPluginServer.AittPluginServerAddConnectionResultCb(_handle, _connectionResultCb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                _handle.Dispose();
-                throw AittPluginErrorFactory.GetException(ret, "Failed to add connection status changed callback.");
-            }
-
-            _dataReceivedCb = new Interop.AittPluginServer.AittPluginServerDataReceivedCb(
-                (string service, IntPtr peerInfo, IntPtr data, int dataSize, out IntPtr returnData, out int returnDataSize, IntPtr userData) =>
-                {
-                    Interop.AittPlugin.ErrorCode clone_ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
-                    if (clone_ret != Interop.AittPlugin.ErrorCode.None)
-                    {
-                        Log.Error(LogTag, "Failed to clone peer info.");
-                        returnData = IntPtr.Zero;
-                        returnDataSize = -1;
-                    }
-                    byte[] receivedData = new byte[dataSize];
-                    Marshal.Copy(data, receivedData, 0, dataSize);
-                    byte[] returnDataRaw = OnDataReceived(receivedData, new PeerInfo(clone));
-                    returnDataSize = returnDataRaw.Length;
-                    returnData = Interop.AittPlugin.Malloc(returnDataSize);
-                    Marshal.Copy(returnDataRaw, 0, returnData, returnDataSize);
-                });
-            ret = Interop.AittPluginServer.AittPluginServerSetDataReceivedCb(_handle, _dataReceivedCb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                _handle.Dispose();
-                throw AittPluginErrorFactory.GetException(ret, "Failed to set data received callback.");
-            }
-
-            _payloadRecievedCb = new Interop.AittPluginServer.AittPluginServerPayloadReceivedCb(
-                (string service, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData) =>
-                {
-                    Payload receivedPayload;
-                    Interop.AittPluginPayload.AittPluginPayloadGetType(payload, out Interop.AittPluginPayload.PayloadType type);
-                    switch (type)
-                    {
-                        case Interop.AittPluginPayload.PayloadType.Data:
-                            receivedPayload = new DataPayload(new PayloadSafeHandle(payload, false));
-                            break;
-                        case Interop.AittPluginPayload.PayloadType.File:
-                            receivedPayload = new FilePayload(new PayloadSafeHandle(payload, false));
-                            break;
-                        default:
-                            Log.Error(LogTag, "Invalid payload type received.");
-                            return;
-                    }
-                    Interop.AittPlugin.ErrorCode clone_ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
-                    if (clone_ret != Interop.AittPlugin.ErrorCode.None)
-                    {
-                        Log.Error(LogTag, "Failed to clone peer info.");
-                        return;
-                    }
-                    OnPayloadReceived(receivedPayload, new PeerInfo(clone), (PayloadTransferStatus)status);
-                });
-            ret = Interop.AittPluginServer.AittPluginServerAddPayloadReceivedCb(_handle, _payloadRecievedCb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                _handle.Dispose();
-                throw AittPluginErrorFactory.GetException(ret, "Failed to add payload received callback.");
-            }
-
-            _disconnectedCb = new Interop.AittPluginServer.AittPluginServerDisconnectedCb(
-                (string service, IntPtr peerInfo, IntPtr userData) =>
-                {
-                    Interop.AittPlugin.ErrorCode clone_ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
-                    if (clone_ret != Interop.AittPlugin.ErrorCode.None)
-                    {
-                        Log.Error(LogTag, string.Format("Failed to clone peer info."));
-                        return;
-                    }
-                    OnDisconnected(new PeerInfo(clone));
-                });
-            ret = Interop.AittPluginServer.AittPluginServerAddDisconnectedCb(_handle, _disconnectedCb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                _handle.Dispose();
-                throw AittPluginErrorFactory.GetException(ret, "Failed to add disconnected callback.");
-            }
-        }
-
-        public void Listen()
-        {
-            if (_connectionRequestCb == null)
-            {
-                Interop.AittPluginServer.AittPluginServerConnectionRequestCb cb = new Interop.AittPluginServer.AittPluginServerConnectionRequestCb(
-                    (serviceName, peerInfo, userData) =>
-                    {
-                        Interop.AittPlugin.ErrorCode clone_ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
-                        if (clone_ret != Interop.AittPlugin.ErrorCode.None)
-                        {
-                            Log.Error(LogTag, "Failed to clone peer info");
-                            return;
-                        }
-                        OnConnectionRequest(new PeerInfo(clone));
-                    });
-                _connectionRequestCb = cb;
-            }
-
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginServer.AittPluginServerListen(_handle, _connectionRequestCb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to listen server.");
-            }
-        }
-
-        public void Stop()
-        {
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginServer.AittPluginServerStop(_handle);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to stop server.");
-            }
-        }
-
-        public void Disconnect(PeerInfo peerInfo)
-        {
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginServer.AittPluginServerDisconnect(_handle, peerInfo?._handle);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to stop server.");
-            }
-        }
-
-        public Task<PayloadAsyncResult> SendPayloadAsync(Payload payload, PeerInfo peerInfo)
-        {
-            if (payload == null || payload.Id.Length == 0 || peerInfo == null || peerInfo.UUID.Length == 0)
-            {
-                throw new ArgumentException("Payload or peerinfo is invalid.");
-            }
-
-            TaskCompletionSource<PayloadAsyncResult> tcs = new TaskCompletionSource<PayloadAsyncResult>();
-            _tcsDictionary[Tuple.Create(payload.Id, peerInfo.UUID)] = tcs;
-
-            if (_payloadAsyncResultCb == null)
-            {
-                Interop.AittPluginServer.AittPluginServerPayloadAsyncResultCb cb = new Interop.AittPluginServer.AittPluginServerPayloadAsyncResultCb(
-                    (IntPtr result, IntPtr userData) =>
-                    {
-                        PayloadAsyncResult resultPayload = null;
-                        try
-                        {
-                            resultPayload = PayloadAsyncResult.CreateFromHandle(result);
-                        }
-                        catch (Exception e)
-                        {
-                            Log.Error(LogTag, string.Format("Failed to create PayloadAsyncResult from result handle: {0}.", e.Message));
-                            return;
-                        }
-                        TaskCompletionSource<PayloadAsyncResult> tcsToReturn = _tcsDictionary[Tuple.Create(resultPayload.PayloadId, resultPayload.PeerInfo.UUID)];
-                        tcsToReturn.SetResult(resultPayload);
-                        _tcsDictionary.Remove(Tuple.Create(resultPayload.PayloadId, resultPayload.PeerInfo.UUID));
-                    });
-                _payloadAsyncResultCb = cb;
-            }
-
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginServer.AittPluginServerSendPayloadAsync(_handle, peerInfo?._handle, payload?._handle, _payloadAsyncResultCb, IntPtr.Zero);
-            if (ret != Interop.AittPlugin.ErrorCode.None)
-            {
-                throw AittPluginErrorFactory.GetException(ret, "Failed to send payload.");
-            }
-
-            return tcs.Task;
-        }
-
-        public void SendPayloadAsync(Payload payload)
-        {
-            var peerList = GetConnectedPeerList();
-            foreach (var peer in peerList)
-            {
-                SendPayloadAsync(payload, peer);
-            }
-        }
-
-        public void Accept(PeerInfo peerInfo)
-        {
-            Interop.AittPluginServer.AittPluginServerAccept(_handle, peerInfo?._handle);
-        }
-
-        public void Reject(PeerInfo peerInfo, string reason)
-        {
-            Interop.AittPluginServer.AittPluginServerReject(_handle, peerInfo?._handle, reason);
-        }
-
-        public IEnumerable<PeerInfo> GetConnectedPeerList()
-        {
-            List<PeerInfo> peerInfoList = new List<PeerInfo>();
-            Interop.AittPlugin.ErrorCode ret = Interop.AittPluginServer.AittPluginServerForeachConnectedPeerInfo(_handle, (peer, userData) =>
-            {
-                Interop.AittPlugin.ErrorCode clone_ret = Interop.AittPluginPeerInfo.AittPluginPeerInfoClone(peer, out PeerInfoSafeHandle clone);
-                if (clone_ret != Interop.AittPlugin.ErrorCode.None)
-                {
-                    Log.Error(LogTag, "Failed to clone peer info.");
-                    return false;
-                }
-                peerInfoList.Add(new PeerInfo(clone));
-                return true;
-            }, IntPtr.Zero);
-            return peerInfoList;
-        }
-
-        protected abstract void OnConnectionResult(PeerInfo peerInfo, ConnectionResult result);
-        protected abstract byte[] OnDataReceived(byte[] data, PeerInfo peerInfo);
-        protected abstract void OnPayloadReceived(Payload data, PeerInfo peerInfo, PayloadTransferStatus status);
-        protected abstract void OnConnectionRequest(PeerInfo peerInfo);
-        protected abstract void OnDisconnected(PeerInfo peerInfo);
-
-        private bool disposedValue = false;
-
-        protected virtual void Dispose(bool disposing)
-        {
-            if (!disposedValue)
-            {
-                if (disposing)
-                {
-                    _handle.Dispose();
-                }
-                disposedValue = true;
-            }
-        }
-
-        public void Dispose()
-        {
-            Dispose(true);
-            GC.SuppressFinalize(this);
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_SERVER_SAFE_HANDLE[] =
-R"__cs_cb(
-    internal sealed class ServerSafeHandle : SafeHandle
-    {
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public ServerSafeHandle() : base(IntPtr.Zero, true)
-        {
-        }
-
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public override bool IsInvalid
-        {
-            get { return this.DangerousGetHandle() == IntPtr.Zero; }
-        }
-
-        protected override bool ReleaseHandle()
-        {
-            Interop.AittPluginServer.AittPluginServerDestroy(this.handle);
-            SetHandle(IntPtr.Zero);
-            return true;
-        }
-    }
-)__cs_cb";
-
-#endif  // IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_BASE_GEN_CB_H_
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_cs_interop_gen.cc b/idlc/gen_aitt_plugin/aitt_plugin_cs_interop_gen.cc
deleted file mode 100644 (file)
index 9385d9a..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "idlc/gen_aitt_plugin/aitt_plugin_cs_interop_gen.h"
-
-#include "idlc/gen_aitt_plugin/aitt_plugin_cs_interop_gen_cb.h"
-
-namespace tidl {
-
-AittPluginCsInteropGen::AittPluginCsInteropGen(std::shared_ptr<Document> doc,
-    std::shared_ptr<tidl::Transportable> trans) : CionPluginBase(doc, trans) {
-}
-
-void AittPluginCsInteropGen::OnInitGen(std::ofstream& stream) {
-  GenUsing(stream);
-  stream << "internal static partial class Interop\n";
-  stream << "{\n";
-  GenLibraries(stream);
-  GenErrorCode(stream);
-  GenMalloc(stream);
-  GenInterop(stream);
-  stream << "}\n";
-}
-
-void AittPluginCsInteropGen::OnFiniGen(std::ofstream& stream) {
-}
-
-void AittPluginCsInteropGen::GenUsing(std::ofstream& stream) {
-  stream << CB_INTEROP_USING;
-}
-
-void AittPluginCsInteropGen::GenLibraries(std::ofstream& stream) {
-  stream << CB_LIBRARIES;
-}
-
-void AittPluginCsInteropGen::GenErrorCode(std::ofstream& stream) {
-  stream << CB_ERROR_CODE;
-}
-
-void AittPluginCsInteropGen::GenMalloc(std::ofstream& stream) {
-  stream << CB_INTEROP_MALLOC;
-}
-
-void AittPluginCsInteropGen::GenInterop(std::ofstream& stream) {
-  stream << CB_INTEROP_PAYLOAD;
-  stream << CB_INTEROP_PAYLOAD_ASYNC_RESULT;
-  stream << CB_INTEROP_PEER_INFO;
-  stream << CB_INTEROP_CONNECTION_RESULT;
-  switch (GetType()) {
-    // client
-    case 1:
-      stream << CB_INTEROP_CLIENT;
-      break;
-    // server
-    case 2:
-      stream << CB_INTEROP_SERVER;
-      break;
-    // group
-    case 3:
-      stream << CB_INTEROP_GROUP;
-      break;
-    default:
-      break;
-  }
-}
-
-}  // namespace tidl
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_cs_interop_gen.h b/idlc/gen_aitt_plugin/aitt_plugin_cs_interop_gen.h
deleted file mode 100644 (file)
index 87ed016..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_INTEROP_GEN_H_
-#define IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_INTEROP_GEN_H_
-
-#include <memory>
-
-#include "idlc/gen_cion/cion_plugin_base.h"
-
-namespace tidl {
-
-class AittPluginCsInteropGen : public CionPluginBase {
- public:
-  explicit AittPluginCsInteropGen(std::shared_ptr<Document> doc,
-      std::shared_ptr<tidl::Transportable> trans);
-  virtual ~AittPluginCsInteropGen() = default;
-
-  void OnInitGen(std::ofstream& stream) override;
-  void OnFiniGen(std::ofstream& stream) override;
-
- private:
-  void GenUsing(std::ofstream& stream);
-  void GenLibraries(std::ofstream& stream);
-  void GenErrorCode(std::ofstream& stream);
-  void GenMalloc(std::ofstream& stream);
-  void GenInterop(std::ofstream& stream);
-};
-
-}  // namespace tidl
-
-#endif  // IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_INTEROP_GEN_H_
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_cs_interop_gen_cb.h b/idlc/gen_aitt_plugin/aitt_plugin_cs_interop_gen_cb.h
deleted file mode 100644 (file)
index fd2e35b..0000000
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_INTEROP_GEN_CB_H_
-#define IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_INTEROP_GEN_CB_H_
-
-constexpr char CB_INTEROP_USING[] =
-R"__cs_cb(
-using System;
-using System.Runtime.InteropServices;
-using Tizen.Applications.AittPlugin;
-
-using ErrorCode = Interop.AittPlugin.ErrorCode;
-
-)__cs_cb";
-
-constexpr char CB_LIBRARIES[] =
-R"__cs_cb(
-    internal static partial class Libraries
-    {
-        public const string AittPlugin = "libaitt_plugin.so.1";
-        public const string Libc = "libc.so.6";
-    }
-)__cs_cb";
-
-constexpr char CB_ERROR_CODE[] =
-R"__cs_cb(
-    internal static partial class AittPlugin
-    {
-        internal enum ErrorCode : int
-        {
-            None = Tizen.Internals.Errors.ErrorCode.None,
-            IoError = Tizen.Internals.Errors.ErrorCode.IoError,
-            OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
-            PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
-            InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
-            InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation,
-            AlreadyInProgress = Tizen.Internals.Errors.ErrorCode.AlreadyInProgress,
-            NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported,
-            TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut,
-            OperationFailed = -0x030C0000 | 0x01,
-        }
-    }
-)__cs_cb";
-
-constexpr char CB_INTEROP_MALLOC[] =
-R"__cs_cb(
-    internal static partial class AittPlugin
-    {
-        [DllImport(Libraries.Libc, EntryPoint = "malloc")]
-        internal static extern IntPtr Malloc(int size);
-    }
-)__cs_cb";
-
-constexpr char CB_INTEROP_CLIENT[] =
-R"__cs_cb(
-    internal static partial class AittPluginClient
-    {
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginClientServerDiscoveredCb(string serviceName, IntPtr peerInfo, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginClientConnectionResultCb(string serviceName, IntPtr peerInfo, IntPtr result, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginClientPayloadReceivedCb(string serviceName, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginClientDisconnectedCb(string serviceName, IntPtr peerInfo, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginClientPayloadAsyncResultCb(IntPtr result, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_create")]
-        internal static extern ErrorCode AittPluginClientCreate(out ClientSafeHandle client, string serviceName, string brokerIp, int brokerPort, string userName, string password, string myIp, int protocol);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_destroy")]
-        internal static extern ErrorCode AittPluginClientDestroy(IntPtr client);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_try_discovery")]
-        internal static extern ErrorCode AittPluginClientTryDiscovery(ClientSafeHandle client, AittPluginClientServerDiscoveredCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_stop_discovery")]
-        internal static extern ErrorCode AittPluginClientStopDiscovery(ClientSafeHandle client);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_connect")]
-        internal static extern ErrorCode AittPluginClientConnect(ClientSafeHandle client, PeerInfoSafeHandle peerInfo);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_disconnect")]
-        internal static extern ErrorCode AittPluginClientDisconnect(ClientSafeHandle client);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_send_data")]
-        internal static extern ErrorCode AittPluginClientSendData(ClientSafeHandle client, byte[] data, int dataSize, int timeout, out IntPtr returnData, out int returnDataSize);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_send_payload_async")]
-        internal static extern ErrorCode AittPluginClientSendPayloadAsync(ClientSafeHandle client, PayloadSafeHandle payload, AittPluginClientPayloadAsyncResultCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_add_connection_result_cb")]
-        internal static extern ErrorCode AittPluginClientAddConnectionResultCb(ClientSafeHandle client, AittPluginClientConnectionResultCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_remove_connection_result_cb")]
-        internal static extern ErrorCode AittPluginClientRemoveConnectionResultCb(ClientSafeHandle client, AittPluginClientConnectionResultCb cb);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_add_payload_received_cb")]
-        internal static extern ErrorCode AittPluginClientAddPayloadReceivedCb(ClientSafeHandle client, AittPluginClientPayloadReceivedCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_remove_payload_received_cb")]
-        internal static extern ErrorCode AittPluginClientRemovePayloadReceivedCb(ClientSafeHandle client, AittPluginClientPayloadReceivedCb cb);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_add_disconnected_cb")]
-        internal static extern ErrorCode AittPluginClientAddDisconnectedCb(ClientSafeHandle client, AittPluginClientDisconnectedCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_client_remove_disconnected_cb")]
-        internal static extern ErrorCode AittPluginClientRemoveDisconnectedCb(ClientSafeHandle client, AittPluginClientDisconnectedCb cb);
-    }
-)__cs_cb";
-
-constexpr char CB_INTEROP_CONNECTION_RESULT[] =
-R"__cs_cb(
-    internal static partial class AittPluginConnectionResult
-    {
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_connection_result_get_status")]
-        internal static extern ErrorCode AittPluginConnectionResultGetStatus(IntPtr result, out ConnectionStatus status);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_connection_result_get_reason")]
-        internal static extern ErrorCode AittPluginConnectionResultGetReason(IntPtr result, out string reason);
-    }
-)__cs_cb";
-
-constexpr char CB_INTEROP_GROUP[] =
-R"__cs_cb(
-    internal static partial class AittPluginGroup
-    {
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginGroupPayloadReceivedCb(IntPtr group, IntPtr peerInfo, IntPtr payload, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginGroupJoinedCb(string topicName, IntPtr peerInfo, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginGroupLeftCb(string topicName, IntPtr peerInfo, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_group_create")]
-        internal static extern ErrorCode AittPluginGroupCreate(out GroupSafeHandle group, string topicName, string brokerIp, int brokerPort, string userName, string password, string myIp, int protocol);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_group_destroy")]
-        internal static extern ErrorCode AittPluginGroupDestroy(IntPtr group);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_group_subscribe")]
-        internal static extern ErrorCode AittPluginGroupSubscribe(GroupSafeHandle group);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_group_unsubscribe")]
-        internal static extern ErrorCode AittPluginGroupUnsubscribe(GroupSafeHandle group);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_group_publish")]
-        internal static extern ErrorCode AittPluginGroupPublish(GroupSafeHandle group, PayloadSafeHandle data);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_group_add_payload_received_cb")]
-        internal static extern ErrorCode AittPluginGroupAddPayloadReceivedCb(GroupSafeHandle group, AittPluginGroupPayloadReceivedCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_group_remove_payload_received_cb")]
-        internal static extern ErrorCode AittPluginGroupRemovePayloadReceivedCb(GroupSafeHandle group, AittPluginGroupPayloadReceivedCb cb);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_group_add_joined_cb")]
-        internal static extern ErrorCode AittPluginGroupAddJoinedCb(GroupSafeHandle group, AittPluginGroupJoinedCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_group_remove_joined_cb")]
-        internal static extern ErrorCode AittPluginGroupRemoveJoinedCb(GroupSafeHandle group, AittPluginGroupJoinedCb cb);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_group_add_left_cb")]
-        internal static extern ErrorCode AittPluginGroupAddLeftCb(GroupSafeHandle group, AittPluginGroupLeftCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_group_remove_left_cb")]
-        internal static extern ErrorCode AittPluginGroupRemoveLeftCb(GroupSafeHandle group, AittPluginGroupLeftCb cb);
-    }
-)__cs_cb";
-
-constexpr char CB_INTEROP_PAYLOAD[] =
-R"__cs_cb(
-    internal static partial class AittPluginPayload
-    {
-        internal enum PayloadType : int
-        {
-            Data,
-            File,
-        }
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_create")]
-        internal static extern ErrorCode AittPluginPayloadCreate(out PayloadSafeHandle payload, PayloadType type);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_destroy")]
-        internal static extern ErrorCode AittPluginPayloadDestroy(IntPtr payload);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_get_type")]
-        internal static extern ErrorCode AittPluginPayloadGetType(IntPtr payload, out PayloadType type);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_get_data")]
-        internal static extern ErrorCode AittPluginPayloadGetData(PayloadSafeHandle payload, out IntPtr data, out int dataSize);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_set_data")]
-        internal static extern ErrorCode AittPluginPayloadSetData(PayloadSafeHandle payload, byte[] data, int dataSize);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_save_as_file")]
-        internal static extern ErrorCode AittPluginPayloadSaveAsFile(PayloadSafeHandle payload, string path);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_get_received_file_name")]
-        internal static extern ErrorCode AittPluginPayloadGetReceivedFileName(PayloadSafeHandle payload, out string path);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_get_received_bytes")]
-        internal static extern ErrorCode AittPluginPayloadGetReceivedBytes(PayloadSafeHandle payload, out UInt64 bytes);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_get_total_bytes")]
-        internal static extern ErrorCode AittPluginPayloadGetTotalBytes(PayloadSafeHandle payload, out UInt64 bytes);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_set_file_path")]
-        internal static extern ErrorCode AittPluginPayloadSetFilePath(PayloadSafeHandle payload, string path);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_get_payload_id")]
-        internal static extern ErrorCode AittPluginPayloadGetPayloadID(PayloadSafeHandle payload, out string id);
-    }
-)__cs_cb";
-
-constexpr char CB_INTEROP_PAYLOAD_ASYNC_RESULT[] =
-R"__cs_cb(
-    internal static partial class AittPluginPayloadAsyncResult
-    {
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_async_result_get_result")]
-        internal static extern ErrorCode AittPluginPayloadAsyncResultGetResult(IntPtr result, out int code);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_async_result_get_peer_info")]
-        internal static extern ErrorCode AittPluginPayloadAsyncResultGetPeerInfo(IntPtr result, out IntPtr peerInfo);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_payload_async_result_get_payload_id")]
-        internal static extern ErrorCode AittPluginPayloadAsyncResultGetPayloadID(IntPtr result, out string payloadID);
-    }
-)__cs_cb";
-
-constexpr char CB_INTEROP_PEER_INFO[] =
-R"__cs_cb(
-    internal static partial class AittPluginPeerInfo
-    {
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_peer_info_clone")]
-        internal static extern ErrorCode AittPluginPeerInfoClone(IntPtr peerInfo, out PeerInfoSafeHandle peerInfoClone);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_peer_info_destroy")]
-        internal static extern ErrorCode AittPluginPeerInfoDestroy(IntPtr peerInfo);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_peer_info_get_device_id")]
-        internal static extern ErrorCode AittPluginPeerInfoGetDeviceId(PeerInfoSafeHandle peerInfo, out string deviceId);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_peer_info_get_device_name")]
-        internal static extern ErrorCode AittPluginPeerInfoGetDeviceName(PeerInfoSafeHandle peerInfo, out string deviceName);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_peer_info_get_device_platform")]
-        internal static extern ErrorCode AittPluginPeerInfoGetDevicePlatform(PeerInfoSafeHandle peerInfo, out string devicePlatform);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_peer_info_get_device_platform_version")]
-        internal static extern ErrorCode AittPluginPeerInfoGetDevicePlatformVersion(PeerInfoSafeHandle peerInfo, out string devicePlatformVersion);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_peer_info_get_device_type")]
-        internal static extern ErrorCode AittPluginPeerInfoGetDeviceType(PeerInfoSafeHandle peerInfo, out string deviceType);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_peer_info_get_app_id")]
-        internal static extern ErrorCode AittPluginPeerInfoGetAppId(PeerInfoSafeHandle peerInfo, out string appId);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_peer_info_get_app_version")]
-        internal static extern ErrorCode AittPluginPeerInfoGetAppVersion(PeerInfoSafeHandle peerInfo, out string appVersion);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_peer_info_get_uuid")]
-        internal static extern ErrorCode AittPluginPeerInfoGetUuid(PeerInfoSafeHandle peerInfo, out string uuid);
-    }
-)__cs_cb";
-
-constexpr char CB_INTEROP_SERVER[] =
-R"__cs_cb(
-    internal static partial class AittPluginServer
-    {
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate bool AittPluginServerPeerInfoIterator(IntPtr peerInfo, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginServerPayloadAsyncResultCb(IntPtr result, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginServerConnectionResultCb(string serviceName, IntPtr peerInfo, IntPtr result, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginServerDataReceivedCb(string serviceName, IntPtr peerInfo, IntPtr data, int dataSize, out IntPtr returnData, out int returnDataSize, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginServerPayloadReceivedCb(string serviceName, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginServerConnectionRequestCb(string serviceName, IntPtr peerInfo, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginServerErrorReportedCb(string serviceName, IntPtr peerInfo, int error, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void AittPluginServerDisconnectedCb(string serviceName, IntPtr peerInfo, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_create")]
-        internal static extern ErrorCode AittPluginServerCreate(out ServerSafeHandle server, string serviceName, string displayName, string brokerIp, int brokerPort, string userName, string password, string myIp, int protocol);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_destroy")]
-        internal static extern ErrorCode AittPluginServerDestroy(IntPtr server);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_listen")]
-        internal static extern ErrorCode AittPluginServerListen(ServerSafeHandle server, AittPluginServerConnectionRequestCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_stop")]
-        internal static extern ErrorCode AittPluginServerStop(ServerSafeHandle server);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_accept")]
-        internal static extern ErrorCode AittPluginServerAccept(ServerSafeHandle server, PeerInfoSafeHandle peerInfo);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_reject")]
-        internal static extern ErrorCode AittPluginServerReject(ServerSafeHandle server, PeerInfoSafeHandle peerInfo, string reason);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_disconnect")]
-        internal static extern ErrorCode AittPluginServerDisconnect(ServerSafeHandle server, PeerInfoSafeHandle peerInfo);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_send_payload_async")]
-        internal static extern ErrorCode AittPluginServerSendPayloadAsync(ServerSafeHandle server, PeerInfoSafeHandle peerInfo, PayloadSafeHandle payload, AittPluginServerPayloadAsyncResultCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_foreach_connected_peer_info")]
-        internal static extern ErrorCode AittPluginServerForeachConnectedPeerInfo(ServerSafeHandle server, AittPluginServerPeerInfoIterator cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_add_connection_result_cb")]
-        internal static extern ErrorCode AittPluginServerAddConnectionResultCb(ServerSafeHandle server, AittPluginServerConnectionResultCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_remove_connection_result_cb")]
-        internal static extern ErrorCode AittPluginServerRemoveConnectionResultCb(ServerSafeHandle server, AittPluginServerConnectionResultCb cb);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_add_payload_received_cb")]
-        internal static extern ErrorCode AittPluginServerAddPayloadReceivedCb(ServerSafeHandle server, AittPluginServerPayloadReceivedCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_remove_payload_received_cb")]
-        internal static extern ErrorCode AittPluginServerRemovePayloadReceivedCb(ServerSafeHandle server, AittPluginServerPayloadReceivedCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_set_data_received_cb")]
-        internal static extern ErrorCode AittPluginServerSetDataReceivedCb(ServerSafeHandle server, AittPluginServerDataReceivedCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_unset_data_received_cb")]
-        internal static extern ErrorCode AittPluginServerUnsetDataReceivedCb(ServerSafeHandle server, AittPluginServerDataReceivedCb cb);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_add_disconnected_cb")]
-        internal static extern ErrorCode AittPluginServerAddDisconnectedCb(ServerSafeHandle server, AittPluginServerDisconnectedCb cb, IntPtr userData);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_remove_disconnected_cb")]
-        internal static extern ErrorCode AittPluginServerRemoveDisconnectedCb(ServerSafeHandle server, AittPluginServerDisconnectedCb cb);
-
-        [DllImport(Libraries.AittPlugin, EntryPoint = "aitt_plugin_server_set_display_name")]
-        internal static extern ErrorCode AittPluginServerSetDisplayName(ServerSafeHandle server, string displayName);
-    }
-)__cs_cb";
-
-#endif  // IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_INTEROP_GEN_CB_H_
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_cs_transportable.cc b/idlc/gen_aitt_plugin/aitt_plugin_cs_transportable.cc
deleted file mode 100644 (file)
index 7d427c4..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "idlc/gen_aitt_plugin/aitt_plugin_cs_transportable.h"
-
-#include <utility>
-
-#include "idlc/gen/replace_all.h"
-
-namespace {
-
-constexpr const char __USING[] =
-R"__cs_cb(
-using System;
-using System.Collections.Generic;
-using Tizen.Applications;
-using Tizen.Applications.AittPlugin;
-using Tizen.Applications.RPCPort;
-)__cs_cb";
-
-constexpr const char __FILE_SEND[] =
-R"__cs_cb(if (path == null)
-  throw new ArgumentException("Invalid path");
-
-  Payload fp = new FilePayload(<FILE_PATH>);
-  base.SendPayloadAsync(fp);
-)__cs_cb";
-
-constexpr const char __CLIENT_CTOR[] =
-R"__cs_cb(
-            public ##(string serviceName, string brokerIp, int brokerPort, string userName, string password, string myIp, int protocol) : base(serviceName, brokerIp, brokerPort, userName, password, myIp, protocol)
-            {
-                ServiceName = serviceName;
-            }
-)__cs_cb";
-
-constexpr const char __GROUP_CTOR[] =
-R"__cs_cb(
-            public ##(string topicName, string brokerIp, int brokerPort, string userName, string password, string myIp, int protocol) : base(topicName, brokerIp, brokerPort, userName, password, myIp, protocol)
-            {
-                TopicName = topicName;
-                try
-                {
-                    base.Subscribe();
-                }
-                catch
-                {
-                    throw;
-                }
-            }
-)__cs_cb";
-
-constexpr const char __SERVER_CTOR[] =
-R"__cs_cb(
-            public ##(string serviceName, string displayName, string brokerIp, int brokerPort, string userName, string password, string myIp, int protocol) : base(serviceName, displayName, brokerIp, brokerPort, userName, password, myIp, protocol)
-            {
-            }
-)__cs_cb";
-
-}  // namespace
-
-namespace tidl {
-
-std::string AittPluginCsTransportable::GenInclude() const {
-  return __USING;
-}
-
-std::string AittPluginCsTransportable::GenFileSend(std::string path) const {
-  return std::string(ReplaceAll(__FILE_SEND, {
-      { "<FILE_PATH>", path } }));
-}
-
-std::string AittPluginCsTransportable::GenGroupType() const {
-  return "GroupBase";
-}
-
-std::string AittPluginCsTransportable::GenPayloadTransferStatusType() const {
-  return "PayloadTransferStatus";
-}
-
-std::string AittPluginCsTransportable::GenPeerInfoType() const {
-  return "PeerInfo";
-}
-
-std::string AittPluginCsTransportable::GenPayloadType() const {
-  return "Payload";
-}
-
-std::string AittPluginCsTransportable::GenClientType() const {
-  return "ClientBase";
-}
-
-std::string AittPluginCsTransportable::GenServerType() const {
-  return "ServerBase";
-}
-
-std::string AittPluginCsTransportable::GenClientExtraHeader() const {
-  return "";
-}
-
-std::string AittPluginCsTransportable::GenClientExtraBody() const {
-  return "";
-}
-
-std::string AittPluginCsTransportable::GenServerExtraHeader() const {
-  return "";
-}
-
-std::string AittPluginCsTransportable::GenServerExtraBody() const {
-  return "";
-}
-
-std::string AittPluginCsTransportable::GenPayloadTypeData() const {
-  return "PayloadType.DataPayload";
-}
-
-std::string AittPluginCsTransportable::GenPayloadTypeFile() const {
-  return "PayloadType.FilePayload";
-}
-
-std::string AittPluginCsTransportable::GenClientBaseCtor(
-    const Interface& iface) const {
-  std::string ctor(ReplaceAll(__CLIENT_CTOR, "##", iface.GetID()));
-  return ctor;
-}
-
-std::string AittPluginCsTransportable::GenGroupBaseCtor(
-    const Interface& iface) const {
-  std::string ctor(ReplaceAll(__GROUP_CTOR, "##", iface.GetID()));
-  return ctor;
-}
-
-std::string AittPluginCsTransportable::GenServerBaseCtor(
-    const Interface& iface) const {
-  std::string ctor(ReplaceAll(__SERVER_CTOR, "##", iface.GetID()));
-  return ctor;
-}
-
-}  // namespace tidl
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_cs_transportable.h b/idlc/gen_aitt_plugin/aitt_plugin_cs_transportable.h
deleted file mode 100644 (file)
index fdaf949..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_TRANSPORTABLE_H_
-#define IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_TRANSPORTABLE_H_
-
-#include <string>
-
-#include "idlc/gen_cion/cs_transportable.h"
-
-namespace tidl {
-
-class AittPluginCsTransportable : public CsTransportable {
- public:
-  virtual ~AittPluginCsTransportable() = default;
-  std::string GenInclude() const override;
-  std::string GenFileSend(std::string path) const override;
-  std::string GenGroupType() const override;
-  std::string GenPayloadTransferStatusType() const override;
-  std::string GenPeerInfoType() const override;
-  std::string GenPayloadType() const override;
-  std::string GenClientType() const override;
-  std::string GenServerType() const override;
-  std::string GenClientExtraHeader() const override;
-  std::string GenClientExtraBody() const override;
-  std::string GenServerExtraHeader() const override;
-  std::string GenServerExtraBody() const override;
-  std::string GenPayloadTypeData() const override;
-  std::string GenPayloadTypeFile() const override;
-  std::string GenClientBaseCtor(const Interface& iface) const override;
-  std::string GenGroupBaseCtor(const Interface& iface) const override;
-  std::string GenServerBaseCtor(const Interface& iface) const override;
-};
-
-}  // namespace tidl
-
-#endif  // IDLC_GEN_AITT_PLUGIN_AITT_PLUGIN_CS_TRANSPORTABLE_H_
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_internal_body_gen.cc b/idlc/gen_aitt_plugin/aitt_plugin_internal_body_gen.cc
deleted file mode 100644 (file)
index 6aa0e1b..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <algorithm>
-
-#include "idlc/gen_aitt_plugin/aitt_plugin_internal_body_gen.h"
-#include "idlc/gen_aitt_plugin/aitt_plugin_internal_body_gen_cb.h"
-
-namespace tidl {
-
-AittPluginInternalBodyGen::AittPluginInternalBodyGen(std::shared_ptr<Document> doc, std::shared_ptr<tidl::Transportable> trans)
-    : CCionBodyGeneratorBase(doc, trans) {
-}
-
-void AittPluginInternalBodyGen::OnInitGen(std::ofstream& stream) {
-  GenVersion(stream);
-  GenGNUSourceDefinition(stream);
-  GenIncludeHeader(stream);
-  GenLogTag(stream, std::string("AITT_PLUGIN_INTERNAL"));
-  GenLogDefinition(stream);
-  GenBody(stream);
-  GenPluginInit(stream);
-}
-
-
-void AittPluginInternalBodyGen::GenPluginInit(std::ofstream& stream) {
-  stream << CB_PLUGIN_INIT_BASE;
-}
-
-void AittPluginInternalBodyGen::GenIncludeHeader(std::ofstream& stream) {
-  stream << tidl::ReplaceAll(CB_INTERNAL_HEADER, "<FILENAME>", GetFileNamespace());
-}
-
-void AittPluginInternalBodyGen::GenLoadModule(std::ofstream& stream) {
-  std::string code;
-  code = CB_LOAD_MOUDLE_BASE;
-  code += CB_LOAD_MOUDLE_PAYLOAD;
-  code += CB_LOAD_MOUDLE_PEERINFO;
-  code += CB_LOAD_MOUDLE_CONNECTION;
-
-  switch (GetType()) {
-    case 1:
-    {
-      code += CB_LOAD_MOUDLE_CLIENT;
-      break;
-    }
-    case 2:
-    {
-      code += CB_LOAD_MOUDLE_SERVER;
-      break;
-    }
-    case 3:
-    {
-      code += CB_LOAD_MOUDLE_GROUP;
-      break;
-    }
-    default:
-      break;
-  }
-   code += CB_LOAD_MOUDLE_BASE_RETURN;
-
-   stream << tidl::ReplaceAll(code, "<PREFIX>", GetHandlePrefix());
-}
-
-void AittPluginInternalBodyGen::GenBody(std::ofstream& stream) {
-  stream << tidl::ReplaceAll(CB_BODY_BASE, "<PREFIX>", GetHandlePrefix());
-  switch (GetType()) {
-    case 1:
-    {
-      stream << tidl::ReplaceAll(CB_BODY_CLIENT, "<PREFIX>", GetHandlePrefix());
-      break;
-    }
-    case 2:
-    {
-      stream << tidl::ReplaceAll(CB_BODY_SERVER, "<PREFIX>", GetHandlePrefix());
-      break;
-    }
-    case 3:
-    {
-      stream << tidl::ReplaceAll(CB_BODY_GROUP, "<PREFIX>", GetHandlePrefix());
-      break;
-    }
-
-    default:
-      break;
-  }
-
-  GenLoadModule(stream);
-}
-
-void AittPluginInternalBodyGen::OnFiniGen(std::ofstream& stream) {
-}
-
-}  // namespace tidl
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_internal_body_gen.h b/idlc/gen_aitt_plugin/aitt_plugin_internal_body_gen.h
deleted file mode 100644 (file)
index 0228e4f..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IDLC_AITT_PLUGIN_C_INTERNAL_BODY_GEN_H_
-#define IDLC_AITT_PLUGIN_C_INTERNAL_BODY_GEN_H_
-
-#include <memory>
-#include <string>
-
-#include "idlc/gen_cion/c_cion_body_gen_base.h"
-
-namespace tidl {
-
-class AittPluginInternalBodyGen : public CCionBodyGeneratorBase {
- public:
-  explicit AittPluginInternalBodyGen(std::shared_ptr<Document> doc, std::shared_ptr<tidl::Transportable> trans);
-  virtual ~AittPluginInternalBodyGen() = default;
-
-  void OnInitGen(std::ofstream& stream) override;
-  void OnFiniGen(std::ofstream& stream) override;
-
- private:
-  void GenPluginInit(std::ofstream& stream);
-  void GenIncludeHeader(std::ofstream& stream);
-  void GenLoadModule(std::ofstream& stream);
-  void GenBody(std::ofstream& stream);
-};
-
-}  // namespace tidl
-
-#endif  // IDLC_AITT_PLUGIN_C_INTERNAL_BODY_GEN_H_
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_internal_body_gen_cb.h b/idlc/gen_aitt_plugin/aitt_plugin_internal_body_gen_cb.h
deleted file mode 100644 (file)
index 647def8..0000000
+++ /dev/null
@@ -1,523 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IDLC_C_AITT_PLUGIN_GEN_INTERNAL_BODY_GEN_CB_H_
-#define IDLC_C_AITT_PLUGIN_GEN_INTERNAL_BODY_GEN_CB_H_
-
-constexpr const char CB_INTERNAL_HEADER[] =
-R"__c_cb(
-
-#include <dlfcn.h>
-#include <stdio.h>
-#include <dlog.h>
-
-#include "<FILENAME>.h"
-
-)__c_cb";
-
-constexpr const char CB_LOAD_MOUDLE_SERVER[] =
-R"__c_cb(
-  if (!__load_server_channel())
-    goto out;
-)__c_cb";
-
-constexpr const char CB_LOAD_MOUDLE_PAYLOAD[] =
-R"__c_cb(
-  if (!__load_payload())
-    goto out;
-)__c_cb";
-
-constexpr const char CB_LOAD_MOUDLE_PEERINFO[] =
-R"__c_cb(
-  if (!__load_peerinfo())
-    goto out;
-)__c_cb";
-
-constexpr const char CB_LOAD_MOUDLE_CONNECTION[] =
-R"__c_cb(
-  if (!__load_connection())
-    goto out;
-)__c_cb";
-
-constexpr const char CB_LOAD_MOUDLE_CLIENT[] =
-R"__c_cb(
-  if (!__load_client_channel())
-    goto out;
-)__c_cb";
-
-constexpr const char CB_LOAD_MOUDLE_GROUP[] =
-R"__c_cb(
-  if (!__load_group_channel())
-    goto out;
-)__c_cb";
-
-constexpr const char CB_PLUGIN_INIT_BASE[] =
-R"__c_cb(
-PLUGIN_CTOR static void _plugin_init(void)
-{
-  __load_module();
-}
-)__c_cb";
-
-constexpr const char CB_LOAD_MOUDLE_BASE[] =
-R"__c_cb(
-static void __load_module() {
-  plugin_handle = dlopen(LIBAITT_PLUGIN_INFO, RTLD_LAZY | RTLD_GLOBAL);
-  if (!plugin_handle) {
-    LOGE("Failed to load - %s", dlerror());
-    return;
-  }
-)__c_cb";
-
-constexpr const char CB_LOAD_MOUDLE_BASE_RETURN[] =
-R"__c_cb(
-  return;
-
-out:
-
-  dlclose(plugin_handle);
-}
-)__c_cb";
-
-constexpr const char CB_BODY_BASE[] =
-R"__c_cb(
-
-#define LIBAITT_PLUGIN_INFO "/usr/lib/libaitt_plugin.so.1"
-static void *plugin_handle;
-
-#define PLUGIN_CTOR __attribute__((constructor))
-
-static bool __load_payload() {
-  <PREFIX>_payload_create = dlsym(plugin_handle,
-      "aitt_plugin_payload_create");
-  if (!<PREFIX>_payload_create) {
-    LOGE("Failed to find plugin_payload_create");
-    return false;
-  }
-
-  <PREFIX>_payload_destroy = dlsym(plugin_handle,
-      "aitt_plugin_payload_destroy");
-  if (!<PREFIX>_payload_destroy) {
-    LOGE("Failed to find plugin_payload_destroy");
-    return false;
-  }
-
-  <PREFIX>_payload_get_type = dlsym(plugin_handle,
-      "aitt_plugin_payload_get_type");
-  if (!<PREFIX>_payload_get_type) {
-    LOGE("Failed to find plugin_payload_get_type");
-    return false;
-  }
-
-  <PREFIX>_payload_get_data = dlsym(plugin_handle,
-      "aitt_plugin_payload_get_data");
-  if (!<PREFIX>_payload_get_data) {
-    LOGE("Failed to find plugin_payload_get_data");
-    return false;
-  }
-
-  <PREFIX>_payload_set_data = dlsym(plugin_handle,
-      "aitt_plugin_payload_set_data");
-  if (!<PREFIX>_payload_set_data) {
-    LOGE("Failed to find plugin_payload_set_data");
-    return false;
-  }
-
-  <PREFIX>_payload_save_as_file = dlsym(plugin_handle,
-      "aitt_plugin_payload_save_as_file");
-  if (!<PREFIX>_payload_save_as_file) {
-    LOGE("Failed to find plugin_payload_save_as_file");
-    return false;
-  }
-
-  <PREFIX>_payload_get_received_file_name = dlsym(plugin_handle,
-      "aitt_plugin_payload_get_received_file_name");
-  if (!<PREFIX>_payload_get_received_file_name) {
-    LOGE("Failed to find plugin_payload_get_received_file_name");
-    return false;
-  }
-
-  <PREFIX>_payload_get_received_bytes = dlsym(plugin_handle,
-      "aitt_plugin_payload_get_received_bytes");
-  if (!<PREFIX>_payload_get_received_bytes) {
-    LOGE("Failed to init plugin_payload_get_received_bytes");
-    return false;
-  }
-
-  <PREFIX>_payload_get_total_bytes = dlsym(plugin_handle,
-      "aitt_plugin_payload_get_total_bytes");
-  if (!<PREFIX>_payload_get_total_bytes) {
-    LOGE("Failed to find plugin_payload_get_total_bytes");
-    return false;
-  }
-
-  <PREFIX>_payload_set_file_path = dlsym(plugin_handle,
-      "aitt_plugin_payload_set_file_path");
-  if (!<PREFIX>_payload_set_file_path) {
-    LOGE("Failed to find plugin_payload_set_file_path");
-    return false;
-  }
-
-  <PREFIX>_payload_get_payload_id = dlsym(plugin_handle,
-      "aitt_plugin_payload_get_payload_id");
-  if (!<PREFIX>_payload_get_payload_id) {
-    LOGE("Failed to find plugin_payload_get_payload_id");
-    return false;
-  }
-
-  return true;
-}
-
-static bool __load_peerinfo() {
-  <PREFIX>_peer_info_clone = dlsym(plugin_handle,
-      "aitt_plugin_peer_info_clone");
-  if (!<PREFIX>_peer_info_clone) {
-    LOGE("Failed to find plugin_peer_info_clone");
-    return false;
-  }
-
-  <PREFIX>_peer_info_destroy = dlsym(plugin_handle,
-      "aitt_plugin_peer_info_destroy");
-  if (!<PREFIX>_peer_info_destroy) {
-    LOGE("Failed to find plugin_peer_info_destroy");
-    return false;
-  }
-
-  <PREFIX>_peer_info_get_device_id = dlsym(plugin_handle,
-      "aitt_plugin_peer_info_get_device_id");
-  if (!<PREFIX>_peer_info_get_device_id) {
-    LOGE("Failed to find plugin_peer_info_get_device_id");
-    return false;
-  }
-
-  <PREFIX>_peer_info_get_device_name = dlsym(plugin_handle,
-      "aitt_plugin_peer_info_get_device_name");
-  if (!<PREFIX>_peer_info_get_device_name) {
-    LOGE("Failed to find plugin_peer_info_get_device_name");
-    return false;
-  }
-
-  <PREFIX>_peer_info_get_device_platform = dlsym(plugin_handle,
-      "aitt_plugin_peer_info_get_device_platform");
-  if (!<PREFIX>_peer_info_get_device_platform) {
-    LOGE("Failed to find plugin_peer_info_get_device_platform");
-    return false;
-  }
-
-  <PREFIX>_peer_info_get_device_platform_version = dlsym(plugin_handle,
-      "aitt_plugin_peer_info_get_device_platform_version");
-  if (!<PREFIX>_peer_info_get_device_platform_version) {
-    LOGE("Failed to find plugin_peer_info_get_device_platform_version");
-    return false;
-  }
-
-  <PREFIX>_peer_info_get_device_type = dlsym(plugin_handle,
-      "aitt_plugin_peer_info_get_device_type");
-  if (!<PREFIX>_peer_info_get_device_type) {
-    LOGE("Failed to find plugin_peer_info_get_device_type");
-    return false;
-  }
-
-  <PREFIX>_peer_info_get_app_id = dlsym(plugin_handle,
-      "aitt_plugin_peer_info_get_app_id");
-  if (!<PREFIX>_peer_info_get_app_id) {
-    LOGE("Failed to init plugin_peer_info_get_app_id");
-    return false;
-  }
-
-  <PREFIX>_peer_info_get_app_version = dlsym(plugin_handle,
-      "aitt_plugin_peer_info_get_app_version");
-  if (!<PREFIX>_peer_info_get_app_version) {
-    LOGE("Failed to find plugin_peer_info_get_app_version");
-    return false;
-  }
-
-  <PREFIX>_peer_info_get_uuid = dlsym(plugin_handle,
-      "aitt_plugin_peer_info_get_uuid");
-  if (!<PREFIX>_peer_info_get_uuid) {
-    LOGE("Failed to find plugin_peer_info_get_uuid");
-    return false;
-  }
-
-  <PREFIX>_peer_info_get_display_name = dlsym(plugin_handle,
-      "aitt_plugin_peer_info_get_display_name");
-  if (!<PREFIX>_peer_info_get_display_name) {
-    LOGE("Failed to find plugin_peer_info_get_display_name");
-    return false;
-  }
-
-  return true;
-}
-
-static bool __load_connection() {
-  <PREFIX>_connection_result_get_status = dlsym(plugin_handle,
-      "aitt_plugin_connection_result_get_status");
-  if (!<PREFIX>_connection_result_get_status) {
-    LOGE("Failed to find plugin_connection_result_get_status");
-    return false;
-  }
-
-  <PREFIX>_connection_result_get_reason = dlsym(plugin_handle,
-      "aitt_plugin_connection_result_get_reason");
-  if (!<PREFIX>_connection_result_get_reason) {
-    LOGE("Failed to find plugin_connection_result_get_reason");
-    return false;
-  }
-
-  return true;
-}
-)__c_cb";
-
-constexpr const char CB_BODY_GROUP[] =
-R"__c_cb(
-static bool __load_group_channel() {
-  <PREFIX>_group_create = dlsym(plugin_handle, "aitt_plugin_group_create");
-  if (!<PREFIX>_group_create) {
-    LOGE("Failed to find plugin_group_create");
-    return false;
-  }
-
-  <PREFIX>_group_destroy = dlsym(plugin_handle,
-      "aitt_plugin_group_destroy");
-  if (!<PREFIX>_group_destroy) {
-    LOGE("Failed to find plugin_group_destroy");
-    return false;
-  }
-
-  <PREFIX>_group_subscribe = dlsym(plugin_handle,
-      "aitt_plugin_group_subscribe");
-  if (!<PREFIX>_group_subscribe) {
-    LOGE("Failed to find plugin_group_subscribe");
-    return false;
-  }
-
-  <PREFIX>_group_unsubscribe = dlsym(plugin_handle,
-      "aitt_plugin_group_unsubscribe");
-  if (!<PREFIX>_group_unsubscribe) {
-    LOGE("Failed to find plugin_group_unsubscribe");
-    return false;
-  }
-
-  <PREFIX>_group_publish = dlsym(plugin_handle,
-      "aitt_plugin_group_publish");
-  if (!<PREFIX>_group_publish) {
-    LOGE("Failed to find plugin_group_publish");
-    return false;
-  }
-
-  <PREFIX>_group_add_payload_received_cb = dlsym(plugin_handle,
-      "aitt_plugin_group_add_payload_received_cb");
-  if (!<PREFIX>_group_add_payload_received_cb) {
-    LOGE("Failed to find plugin_group_add_payload_received_cb");
-    return false;
-  }
-
-  <PREFIX>_group_add_joined_cb = dlsym(plugin_handle,
-      "aitt_plugin_group_add_joined_cb");
-  if (!<PREFIX>_group_add_joined_cb) {
-    LOGE("Failed to find plugin_group_add_joined_cb");
-    return false;
-  }
-
-  <PREFIX>_group_add_left_cb = dlsym(plugin_handle,
-      "aitt_plugin_group_add_left_cb");
-  if (!<PREFIX>_group_add_left_cb) {
-    LOGE("Failed to init plugin_group_add_left_cb");
-    return false;
-  }
-
-  return true;
-}
-)__c_cb";
-
-constexpr const char CB_BODY_CLIENT[] =
-R"__c_cb(
-static bool __load_client_channel() {
-  <PREFIX>_client_create = dlsym(plugin_handle, "aitt_plugin_client_create");
-  if (!<PREFIX>_client_create) {
-    LOGE("Failed to find plugin_client_create");
-    return false;
-  }
-
-  <PREFIX>_client_destroy = dlsym(plugin_handle,
-      "aitt_plugin_client_destroy");
-  if (!<PREFIX>_client_destroy) {
-    LOGE("Failed to find plugin_client_destroy");
-    return false;
-  }
-
-  <PREFIX>_client_try_discovery = dlsym(plugin_handle,
-      "aitt_plugin_client_try_discovery");
-  if (!<PREFIX>_client_try_discovery) {
-    LOGE("Failed to find plugin_client_try_discovery");
-    return false;
-  }
-
-  <PREFIX>_client_stop_discovery = dlsym(plugin_handle,
-      "aitt_plugin_client_stop_discovery");
-  if (!<PREFIX>_client_stop_discovery) {
-    LOGE("Failed to find plugin_client_stop_discovery");
-    return false;
-  }
-
-  <PREFIX>_client_connect = dlsym(plugin_handle,
-      "aitt_plugin_client_connect");
-  if (!<PREFIX>_client_connect) {
-    LOGE("Failed to find plugin_client_connect");
-    return false;
-  }
-
-  <PREFIX>_client_disconnect = dlsym(plugin_handle,
-      "aitt_plugin_client_disconnect");
-  if (!<PREFIX>_client_disconnect) {
-    LOGE("Failed to find plugin_client_disconnect");
-    return false;
-  }
-
-  <PREFIX>_client_send_data = dlsym(plugin_handle,
-      "aitt_plugin_client_send_data");
-  if (!<PREFIX>_client_send_data) {
-    LOGE("Failed to find plugin_client_send_data");
-    return false;
-  }
-
-  <PREFIX>_client_send_payload_async = dlsym(plugin_handle,
-      "aitt_plugin_client_send_payload_async");
-  if (!<PREFIX>_client_send_payload_async) {
-    LOGE("Failed to init plugin_client_send_payload_async");
-    return false;
-  }
-
-  <PREFIX>_client_add_connection_result_cb = dlsym(plugin_handle,
-      "aitt_plugin_client_add_connection_result_cb");
-  if (!<PREFIX>_client_add_connection_result_cb) {
-    LOGE("Failed to find plugin_client_add_connection_result_cb");
-    return false;
-  }
-
-  <PREFIX>_client_add_payload_received_cb = dlsym(plugin_handle,
-        "aitt_plugin_client_add_payload_received_cb");
-  if (!<PREFIX>_client_add_payload_received_cb) {
-    LOGE("Failed to find plugin_client_add_payload_received_cb");
-    return false;
-  }
-
-  <PREFIX>_client_add_disconnected_cb = dlsym(plugin_handle,
-      "aitt_plugin_client_add_disconnected_cb");
-  if (!<PREFIX>_client_add_disconnected_cb) {
-    LOGE("Failed to find plugin_client_add_disconnected_cb");
-    return false;
-  }
-
-  return true;
-}
-)__c_cb";
-
-constexpr const char CB_BODY_SERVER[] =
-R"__c_cb(
-static bool __load_server_channel() {
-  <PREFIX>_server_create = dlsym(plugin_handle, "aitt_plugin_server_create");
-  if (!<PREFIX>_server_create) {
-    LOGE("Failed to find plugin_server_create");
-    return false;
-  }
-
-  <PREFIX>_server_add_connection_result_cb = dlsym(plugin_handle,
-      "aitt_plugin_server_add_connection_result_cb");
-  if (!<PREFIX>_server_add_connection_result_cb) {
-    LOGE("Failed to find plugin_server_add_connection_result_cb");
-    return false;
-  }
-
-  <PREFIX>_server_add_payload_received_cb = dlsym(plugin_handle,
-      "aitt_plugin_server_add_payload_received_cb");
-  if (!<PREFIX>_server_add_payload_received_cb) {
-    LOGE("Failed to find plugin_server_add_payload_received_cb");
-    return false;
-  }
-
-  <PREFIX>_server_add_disconnected_cb = dlsym(plugin_handle,
-      "aitt_plugin_server_add_disconnected_cb");
-  if (!<PREFIX>_server_add_disconnected_cb) {
-    LOGE("Failed to find plugin_server_add_disconnected_cb");
-    return false;
-  }
-
-  <PREFIX>_server_set_data_received_cb = dlsym(plugin_handle,
-      "aitt_plugin_server_set_data_received_cb");
-  if (!<PREFIX>_server_set_data_received_cb) {
-    LOGE("Failed to find plugin_server_set_data_received_cb");
-    return false;
-  }
-
-  <PREFIX>_server_listen = dlsym(plugin_handle, "aitt_plugin_server_listen");
-  if (!<PREFIX>_server_listen) {
-    LOGE("Failed to find plugin_server_listen");
-    return false;
-  }
-
-  <PREFIX>_server_foreach_connected_peer_info = dlsym(plugin_handle,
-      "aitt_plugin_server_foreach_connected_peer_info");
-  if (!<PREFIX>_server_foreach_connected_peer_info) {
-    LOGE("Failed to find <PREFIX>_server_foreach_connected_peer_info");
-    return false;
-  }
-
-  <PREFIX>_server_accept = dlsym(plugin_handle, "aitt_plugin_server_accept");
-  if (!<PREFIX>_server_accept) {
-    LOGE("Failed to init plugin_server_accept");
-    return false;
-  }
-
-  <PREFIX>_server_reject = dlsym(plugin_handle, "aitt_plugin_server_reject");
-  if (!<PREFIX>_server_reject) {
-    LOGE("Failed to find plugin_server_reject");
-    return false;
-  }
-
-  <PREFIX>_server_set_display_name = dlsym(plugin_handle,
-        "aitt_plugin_server_set_display_name");
-  if (!<PREFIX>_server_set_display_name) {
-    LOGE("Failed to find plugin_server_set_display_name");
-    return false;
-  }
-
-  <PREFIX>_server_send_payload_async = dlsym(plugin_handle,
-      "aitt_plugin_server_send_payload_async");
-  if (!<PREFIX>_server_send_payload_async) {
-    LOGE("Failed to find plugin_server_send_payload_async");
-    return false;
-  }
-
-  <PREFIX>_server_destroy = dlsym(plugin_handle,
-      "aitt_plugin_server_destroy");
-  if (!<PREFIX>_server_destroy) {
-    LOGE("Failed to find plugin_server_destroy");
-    return false;
-  }
-
-  <PREFIX>_server_disconnect = dlsym(plugin_handle,
-      "aitt_plugin_server_disconnect");
-  if (!<PREFIX>_server_disconnect) {
-    LOGE("Failed to find plugin_server_disconnect");
-    return false;
-  }
-
-  return true;
-}
-)__c_cb";
-
-#endif  // IDLC_C_AITT_PLUGIN_GEN_INTERNAL_BODY_GEN_CB_H_
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_internal_header_gen.cc b/idlc/gen_aitt_plugin/aitt_plugin_internal_header_gen.cc
deleted file mode 100644 (file)
index 63261e5..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "idlc/gen_aitt_plugin/aitt_plugin_internal_header_gen.h"
-
-namespace {
-#include "idlc/gen_aitt_plugin/aitt_plugin_internal_header_gen_cb.h"
-}
-
-namespace tidl {
-
-AittPluginInternalHeaderGen::AittPluginInternalHeaderGen(std::shared_ptr<Document> doc, std::shared_ptr<tidl::Transportable> trans)
-    : CCionHeaderGeneratorBase(doc, trans) {}
-
-void AittPluginInternalHeaderGen::OnInitGen(std::ofstream& stream) {
-  GenVersion(stream);
-
-  stream << tidl::ReplaceAll(CB_HEADER_START, "<PREFIX>", GetHandlePrefix());
-  stream << tidl::ReplaceAll(CB_HEADER_DEF_COMMON, "<PREFIX>", GetHandlePrefix());
-
-  switch (GetType()) {
-    case 1:
-    {
-      stream << tidl::ReplaceAll(CB_HEADER_DEF_CLIENT, "<PREFIX>", GetHandlePrefix());
-      stream << tidl::ReplaceAll(CB_HEADER_FUN_CLIENT, "<PREFIX>", GetHandlePrefix());
-      break;
-    }
-    case 2:
-    {
-      stream << tidl::ReplaceAll(CB_HEADER_DEF_SERVER, "<PREFIX>", GetHandlePrefix());
-      stream << tidl::ReplaceAll(CB_HEADER_FUN_SERVER, "<PREFIX>", GetHandlePrefix());
-      break;
-    }
-    case 3:
-    {
-      stream << tidl::ReplaceAll(CB_HEADER_DEF_GROUP, "<PREFIX>", GetHandlePrefix());
-      stream << tidl::ReplaceAll(CB_HEADER_FUN_GROUP, "<PREFIX>", GetHandlePrefix());
-      break;
-    }
-    default:
-      break;
-  }
-
-  stream << tidl::ReplaceAll(CB_HEADER_FUN_COMMOM, "<PREFIX>", GetHandlePrefix());
-}
-
-void AittPluginInternalHeaderGen::OnFiniGen(std::ofstream& stream) {
-  GenExplicitLinkageClose(stream);
-}
-
-}  // namespace tidl
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_internal_header_gen.h b/idlc/gen_aitt_plugin/aitt_plugin_internal_header_gen.h
deleted file mode 100644 (file)
index bbefc4d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IDLC_AITT_PLUGIN_C_INTERNAL_HEADER_GEN_H_
-#define IDLC_AITT_PLUGIN_C_INTERNAL_HEADER_GEN_H_
-
-#include <memory>
-#include <string>
-
-#include "idlc/gen_cion/c_cion_header_gen_base.h"
-
-namespace tidl {
-
-class AittPluginInternalHeaderGen : public CCionHeaderGeneratorBase {
- public:
-  explicit AittPluginInternalHeaderGen(std::shared_ptr<Document> doc, std::shared_ptr<tidl::Transportable> trans);
-  virtual ~AittPluginInternalHeaderGen() = default;
-
-  void OnInitGen(std::ofstream& stream) override;
-  void OnFiniGen(std::ofstream& stream) override;
-};
-
-}  // namespace tidl
-
-#endif  // IDLC_AITT_PLUGIN_C_INTERNAL_HEADER_GEN_H_
\ No newline at end of file
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_internal_header_gen_cb.h b/idlc/gen_aitt_plugin/aitt_plugin_internal_header_gen_cb.h
deleted file mode 100644 (file)
index e5749b1..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IDLC_C_AITT_PLUGIN_GEN_INTERNAL_HEADER_GEN_CB_H_
-#define IDLC_C_AITT_PLUGIN_GEN_INTERNAL_HEADER_GEN_CB_H_
-constexpr const char CB_HEADER_START[] =
-R"__c_cb(
-
-#pragma once
-
-#include <stdlib.h>
-#include <stdbool.h>
-#include <stdint.h>
-
-#include <tizen.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum _<PREFIX>_transfer_status_e {
-  SUCCESS, /**< Transfer is success **/
-  FAILURE, /**< Transfer is failed **/
-  IN_PROGRESS, /**< Transfer is in progress **/
-} <PREFIX>_transfer_status_e;
-
-typedef enum _<PREFIX>_payload_type_e {
-  AITT_PLUGIN_PAYLOAD_TYPE_DATA, /**< Data type payload **/
-  AITT_PLUGIN_PAYLOAD_TYPE_FILE, /**< File type payload **/
-} <PREFIX>_payload_type_e;
-
-typedef enum _<PREFIX>_connection_status_e {
-  CONNECTION_STATUS_OK, /**< Connection is ok **/
-  CONNECTION_STATUS_REJECTED, /**< Connection is rejected **/
-  CONNECTION_STATUS_ERROR, /**< Connection error occurs **/
-} <PREFIX>_connection_status_e;
-)__c_cb";
-
-constexpr const char CB_HEADER_DEF_COMMON[] =
-R"__c_cb(
-typedef void *<PREFIX>_peer_info_h;
-typedef void *<PREFIX>_connection_result_h;
-typedef void *<PREFIX>_payload_h;
-typedef void *<PREFIX>_payload_async_result_h;
-)__c_cb";
-
-constexpr const char CB_HEADER_DEF_SERVER[] =
-R"__c_cb(
-typedef void *<PREFIX>_server_h;
-
-typedef void (*<PREFIX>_server_connection_result_cb)(
-    const char *service_name, const <PREFIX>_peer_info_h peer_info,
-    const <PREFIX>_connection_result_h result, void *user_data);
-typedef void (*<PREFIX>_server_payload_received_cb)(const char *service_name,
-    const <PREFIX>_peer_info_h peer_info, const <PREFIX>_payload_h payload,
-    <PREFIX>_transfer_status_e status, void *user_data);
-typedef void (*<PREFIX>_server_connection_request_cb)(const char *service_name,
-    const <PREFIX>_peer_info_h peer_info, void *user_data);
-typedef void (*<PREFIX>_server_disconnected_cb)(const char *service_name,
-    const <PREFIX>_peer_info_h peer_info, void *user_data);
-typedef void (*<PREFIX>_server_data_received_cb)(const char *service_name,
-    const <PREFIX>_peer_info_h peer_info, const unsigned char *data,
-    unsigned int data_size, unsigned char **return_data,
-    unsigned int *return_data_size, void *user_data);
-typedef bool (*<PREFIX>_server_connected_peer_info_cb)(
-    const <PREFIX>_peer_info_h peer_info, void *user_data);
-typedef void (*<PREFIX>_server_payload_async_result_cb)(
-    const <PREFIX>_payload_async_result_h result, void *user_data);
-)__c_cb";
-
-constexpr const char CB_HEADER_DEF_GROUP[] =
-R"__c_cb(
-typedef void *<PREFIX>_group_h;
-
-typedef void (*<PREFIX>_group_payload_received_cb)(const char *topic_name,
-    const <PREFIX>_peer_info_h peer_info, <PREFIX>_payload_h payload,
-    void *user_data);
-typedef void (*<PREFIX>_group_joined_cb)(const char *topic_name,
-    const <PREFIX>_peer_info_h peer_info, void *user_data);
-
-typedef void (*<PREFIX>_group_left_cb)(const char *topic_name,
-    const <PREFIX>_peer_info_h peer_info, void *user_data);
-)__c_cb";
-
-constexpr const char CB_HEADER_DEF_CLIENT[] =
-R"__c_cb(
-typedef void *<PREFIX>_client_h;
-
-typedef void (*<PREFIX>_client_server_discovered_cb)(const char *service_name,
-    const <PREFIX>_peer_info_h peer_info, void *user_data);
-typedef void (*<PREFIX>_client_connection_result_cb)(
-    const char *service_name, const <PREFIX>_peer_info_h peer_info,
-    const <PREFIX>_connection_result_h result, void *user_data);
-typedef void (*<PREFIX>_client_payload_async_result_cb)(
-    const <PREFIX>_payload_async_result_h result, void *user_data);
-typedef void (*<PREFIX>_client_payload_received_cb)(const char *service_name,
-    const <PREFIX>_peer_info_h peer_info, const <PREFIX>_payload_h payload,
-    <PREFIX>_transfer_status_e status, void *user_data);
-typedef void (*<PREFIX>_client_disconnected_cb)(const char *service_name,
-    const <PREFIX>_peer_info_h peer_info, void *user_data);
-)__c_cb";
-
-constexpr const char CB_HEADER_FUN_GROUP[] =
-R"__c_cb(
-int (*<PREFIX>_group_create)(<PREFIX>_group_h *, const char *,
-    const char *, int , const char *, const char *,
-    const char *, int);
-int (*<PREFIX>_group_destroy)(<PREFIX>_group_h);
-int (*<PREFIX>_group_subscribe)(<PREFIX>_group_h);
-int (*<PREFIX>_group_unsubscribe)(<PREFIX>_group_h);
-int (*<PREFIX>_group_publish)(<PREFIX>_group_h, <PREFIX>_payload_h);
-int (*<PREFIX>_group_add_payload_received_cb)(<PREFIX>_group_h,
-    <PREFIX>_group_payload_received_cb, void *);
-int (*<PREFIX>_group_add_joined_cb)(<PREFIX>_group_h,
-    <PREFIX>_group_joined_cb, void *);
-int (*<PREFIX>_group_add_left_cb)(<PREFIX>_group_h,
-  <PREFIX>_group_left_cb, void *);
-)__c_cb";
-
-constexpr const char CB_HEADER_FUN_CLIENT[] =
-R"__c_cb(
-int (*<PREFIX>_client_create)(<PREFIX>_client_h *, const char *,
-    const char *, int , const char *, const char *,
-    const char *, int);
-int (*<PREFIX>_client_destroy)(<PREFIX>_client_h);
-int (*<PREFIX>_client_try_discovery)(<PREFIX>_client_h,
-    <PREFIX>_client_server_discovered_cb, void *);
-int (*<PREFIX>_client_stop_discovery)(<PREFIX>_client_h);
-int (*<PREFIX>_client_connect)(<PREFIX>_client_h, const <PREFIX>_peer_info_h);
-int (*<PREFIX>_client_disconnect)(<PREFIX>_client_h);
-int (*<PREFIX>_client_send_data)(<PREFIX>_client_h, unsigned char *,
-    unsigned int, int, unsigned char **, unsigned int *);
-int (*<PREFIX>_client_send_payload_async)(<PREFIX>_client_h,
-    <PREFIX>_payload_h, <PREFIX>_client_payload_async_result_cb, void *);
-int (*<PREFIX>_client_add_connection_result_cb)(<PREFIX>_client_h,
-    <PREFIX>_client_connection_result_cb, void *);
-int (*<PREFIX>_client_add_payload_received_cb)(<PREFIX>_client_h,
-    <PREFIX>_client_payload_received_cb, void *);
-int (*<PREFIX>_client_add_disconnected_cb)(<PREFIX>_client_h,
-    <PREFIX>_client_disconnected_cb, void *);
-)__c_cb";
-
-constexpr const char CB_HEADER_FUN_SERVER[] =
-R"__c_cb(
-int (*<PREFIX>_server_create)(<PREFIX>_server_h *, const char *,
-    const char *, const char *, int ,const char *, const char *, const char *, int);
-int (*<PREFIX>_server_add_connection_result_cb)(<PREFIX>_server_h,
-    <PREFIX>_server_connection_result_cb, void *);
-int (*<PREFIX>_server_add_payload_received_cb)(<PREFIX>_server_h,
-    <PREFIX>_server_payload_received_cb, void *);
-int (*<PREFIX>_server_add_disconnected_cb)(<PREFIX>_server_h,
-    <PREFIX>_server_disconnected_cb, void *);
-int (*<PREFIX>_server_set_data_received_cb)(<PREFIX>_server_h,
-    <PREFIX>_server_data_received_cb , void *);
-int (*<PREFIX>_server_destroy)(<PREFIX>_server_h);
-int (*<PREFIX>_server_listen)(<PREFIX>_server_h,
-    <PREFIX>_server_connection_request_cb, void *);
-int (*<PREFIX>_server_foreach_connected_peer_info)(<PREFIX>_server_h,
-    <PREFIX>_server_connected_peer_info_cb, void *);
-int (*<PREFIX>_server_accept)(<PREFIX>_server_h, const <PREFIX>_peer_info_h);
-int (*<PREFIX>_server_reject)(<PREFIX>_server_h,const <PREFIX>_peer_info_h,
-    const char *);
-int (*<PREFIX>_server_set_display_name)(<PREFIX>_server_h, const char *);
-int (*<PREFIX>_server_send_payload_async)(<PREFIX>_server_h,
-    <PREFIX>_peer_info_h, <PREFIX>_payload_h,
-    <PREFIX>_server_payload_async_result_cb, void *);
-int (*<PREFIX>_server_disconnect)(<PREFIX>_server_h, <PREFIX>_peer_info_h);
-)__c_cb";
-
-constexpr const char CB_HEADER_FUN_COMMOM[] =
-R"__c_cb(
-int (*<PREFIX>_payload_create)(<PREFIX>_payload_h *, <PREFIX>_payload_type_e);
-int (*<PREFIX>_payload_destroy)(<PREFIX>_payload_h);
-int (*<PREFIX>_payload_get_type)(<PREFIX>_payload_h, <PREFIX>_payload_type_e *);
-int (*<PREFIX>_payload_get_data)(<PREFIX>_payload_h, unsigned char **, unsigned int *);
-int (*<PREFIX>_payload_set_data)(<PREFIX>_payload_h, const unsigned char *, unsigned int);
-int (*<PREFIX>_payload_save_as_file)(<PREFIX>_payload_h, const char *);
-int (*<PREFIX>_payload_get_received_file_name)(<PREFIX>_payload_h, char **);
-int (*<PREFIX>_payload_get_received_bytes)(<PREFIX>_payload_h, uint64_t *);
-int (*<PREFIX>_payload_get_total_bytes)(<PREFIX>_payload_h, uint64_t *);
-int (*<PREFIX>_payload_set_file_path)(<PREFIX>_payload_h, const char *);
-int (*<PREFIX>_payload_get_payload_id)(<PREFIX>_payload_h, char **);
-
-int (*<PREFIX>_peer_info_clone)(const <PREFIX>_peer_info_h, <PREFIX>_peer_info_h *);
-int (*<PREFIX>_peer_info_destroy)(<PREFIX>_peer_info_h);
-int (*<PREFIX>_peer_info_get_device_id)(<PREFIX>_peer_info_h, char **);
-int (*<PREFIX>_peer_info_get_device_name)(<PREFIX>_peer_info_h, char **);
-int (*<PREFIX>_peer_info_get_device_platform)(<PREFIX>_peer_info_h, char **);
-int (*<PREFIX>_peer_info_get_device_platform_version)(<PREFIX>_peer_info_h, char **);
-int (*<PREFIX>_peer_info_get_device_type)(<PREFIX>_peer_info_h, char **);
-int (*<PREFIX>_peer_info_get_app_id)(<PREFIX>_peer_info_h, char **);
-int (*<PREFIX>_peer_info_get_app_version)(<PREFIX>_peer_info_h, char **);
-int (*<PREFIX>_peer_info_get_uuid)(<PREFIX>_peer_info_h, char **);
-int (*<PREFIX>_peer_info_get_display_name)(<PREFIX>_peer_info_h, char **);
-
-int (*<PREFIX>_connection_result_get_status)(const <PREFIX>_connection_result_h, <PREFIX>_connection_status_e *);
-int (*<PREFIX>_connection_result_get_reason)(const <PREFIX>_connection_result_h, char **reason);
-)__c_cb";
-
-#endif  // IDLC_C_AITT_PLUGIN_GEN_INTERNAL_HEADER_GEN_CB_H_
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_java_transportable.cc b/idlc/gen_aitt_plugin/aitt_plugin_java_transportable.cc
deleted file mode 100644 (file)
index 4760b11..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "idlc/gen_aitt_plugin/aitt_plugin_java_transportable.h"
-
-#include <utility>
-
-#include "idlc/gen/replace_all.h"
-
-namespace {
-
-std::string ParamsToString(std::vector<std::string> params) {
-  std::string res;
-  for (auto it = params.begin(); it != params.end(); it++) {
-    res += *it;
-    if ((it + 1) != params.end())
-      res += ", ";
-  }
-
-  return res;
-}
-
-constexpr const char __CLIENT_BASE_CONSTRUCTOR[] =
-R"__java_cb(
-    /**
-     * Constructor
-     * @param mContext The Context
-     * @param serviceName Service name
-     */
-    public ClientBase(Context mContext, String serviceName, String brokerIp) {
-        mClient = new <CLIENT_CHANNEL>(mContext, serviceName, brokerIp);
-        this.mContext = mContext;
-    }
-)__java_cb";
-
-constexpr const char __SERVER_BASE_CONSTRUCTOR[] =
-R"__java_cb(
-    /**
-     * Constructor
-     * @param mContext Context
-     * @param mServiceName Service name
-     * @param mDisplayName Display name
-     */
-    public ServerBase(Context mContext, String mServiceName, String mDisplayName, String brokerIp) {
-        mServer = new <SERVER_CHANNEL>(mContext, mServiceName, mDisplayName, brokerIp);
-        this.mContext = mContext;
-        this.mServiceName = mServiceName;
-        this.mDisplayName = mDisplayName;
-    }
-)__java_cb";
-
-constexpr const char __GROUP_BASE_CONSTRUCTOR[] =
-R"__java_cb(
-    /**
-     * Constructor
-     * @param mContext The Context
-     * @param topicName Topic name
-     */
-    public GroupBase(Context mContext, String topicName, String brokerIp) {
-        mGroup = new <GROUP_CHANNEL>(mContext, topicName, brokerIp);
-        this.mContext = mContext;
-    }
-)__java_cb";
-
-constexpr const char __ON_LEFT_EVENT_METHOD[] =
-R"__java_cb(
-    @Override
-    public void onLeft(<PEER_INFO_T> peerInfo, String topic_name) {
-    }
-)__java_cb";
-
-constexpr const char __ON_JOINED_EVENT_METHOD[] =
-R"__java_cb(
-    @Override
-    public void onJoined(<PEER_INFO_T> peerInfo, String topic_name) {
-    }
-)__java_cb";
-
-constexpr const char __INHERITED_CLASS_CONSTRUCTOR[] =
-R"__java_cb(
-public $$(<PARAMETERS>, String brokerIp) {
-    super(<BASE_CLASS_PARAMETERS>, brokerIp);
-    <EXTRA_OPERATION>
-}
-)__java_cb";
-
-}  // namespace
-
-namespace tidl {
-
-std::string AittPluginJavaTransportable::GenInclude() const {
-  return "import org.tizen.aitt.*;";
-}
-
-std::string AittPluginJavaTransportable::GenParcelInclude() const {
-  return "import org.tizen.aitt.AittParcel;";
-}
-
-std::string AittPluginJavaTransportable::GenParcel() const {
-  return "AittParcel";
-}
-
-std::string AittPluginJavaTransportable::GenClientBaseConstructor() const {
-  return __CLIENT_BASE_CONSTRUCTOR;
-}
-
-std::string AittPluginJavaTransportable::GenServerBaseConstructor() const {
-  return __SERVER_BASE_CONSTRUCTOR;
-}
-
-std::string AittPluginJavaTransportable::GenGroupBaseConstructor() const {
-  return __GROUP_BASE_CONSTRUCTOR;
-}
-
-std::string AittPluginJavaTransportable::GenOnLeftEventMethod() const {
-  return __ON_LEFT_EVENT_METHOD;
-}
-
-std::string AittPluginJavaTransportable::GenOnJoinedEventMethod() const {
-  return __ON_JOINED_EVENT_METHOD;
-}
-
-std::string AittPluginJavaTransportable::GenInheritedClassConstructor(
-    std::vector<std::string> params, std::vector<std::string> base_class_params,
-    std::string extra_operation) const {
-  return std::string(ReplaceAll(__INHERITED_CLASS_CONSTRUCTOR, {
-      { "<PARAMETERS>", ParamsToString(params) },
-      { "<BASE_CLASS_PARAMETERS>", ParamsToString(base_class_params) },
-      { "<EXTRA_OPERATION>", extra_operation }
-  }));
-}
-
-}  // namespace tidl
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_java_transportable.h b/idlc/gen_aitt_plugin/aitt_plugin_java_transportable.h
deleted file mode 100644 (file)
index ebe543c..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IDLC_GEN_AITT_PLUGIN_JAVA_TRANSPORTABLE_H_
-#define IDLC_GEN_AITT_PLUGIN_JAVA_TRANSPORTABLE_H_
-
-#include <string>
-
-#include "idlc/gen_cion/default_java_transportable.h"
-
-namespace tidl {
-
-class AittPluginJavaTransportable : public DefaultJavaTransportable {
- public:
-  std::string GenInclude() const override;
-  std::string GenParcelInclude() const override;
-  std::string GenParcel() const override;
-  std::string GenClientBaseConstructor() const override;
-  std::string GenServerBaseConstructor() const override;
-  std::string GenGroupBaseConstructor() const override;
-  std::string GenOnLeftEventMethod() const override;
-  std::string GenOnJoinedEventMethod() const override;
-  std::string GenInheritedClassConstructor(std::vector<std::string> params,
-      std::vector<std::string> base_class_params,
-      std::string extra_operation) const override;
-};
-
-}  // namespace tidl
-
-#endif  // IDLC_GEN_AITT_PLUGIN_JAVA_TRANSPORTABLE_H_
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_loader.cc b/idlc/gen_aitt_plugin/aitt_plugin_loader.cc
deleted file mode 100644 (file)
index e40afdc..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "idlc/gen_aitt_plugin/aitt_plugin_loader.h"
-
-#include "idlc/gen_aitt_plugin/aitt_plugin_c_transportable.h"
-#include "idlc/gen_aitt_plugin/aitt_plugin_cs_transportable.h"
-#include "idlc/gen_aitt_plugin/aitt_plugin_java_transportable.h"
-#include "idlc/gen_aitt_plugin/aitt_plugin_cpp_transportable.h"
-#include "idlc/gen_cion/default_cpp_transportable.h"
-#include "idlc/gen_cion/default_java_transportable.h"
-#include "idlc/gen_cion/default_cs_transportable.h"
-
-namespace tidl {
-
-AIttPluginLoader::AIttPluginLoader(const std::string& plugin_path) {
-  if (plugin_path.empty()) {
-    C_.reset(new AittPluginCTransportable());
-    Cs_.reset(new AittPluginCsTransportable());
-    Cpp_.reset(new AittPluginCppTransportable());
-    Java_.reset(new AittPluginJavaTransportable());
-  } else {
-    // TODO
-  }
-}
-
-const CTransportable& AIttPluginLoader::C() {
-  return *C_;
-}
-
-const CppTransportable& AIttPluginLoader::Cpp() {
-  return *Cpp_;
-}
-
-const CsTransportable& AIttPluginLoader::Cs() {
- return *Cs_;
-
-}
-
-const JavaTransportable& AIttPluginLoader::Java() {
- return *Java_;
-}
-}  // namespace tidl
diff --git a/idlc/gen_aitt_plugin/aitt_plugin_loader.h b/idlc/gen_aitt_plugin/aitt_plugin_loader.h
deleted file mode 100644 (file)
index 75de7c4..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IDLC_GEN_AITT_PLUGIN_LOADER_H_
-#define IDLC_GEN_AITT_PLUGIN_LOADER_H_
-
-#include <memory>
-#include <string>
-
-#include "idlc/gen_cion/transportable.h"
-
-namespace tidl {
-
-class AIttPluginLoader : public Transportable {
- public:
-  explicit AIttPluginLoader(const std::string& plugin_path);
-
-  const CTransportable& C() override;
-  const CppTransportable& Cpp() override;
-  const CsTransportable& Cs() override;
-  const JavaTransportable& Java() override;
-
- private:
-  std::unique_ptr<CTransportable> C_;
-  std::unique_ptr<CppTransportable> Cpp_;
-  std::unique_ptr<CsTransportable> Cs_;
-  std::unique_ptr<JavaTransportable> Java_;
-};
-
-}  // namespace tidl
-
-#endif  // IDLC_GEN_AITT_PLUGIN_LOADER_H_
\ No newline at end of file
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_c_transportable.cc b/idlc/gen_mqtt_plugin/mqtt_plugin_c_transportable.cc
new file mode 100644 (file)
index 0000000..59938e4
--- /dev/null
@@ -0,0 +1,1191 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_c_transportable.h"
+
+#include <utility>
+
+#include "idlc/gen/replace_all.h"
+
+namespace {
+
+constexpr const char __CLINET_FILE_SEND[] =
+R"__c_cb(
+    <INTERNAL_PREFIX>_payload_h pl;
+    int ret = <INTERNAL_PREFIX>_payload_create(&pl, MQTT_PLUGIN_PAYLOAD_TYPE_FILE);
+
+    if (ret != MQTT_PLUGIN_ERROR_NONE) {
+      _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret);
+      return ret;
+    }
+
+    ret = <INTERNAL_PREFIX>_payload_set_file_path(pl, <FILE_PATH>);
+    if (ret != MQTT_PLUGIN_ERROR_NONE) {
+      _E("Failed to <INTERNAL_PREFIX>_payload_set_file_path : %d - %s", ret, value);
+      <INTERNAL_PREFIX>_payload_destroy(pl);
+      return ret;
+    }
+
+    ret = <INTERNAL_PREFIX>_client_send_payload_async(<CLIENT_H>, pl, NULL, NULL);
+    if (ret != MQTT_PLUGIN_ERROR_NONE) {
+      _E("Failed to <INTERNAL_PREFIX>_client_send_payload_async : %d - %s", ret, value);
+      <INTERNAL_PREFIX>_payload_destroy(pl);
+      return ret;
+    }
+
+    <INTERNAL_PREFIX>_payload_destroy(pl);
+)__c_cb";
+
+constexpr const char __SERVER_FILE_SEND[] =
+R"__c_cb(
+    <INTERNAL_PREFIX>_payload_h pl;
+    int r = <INTERNAL_PREFIX>_payload_create(&pl, MQTT_PLUGIN_PAYLOAD_TYPE_FILE);
+
+    if (r != MQTT_PLUGIN_ERROR_NONE) {
+      _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", r);
+      return r;
+    }
+
+    r = <INTERNAL_PREFIX>_payload_set_file_path(pl, <FILE_PATH>);
+    if (r != MQTT_PLUGIN_ERROR_NONE) {
+      _E("Failed to <INTERNAL_PREFIX>_payload_set_file_path : %d - %s", r, value);
+      <INTERNAL_PREFIX>_payload_destroy(pl);
+      return r;
+    }
+
+    r = <INTERNAL_PREFIX>_server_send_payload_async(<SERVER_H>, <PEER_H>, pl, NULL, NULL);
+    if (r != MQTT_PLUGIN_ERROR_NONE) {
+      _E("Failed to <INTERNAL_PREFIX>_server_send_payload_async : %d - %s", r, value);
+      <INTERNAL_PREFIX>_payload_destroy(pl);
+      return r;
+    }
+
+    <INTERNAL_PREFIX>_payload_destroy(pl);
+)__c_cb";
+
+constexpr const char __SERVER_REGISTER[] =
+R"__c_cb(
+
+  ret = <INTERNAL_PREFIX>_server_create(&__<NAME>.stub, service_name, display_name, broker_ip, broker_port, user_name, password);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to create stub handle. error(%d)", ret);
+    <PREFIX>_<NAME>_unregister();
+    return ret;
+  }
+
+  ret = <INTERNAL_PREFIX>_server_add_connection_result_cb(__<NAME>.stub, __<PREFIX>_<NAME>_connection_result_cb, &__<NAME>);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to add connection result event callback");
+    <PREFIX>_<NAME>_unregister();
+    return ret;
+  }
+
+  ret = <INTERNAL_PREFIX>_server_add_payload_received_cb(__<NAME>.stub, __<PREFIX>_<NAME>_payload_received_cb, &__<NAME>);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to add payload recieved event callback");
+    <PREFIX>_<NAME>_unregister();
+    return ret;
+  }
+
+  ret = <INTERNAL_PREFIX>_server_add_disconnected_cb(__<NAME>.stub, __<PREFIX>_<NAME>_disconnected_cb, &__<NAME>);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to add disconnected event callback");
+    <PREFIX>_<NAME>_unregister();
+    return ret;
+  }
+
+  ret = <INTERNAL_PREFIX>_server_set_data_received_cb(__<NAME>.stub, __<PREFIX>_<NAME>_data_received_cb, &__<NAME>);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to add data recieved event callback");
+    <PREFIX>_<NAME>_unregister();
+    return ret;
+  }
+
+  ret = <INTERNAL_PREFIX>_server_listen(__<NAME>.stub, __<PREFIX>_<NAME>_connection_request_cb, &__<NAME>);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to listen events. error(%d)", ret);
+    <PREFIX>_<NAME>_unregister();
+    return ret;
+  }
+)__c_cb";
+
+constexpr const char __SERVER_UNREGISTER[] =
+R"__c_cb(
+  if (__<NAME>.stub) {
+    <INTERNAL_PREFIX>_server_destroy(__<NAME>.stub);
+    __<NAME>.stub = nullptr;
+  }
+)__c_cb";
+
+constexpr const char __SERVER_ACCEPT[] =
+R"__c_cb(
+  ret = <INTERNAL_PREFIX>_server_accept(__<NAME>.stub, peer_info);
+  if (ret != MQTT_PLUGIN_ERROR_NONE)
+    _E("Failed to accept. error(%d)", ret);
+)__c_cb";
+
+constexpr const char __SERVER_REJECT[] =
+R"__c_cb(
+  ret = <INTERNAL_PREFIX>_server_reject(__<NAME>.stub, peer_info, reason);
+  if (ret != MQTT_PLUGIN_ERROR_NONE)
+    _E("Failed to reject. error(%d)", ret);
+)__c_cb";
+
+constexpr const char __SERVER_SET_DISPLAY_NAME[] =
+R"__c_cb(
+  ret = <INTERNAL_PREFIX>_server_set_display_name(__<NAME>.stub, display_name);
+  if (ret != MQTT_PLUGIN_ERROR_NONE)
+    _E("Failed to set display name. error(%d)", ret);
+)__c_cb";
+
+constexpr const char __CLIENT_TRY_CONNECT[] =
+R"__c_cb(
+  ret = <INTERNAL_PREFIX>_client_connect(<CLIENT>, <PEER>);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to connect to stub. error(%d)", ret);
+    return ret;
+  }
+)__c_cb";
+
+constexpr const char __CLIENT_DISCONNECT[] =
+R"__c_cb(
+  ret = <INTERNAL_PREFIX>_client_disconnect(<CLIENT>);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to disconnect to stub. error(%d)", ret);
+    return ret;
+  }
+)__c_cb";
+
+constexpr const char __CLIENT_TRY_DISCOVERY[] =
+R"__c_cb(
+  ret = <INTERNAL_PREFIX>_client_try_discovery(<CLIENT>, __<PREFIX>_<NAME>_discovered, h);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to discovery to stub. error(%d)", ret);
+    return ret;
+  }
+)__c_cb";
+
+constexpr const char __CLIENT_STOP_DISCOVERY[] =
+R"__c_cb(
+  ret = <INTERNAL_PREFIX>_client_stop_discovery(<CLIENT>);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to stop discovery to stub. error(%d)", ret);
+    return ret;
+  }
+)__c_cb";
+
+constexpr const char __CLIENT_SEND_ASYNC[] =
+R"__c_cb(
+  res_ = <INTERNAL_PREFIX>_payload_create(&<PAYLOAD>, MQTT_PLUGIN_PAYLOAD_TYPE_DATA);
+  if (res_ != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", res_);
+    <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
+    goto out;
+  }
+
+  res_ = <INTERNAL_PREFIX>_payload_set_data(<PAYLOAD>, (const unsigned char*)data_, <SIZE>);
+  if (res_ != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_payload_set_data : %d", res_);
+    <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
+    goto out;
+  }
+
+  res_ = <INTERNAL_PREFIX>_client_send_payload_async(<CLIENT>, <PAYLOAD>, NULL, NULL);
+  <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
+  if (res_ != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_client_send_payload_async : %d", res_);
+    goto out;
+  }
+)__c_cb";
+
+constexpr const char __CLIENT_SEND[] =
+R"__c_cb(
+  res_ = <INTERNAL_PREFIX>_client_send_data(<CLIENT>, <DATA>, <DATA_SIZE> , 5 * 1000, &<RET_DATA>, &<RET_DATA_SIZE>);
+  if (res_ != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to send parcel. error(%d)", res_);
+    goto out;
+  }
+)__c_cb";
+
+constexpr const char __SERVER_SEND_ASYNC[] =
+R"__c_cb(
+  ret_ = <INTERNAL_PREFIX>_payload_create(&<PAYLOAD>, MQTT_PLUGIN_PAYLOAD_TYPE_DATA);
+  if (ret_ != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret_);
+    <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
+    goto out;
+  }
+
+  ret_ = <INTERNAL_PREFIX>_payload_set_data(<PAYLOAD>, (const unsigned char*)data_, <SIZE>);
+  if (ret_ != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_payload_set_data : %d", ret_);
+    <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
+    goto out;
+  }
+
+  ret_ = <INTERNAL_PREFIX>_server_send_payload_async(<SERVER>, peer_info, <PAYLOAD>, NULL, NULL);
+  <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
+  if (ret_ != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_client_send_payload_async : %d", ret_);
+    goto out;
+  }
+)__c_cb";
+
+constexpr const char __GROUP_PUBLISH[] =
+R"__c_cb(
+  res_ = <INTERNAL_PREFIX>_payload_create(&pl_, MQTT_PLUGIN_PAYLOAD_TYPE_DATA);
+  if (res_ != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", res_);
+    <INTERNAL_PREFIX>_payload_destroy(pl_);
+    goto out;
+  }
+
+  res_ = <INTERNAL_PREFIX>_payload_set_data(pl_, (const unsigned char*)data_, data_size_);
+  if (res_ != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_payload_set_data : %d", res_);
+    <INTERNAL_PREFIX>_payload_destroy(pl_);
+    goto out;
+  }
+
+  res_ = <INTERNAL_PREFIX>_group_publish(h->group, pl_);
+  <INTERNAL_PREFIX>_payload_destroy(pl_);
+  if (res_ != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_group_publish : %d", res_);
+    goto out;
+  }
+)__c_cb";
+
+constexpr const char __CLIENT_CREATE[] =
+R"__c_cb(
+  ret = <INTERNAL_PREFIX>_client_create(&handle->client, service_name, broker_ip, broker_port, user_name, password);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to create proxy handle. error(%d)", ret);
+    <PREFIX>_<NAME>_destroy(handle);
+    return ret;
+  }
+
+  handle->callback = *callback;
+  handle->user_data = user_data;
+
+  ret = <INTERNAL_PREFIX>_client_add_connection_result_cb(handle->client, __<PREFIX>_<NAME>_connection_result, handle);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to add connection result cb. error(%d)", ret);
+    <PREFIX>_<NAME>_destroy(handle);
+    return ret;
+  }
+
+  ret = <INTERNAL_PREFIX>_client_add_disconnected_cb(handle->client, __<PREFIX>_<NAME>_disconnected, handle);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to add disconnected event cb. error(%d)", ret);
+    <PREFIX>_<NAME>_destroy(handle);
+    return ret;
+  }
+
+  ret = <INTERNAL_PREFIX>_client_add_payload_received_cb(handle->client, __<PREFIX>_<NAME>_received, handle);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to add received event cb. error(%d)", ret);
+    <PREFIX>_<NAME>_destroy(handle);
+    return ret;
+  }
+)__c_cb";
+
+constexpr const char __GROUP_CREATE[] =
+R"__c_cb(
+  ret = <INTERNAL_PREFIX>_group_create(&handle->group, topic_name, broker_ip, broker_port, user_name, password);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to create group handle. error(%d)", ret);
+    <PREFIX>_<NAME>_destroy(handle);
+    return ret;
+  }
+
+  handle->callback = *callback;
+  handle->user_data = user_data;
+
+  ret = <INTERNAL_PREFIX>_group_add_joined_cb(handle->group, __<PREFIX>_<NAME>_joined_cb, handle);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to add connection result cb. error(%d)", ret);
+    <PREFIX>_<NAME>_destroy(handle);
+    return ret;
+  }
+
+  ret = <INTERNAL_PREFIX>_group_add_left_cb(handle->group, __<PREFIX>_<NAME>_left_cb, handle);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to add disconnected event cb. error(%d)", ret);
+    <PREFIX>_<NAME>_destroy(handle);
+    return ret;
+  }
+
+  ret = <INTERNAL_PREFIX>_group_add_payload_received_cb(handle->group, __<PREFIX>_<NAME>_received, handle);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to add received event cb. error(%d)", ret);
+    <PREFIX>_<NAME>_destroy(handle);
+    return ret;
+  }
+
+  ret = <INTERNAL_PREFIX>_group_subscribe(handle->group);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to subscribe event. error(%d)", ret);
+    <PREFIX>_<NAME>_destroy(handle);
+    return ret;
+  }
+
+  *h = handle;
+)__c_cb";
+
+constexpr const char __GROUP_DESTROY[] =
+R"__c_cb(
+  if (h->group) {
+    <INTERNAL_PREFIX>_group_unsubscribe(h->group);
+    <INTERNAL_PREFIX>_group_destroy(h->group);
+  }
+)__c_cb";
+
+constexpr const char __CLIENT_DESTROY[] =
+R"__c_cb(
+  if (h->client)
+    <INTERNAL_PREFIX>_client_destroy(h->client);
+)__c_cb";
+
+constexpr const char __PEER_INFO_CLONE[] =
+    "<INTERNAL_PREFIX>_peer_info_clone(<SRC_PEER>, <DEST_PEER>);";
+
+constexpr const char __SERVER_FOREACH_CONNECTED_PEER_INFO[] =
+    "<INTERNAL_PREFIX>_server_foreach_connected_peer_info(__<NAME>.stub, callback, user_data);";
+
+constexpr const char __SERVER_SET_ONDEMAND_LAUNCH_ENABLED[] =
+R"__c_cb(
+  int ret;
+
+  ret = <INTERNAL_PREFIX>_server_set_on_demand_launch_enabled(__<NAME>.stub, enable);
+  if (ret != MQTT_PLUGIN_ERROR_NONE)
+    _E("Failed to set ondemand launch enable. error(%d)", ret);
+
+  return ret;
+)__c_cb";
+
+constexpr const char __COMMON_HEADER_HANDLES[] =
+R"__c_cb(
+
+typedef enum _<MODULE_PREFIX>_error {
+  MQTT_PLUGIN_ERROR_NONE = TIZEN_ERROR_NONE, /**< Success */
+  MQTT_PLUGIN_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
+  MQTT_PLUGIN_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+  MQTT_PLUGIN_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+  MQTT_PLUGIN_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+  MQTT_PLUGIN_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Function not implemented */
+  MQTT_PLUGIN_ERROR_ALREADY_IN_PROGRESS = TIZEN_ERROR_ALREADY_IN_PROGRESS, /**< Already in progress */
+  MQTT_PLUGIN_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
+  MQTT_PLUGIN_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< Timed out */
+  MQTT_PLUGIN_ERROR_OPERATION_FAILED = TIZEN_ERROR_CION | 0x01, /**< Operation failed */
+} <MODULE_PREFIX>_error_e;
+
+enum MqttProtocol {
+  MQTT_TYPE_MQTT = (0x1 << 0),   // Publish message through the MQTT
+  MQTT_TYPE_TCP = (0x1 << 1),   // Publish message to peers using the TCP
+  MQTT_TYPE_UDP = (0x1 << 2),   // Publish message to peers using the UDP
+  MQTT_TYPE_SRTP = (0x1 << 3),   // Publish message to peers using the SRTP
+  MQTT_TYPE_WEBRTC = (0x1 << 4),  // Publish message to peers using the WEBRTC
+};
+
+/**
+  * @brief The mqtt plugin peer info handle.
+  */
+typedef void *<MODULE_PREFIX>_peer_info_h;
+
+)__c_cb";
+
+constexpr const char __COMMON_HEADER_CONNECTION_RESULT_HANDLE[] =
+R"__c_cb(
+typedef enum _mqtt_connection_status_e {
+  MQTT_PLUGIN_CONNECTION_STATUS_OK, /**< Connection is ok **/
+  MQTT_PLUGIN_CONNECTION_STATUS_REJECTED, /**< Connection is rejected **/
+  MQTT_PLUGIN_CONNECTION_STATUS_ERROR, /**< Connection error occurs **/
+} <MODULE_PREFIX>_connection_status_e;
+
+/**
+ * @brief The Mqtt plugin connection result handle.
+ */
+typedef void *<MODULE_PREFIX>_connection_result_h;
+)__c_cb";
+
+constexpr const char __COMMON_HEADER_PAYLOAD_HANDLE[] =
+R"__c_cb(
+/**
+ * @brief Enumeration for <MODULE_PREFIX>_payload transfer status types.
+ */
+typedef enum _payload_transfer_status_e {
+  MQTT_PLUGIN_PAYLOAD_TRANSFER_STATUS_SUCCESS, /**< Transfer is success **/
+  MQTT_PLUGIN_PAYLOAD_TRANSFER_STATUS_FAILURE, /**< Transfer is failed **/
+  MQTT_PLUGIN_PAYLOAD_TRANSFER_STATUS_IN_PROGRESS, /**< Transfer is in progress **/
+} <MODULE_PREFIX>_payload_transfer_status_e;
+
+/**
+  * @brief The <MODULE_PREFIX>_payload handle.
+  */
+ typedef void *<MODULE_PREFIX>_payload_h;
+
+)__c_cb";
+
+constexpr const char __COMMON_HEADER_PAYLOAD_BASE[] =
+R"__c_cb(
+/**
+  * @brief Saves the payload as a file.
+  * @remarks The @a path is absolute path.
+  * @remarks If the media storage is used, %http://tizen.org/privilege/mediastorage privilege is necessary. \n
+  *          If the external storage is used, %http://tizen.org/privilege/externalstorage privilege is necessary.
+  * @param[in] payload The <MODULE_PREFIX>_payload handle
+  * @param[in] path The path of file
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_PERMISSION_DENIED Permission denied
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OPERATION_FAILED Operation failed
+  */
+int <MODULE_PREFIX>_payload_save_as_file(<MODULE_PREFIX>_payload_h payload, const char *path);
+
+/**
+  * @brief Gets the name of received file from the payload.
+  * @remarks @a file_name must be released using free().
+  * @param[in] payload The <MODULE_PREFIX>_payload handle
+  * @param[out] file_name The name of file
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+
+int <MODULE_PREFIX>_payload_get_received_file_name(<MODULE_PREFIX>_payload_h payload,
+    char **file_name);
+
+/**
+  * @brief Gets the size of currently received file from the payload.
+  * @param[in] payload The <MODULE_PREFIX>_payload handle
+  * @param[out] bytes The size of file
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  */
+int <MODULE_PREFIX>_payload_get_received_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes);
+
+/**
+  * @brief Gets the total size of file from the payload.
+  * @param[in] payload The <MODULE_PREFIX>_payload handle
+  * @param[out] bytes The size of file
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  */
+int <MODULE_PREFIX>_payload_get_total_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes);
+)__c_cb";
+
+constexpr const char __COMMON_HEADER_COMMON_BASE[] =
+R"__c_cb(
+/**
+  * @brief Creates a clone of mqtt plugin peer info handle.
+  * @remarks @a peer_info_clone must be released using <MODULE_PREFIX>_peer_info_destroy().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] peer_info_clone The cloned peer information handle
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  * @retval #MQTT_PLUGIN_ERROR_IO_ERROR IO error
+  * @see <MODULE_PREFIX>_peer_info_destroy()
+  */
+int <MODULE_PREFIX>_peer_info_clone(const <MODULE_PREFIX>_peer_info_h peer_info,
+    <MODULE_PREFIX>_peer_info_h *peer_info_clone);
+
+/**
+  * @brief Destroys the peer info handle and releases all its resources.
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @see <MODULE_PREFIX>_peer_info_clone()
+  */
+int <MODULE_PREFIX>_peer_info_destroy(<MODULE_PREFIX>_peer_info_h peer_info);
+
+/**
+  * @brief Gets the device ID.
+  * @remarks @a device_id must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] device_id The device ID
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_device_id(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_id);
+
+/**
+  * @brief Gets the device name.
+  * @remarks @a device_name must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] device_name The device name
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_device_name(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_name);
+
+/**
+  * @brief Gets the device's platform.
+  * @remarks @a device_platform must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] device_platform The platform name
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_device_platform(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_platform);
+
+/**
+  * @brief Gets the device's platform version.
+  * @remarks @a device_platform_version must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] device_platform_version The platform version
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_device_platform_version(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_platform_version);
+
+/**
+  * @brief Gets the device's type.
+  * @remarks @a device_type must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] device_type Device type
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_device_type(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_type);
+
+/**
+  * @brief Gets application ID of peer.
+  * @remarks @a app_id must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] app_id The application ID
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_app_id(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **app_id);
+
+/**
+  * @brief Gets application version of peer.
+  * @remarks @a app_version must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] app_version The application version
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_app_version(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **app_version);
+
+/**
+  * @brief Gets UUID of peer.
+  * @remarks @a uuid must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] uuid The UUID
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_uuid(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **uuid);
+
+/**
+  * @brief Gets display name of peer.
+  * @details The custom name for service name. \n
+  *          It is possible that @a display_name does not exist.
+  * @remarks @a display_name must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] display_name The display name
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_display_name(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **display_name);
+)__c_cb";
+
+constexpr const char __COMMON_HEADER_CONNECTION_RESULT_BASE[] =
+R"__c_cb(
+/**
+ * @brief Gets the connection result status.
+ * @param[in] result The connection result handle
+ * @param[out] status Connection result status
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+ * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int <MODULE_PREFIX>_connection_result_get_status(const <MODULE_PREFIX>_connection_result_h result,
+         <MODULE_PREFIX>_connection_status_e *status);
+
+/**
+ * @brief Gets the connection result reason.
+ * @remarks @a reason must be released using free().
+ * @param[in] result The connection result handle
+ * @param[out] reason Connection result reason, should be freed after use
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+ * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int <MODULE_PREFIX>_connection_result_get_reason(const <MODULE_PREFIX>_connection_result_h result,
+        char **reason);
+)__c_cb";
+
+constexpr const char __COMMON_BODY_PEERINFO_BASE[] =
+R"__c_cb(
+int <MODULE_PREFIX>_peer_info_clone(const <MODULE_PREFIX>_peer_info_h peer_info,
+    <MODULE_PREFIX>_peer_info_h *peer_info_clone) {
+  return <INTERNAL_PREFIX>_peer_info_clone(peer_info, peer_info_clone);
+}
+
+int <MODULE_PREFIX>_peer_info_destroy(<MODULE_PREFIX>_peer_info_h peer_info) {
+  return <INTERNAL_PREFIX>_peer_info_destroy(peer_info);
+}
+
+int <MODULE_PREFIX>_peer_info_get_device_id(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_id) {
+  return <INTERNAL_PREFIX>_peer_info_get_device_id(peer_info, device_id);
+}
+
+int <MODULE_PREFIX>_peer_info_get_device_name(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_name) {
+  return <INTERNAL_PREFIX>_peer_info_get_device_name(peer_info, device_name);
+}
+
+int <MODULE_PREFIX>_peer_info_get_device_platform(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_platform) {
+  return <INTERNAL_PREFIX>_peer_info_get_device_platform(peer_info, device_platform);
+}
+
+int <MODULE_PREFIX>_peer_info_get_device_platform_version(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_platform_version) {
+  return <INTERNAL_PREFIX>_peer_info_get_device_platform_version(peer_info, device_platform_version);
+}
+
+int <MODULE_PREFIX>_peer_info_get_device_type(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_type) {
+  return <INTERNAL_PREFIX>_peer_info_get_device_type(peer_info, device_type);
+}
+
+int <MODULE_PREFIX>_peer_info_get_app_id(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **app_id) {
+  return <INTERNAL_PREFIX>_peer_info_get_app_id(peer_info, app_id);
+}
+
+int <MODULE_PREFIX>_peer_info_get_app_version(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **app_version) {
+  return <INTERNAL_PREFIX>_peer_info_get_app_version(peer_info,  app_version);
+}
+
+int <MODULE_PREFIX>_peer_info_get_uuid(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **uuid) {
+  return <INTERNAL_PREFIX>_peer_info_get_uuid(peer_info, uuid);
+}
+
+int <MODULE_PREFIX>_peer_info_get_display_name(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **display_name) {
+  return <INTERNAL_PREFIX>_peer_info_get_display_name(peer_info, display_name);
+}
+)__c_cb";
+
+/**
+ * <PREFIX> The prefix of the connection result.
+ */
+constexpr const char __COMMON_BODY_CONNECTION_RESULT_BASE[] =
+R"__c_cb(
+int <MODULE_PREFIX>_connection_result_get_status(const <MODULE_PREFIX>_connection_result_h result,
+    <MODULE_PREFIX>_connection_status_e *status) {
+  return <INTERNAL_PREFIX>_connection_result_get_status(result,(<INTERNAL_PREFIX>_connection_status_e *)status);
+}
+
+int <MODULE_PREFIX>_connection_result_get_reason(const <MODULE_PREFIX>_connection_result_h result,
+    char **reason) {
+  return <INTERNAL_PREFIX>_connection_result_get_reason(result, reason);
+}
+)__c_cb";
+
+/**
+ * <PREFIX> The prefix of the payload.
+ */
+constexpr const char __COMMON_BODY_PAYLOAD_BASE[] =
+R"__c_cb(
+int <MODULE_PREFIX>_payload_save_as_file(<MODULE_PREFIX>_payload_h payload, const char *path) {
+  return <INTERNAL_PREFIX>_payload_save_as_file(payload, path);
+}
+
+int <MODULE_PREFIX>_payload_get_received_file_name(<MODULE_PREFIX>_payload_h payload,
+    char **file_name) {
+  return <INTERNAL_PREFIX>_payload_get_received_file_name(payload, file_name);
+}
+
+int <MODULE_PREFIX>_payload_get_received_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes) {
+  return <INTERNAL_PREFIX>_payload_get_received_bytes( payload, bytes);
+}
+
+int <MODULE_PREFIX>_payload_get_total_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes) {
+  return <INTERNAL_PREFIX>_payload_get_total_bytes( payload, bytes);
+}
+)__c_cb";
+
+constexpr const char __INCLUDE_HEADER_DEF[] =
+R"__c_cb(
+#include <stdlib.h>
+#include <stdint.h>
+)__c_cb";
+
+constexpr const char __SERVER_HEADER_EXTRA[] =
+R"__c_cb(
+/**
+ * @brief Registers the set of the callback functions and the service_name.
+ * @details This function registers the set of the callback functions to handle stub events.
+ *          And, the <MODULE_PREFIX>_server_listen() is called internally to handle events.
+
+ * @privilege %http://tizen.org/privilege/d2d.datasharing \n
+ *            %http://tizen.org/privilege/internet
+ * @param[in] service_name The name of service
+ * @param[in] display_name The display name of service
+ * @param[in] broker_ip IP address of the broker to connect to
+ * @param[in] port The network port to connect to. Usually 1883
+ * @param[in] user_name The user name to connect to
+ * @param[in] password The Password to connect to
+ * @param[in] callback The set of callback functions to handle stub events
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #<ERROR_PREFIX>_ERROR_NONE Successful
+ * @retval #<ERROR_PREFIX>_ERROR_NOT_SUPPORTED Not supported
+ * @retval #<ERROR_PREFIX>_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #<ERROR_PREFIX>_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #<ERROR_PREFIX>_ERROR_IO_ERROR IO error
+ * @retval #<ERROR_PREFIX>_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #<ERROR_PREFIX>_ERROR_OPERATION_FAILED Operation failed
+ * @retval #<ERROR_PREFIX>_ERROR_PERMISSION_DENIED Permission denied
+ * @see <PREFIX>_<NAME>_unregister()
+ * @see #<PREFIX>_<NAME>_callback_s
+ */
+int <PREFIX>_<NAME>_register(const char *service_name, const char *display_name,
+    const char *broker_ip, int broker_port, const char *user_name,
+    const char *password, <PREFIX>_<NAME>_callback_s *callback, void *user_data);
+)__c_cb";
+
+constexpr const char __SERVER_BODY_EXTRA[] =
+R"__c_cb(
+int <PREFIX>_<NAME>_register(const char *service_name, const char *display_name,
+    const char *broker_ip, int broker_port, const char *user_name,
+    const char *password, <PREFIX>_<NAME>_callback_s *callback, void *user_data)
+)__c_cb";
+
+constexpr const char __CLIENT_HEADER_EXTRA[] =
+R"__c_cb(
+/**
+ * @brief Creates a <PREFIX>_<NAME> handle.
+ * @remarks The @a h handle should be released using
+ *          the <PREFIX>_<NAME>_destroy() if it's no longer needed.
+ * @privilege %http://tizen.org/privilege/d2d.datasharing \n
+ *            %http://tizen.org/privilege/internet
+ * @param[in] service_name The name of service
+ * @param[in] broker_ip IP address of the broker to connect to
+ * @param[in] port The network port to connect to. Usually 1883.
+ * @param[in] user_name The user name to connect to
+ * @param[in] password The Password to connect to
+ * @param[in] callback The set of callback functions to handle proxy events
+ * @param[in] user_data The user data to be passed to the callback function
+ * @param[out] h The <PREFIX>_<NAME> handle
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #<ERROR_PREFIX>_ERROR_NONE Successful
+ * @retval #<ERROR_PREFIX>_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #<ERROR_PREFIX>_ERROR_OUT_OF_MEMORY Out of memory
+ * @see <PREFIX>_<NAME>_destroy()
+ * @see #<PREFIX>_<NAME>_callback_s
+ */
+int <PREFIX>_<NAME>_create(const char *service_name, const char *broker_ip, int broker_port,
+    const char *user_name, const char *password,
+    <PREFIX>_<NAME>_callback_s *callback, void *user_data, <PREFIX>_<NAME>_h *h);
+)__c_cb";
+
+constexpr const char __CLIENT_BODY_EXTRA[] =
+R"__c_cb(
+int <PREFIX>_<NAME>_create(const char *service_name, const char *broker_ip, int broker_port,
+    const char *user_name, const char *password,
+    <PREFIX>_<NAME>_callback_s *callback, void *user_data, <PREFIX>_<NAME>_h *h)
+)__c_cb";
+
+
+constexpr const char __GROUP_HEADER_EXTRA[] =
+R"__c_cb(
+/**
+ * @brief Creates a <PREFIX>_<NAME> handle.
+ * @remarks The @a h handle should be released using
+ *          the <PREFIX>_<NAME>_destroy() if it's no longer needed.
+ *
+ * @privilege %http://tizen.org/privilege/d2d.datasharing
+ *            %http://tizen.org/privilege/internet
+ * @param[in] topic_name topic_name The name of topic
+ * @param[in] broker_ip IP address of the broker to connect to
+ * @param[in] port The network port to connect to. Usually 1883.
+ * @param[in] user_name The user name to connect to
+ * @param[in] password The Password to connect to
+ * @param[in] callback The set of callback functions to handle events
+ * @param[in] user_data The user data to be passed to the callback function
+ * @param[out] h The <PREFIX>_<NAME> handle
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+ * @retval #MQTT_PLUGIN_ERROR_NOT_SUPPORTED Not supported
+ * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MQTT_PLUGIN_ERROR_PERMISSION_DENIED Permission denied
+
+ * @see <PREFIX>_<NAME>_destroy()
+ * @see #<PREFIX>_<NAME>_callback_s
+ */
+int <PREFIX>_<NAME>_create(const char *topic_name, const char *broker_ip, int broker_port,
+    const char *user_name, const char *password,
+    <PREFIX>_<NAME>_callback_s *callback, void *user_data, <PREFIX>_<NAME>_h *h);
+)__c_cb";
+
+constexpr const char __GROUP_BODY_EXTRA[] =
+R"__c_cb(
+int <PREFIX>_<NAME>_create(const char *topic_name, const char *broker_ip, int broker_port,
+    const char *user_name, const char *password,
+    <PREFIX>_<NAME>_callback_s *callback, void *user_data, <PREFIX>_<NAME>_h *h)
+)__c_cb";
+
+
+}  // namespace
+
+namespace tidl {
+
+std::string MqttPluginCTransportable::GenInclude(bool body, int type) const {
+  if (!body)
+    return __INCLUDE_HEADER_DEF;
+  else
+    return "#include \"<FILENAME>_internal.h\"";
+}
+
+std::string MqttPluginCTransportable::GenHeaderBase() const {
+  return __COMMON_HEADER_COMMON_BASE;
+}
+
+std::string MqttPluginCTransportable::GenHeaderPayloadHandle() const {
+  return __COMMON_HEADER_PAYLOAD_HANDLE;
+}
+
+std::string MqttPluginCTransportable::GenHeaderCommonHandle() const {
+  return __COMMON_HEADER_HANDLES;
+}
+
+std::string MqttPluginCTransportable::GenHeaderConnectionHandle() const {
+  return __COMMON_HEADER_CONNECTION_RESULT_HANDLE;
+}
+
+std::string MqttPluginCTransportable::GenHeaderPayloadBase() const {
+  return __COMMON_HEADER_PAYLOAD_BASE;
+}
+
+std::string MqttPluginCTransportable::GenHeaderConnectionBase() const {
+  return __COMMON_HEADER_CONNECTION_RESULT_BASE;
+}
+
+std::string MqttPluginCTransportable::GenBodyPayloadBase() const {
+  return __COMMON_BODY_PAYLOAD_BASE;
+}
+
+std::string MqttPluginCTransportable::GenBodyConnectionBase() const {
+  return __COMMON_BODY_CONNECTION_RESULT_BASE;
+}
+
+std::string MqttPluginCTransportable::GenBodyPeerInfoBase() const {
+  return __COMMON_BODY_PEERINFO_BASE;
+}
+
+std::string MqttPluginCTransportable::GenProxyPrefix() const {
+  return "mqtt_plugin_proxy";
+}
+
+std::string MqttPluginCTransportable::GenStubPrefix() const {
+  return "mqtt_plugin_stub";
+}
+
+std::string MqttPluginCTransportable::GenGroupPrefix() const {
+  return "mqtt_plugin_group";
+}
+
+std::string MqttPluginCTransportable::GenModulePrefix() const {
+  return "mqtt_plugin";
+}
+
+std::string MqttPluginCTransportable::GenErrorPrefix() const {
+  return "MQTT_PLUGIN";
+}
+
+std::string MqttPluginCTransportable::GenServerExtra(bool body) const {
+  if (body)
+    return __SERVER_BODY_EXTRA;
+  else
+    return __SERVER_HEADER_EXTRA;
+}
+
+std::string MqttPluginCTransportable::GenClientExtra(bool body) const {
+  if (body)
+    return __CLIENT_BODY_EXTRA;
+  else
+    return __CLIENT_HEADER_EXTRA;
+}
+
+std::string MqttPluginCTransportable::GenGroupExtra(bool body) const {
+  if (body)
+    return __GROUP_BODY_EXTRA;
+  else
+    return __GROUP_HEADER_EXTRA;
+}
+
+std::string MqttPluginCTransportable::GenClientSendAsync(std::string client,
+    std::string payload, std::string size) const {
+  return std::string(ReplaceAll(__CLIENT_SEND_ASYNC, {
+      { "<CLIENT>", client },
+      { "<PAYLOAD>", payload},
+      { "<SIZE>", size} }));
+}
+
+std::string MqttPluginCTransportable::GenClientSend(std::string client,
+    std::string data, std::string data_size,
+    std::string ret_data, std::string ret_data_size) const {
+  return std::string(ReplaceAll(__CLIENT_SEND, {
+      { "<CLIENT>", client },
+      { "<DATA>", data},
+      { "<DATA_SIZE>", data_size},
+      { "<RET_DATA>", ret_data},
+      { "<RET_DATA_SIZE>", ret_data_size} }));
+}
+
+std::string MqttPluginCTransportable::GenServerSendAsync(std::string server,
+    std::string client,
+    std::string payload, std::string size) const {
+  return std::string(ReplaceAll(__SERVER_SEND_ASYNC, {
+      { "<SERVER>", server },
+      { "<CLIENT>", client},
+      { "<PAYLOAD>", payload},
+      { "<SIZE>", size} }));
+}
+
+std::string MqttPluginCTransportable::GenServerFileSend(std::string path,
+    std::string server, std::string peer) const {
+  return std::string(ReplaceAll(__SERVER_FILE_SEND, {
+      { "<FILE_PATH>", path },
+      { "<SERVER_H>", server },
+      { "<PEER_H>", peer } }));
+}
+
+std::string MqttPluginCTransportable::GenClientFileSend(std::string path,
+    std::string client) const {
+  return std::string(ReplaceAll(__CLINET_FILE_SEND, {
+      { "<FILE_PATH>", path },
+      { "<CLIENT_H>", client } }));
+}
+
+std::string MqttPluginCTransportable::GenGroupType() const {
+  return "<INTERNAL_PREFIX>_group_h";
+}
+
+std::string MqttPluginCTransportable::GenPayloadTransferStatusType(bool internal_type) const {
+  if (internal_type)
+    return "<INTERNAL_PREFIX>_transfer_status_e";
+  else
+    return "<MODULE_PREFIX>_payload_transfer_status_e";
+}
+
+std::string MqttPluginCTransportable::GenPeerInfoType() const {
+  return "<MODULE_PREFIX>_peer_info_h";
+}
+
+std::string MqttPluginCTransportable::GenPeerInfoDestroy(std::string peer) const {
+  return std::string(ReplaceAll("<MODULE_PREFIX>_peer_info_destroy(<PEER>);", {
+      { "<PEER>", peer } }));
+}
+
+std::string MqttPluginCTransportable::GenPayloadType(bool internal_type) const {
+  if (internal_type)
+  return "<INTERNAL_PREFIX>_payload_h";
+  else
+  return "<MODULE_PREFIX>_payload_h";
+}
+
+std::string MqttPluginCTransportable::GenClientType() const {
+  return "<INTERNAL_PREFIX>_client_h";
+}
+
+std::string MqttPluginCTransportable::GenSecurityType(bool definition) const {
+  return "";
+}
+
+std::string MqttPluginCTransportable::GenServerType() const {
+  return "<INTERNAL_PREFIX>_server_h";
+}
+
+std::string MqttPluginCTransportable::GenClientTryConnect(std::string client,
+    std::string peer) const {
+  return std::string(ReplaceAll(__CLIENT_TRY_CONNECT, {
+      { "<CLIENT>", client },
+      { "<PEER>", peer } }));
+}
+
+std::string MqttPluginCTransportable::GenClientDisconnect(
+    std::string client) const {
+  return std::string(ReplaceAll(__CLIENT_DISCONNECT, {
+      { "<CLIENT>", client } }));
+}
+
+std::string MqttPluginCTransportable::GenClientTryDiscovery(
+    std::string client) const {
+  return std::string(ReplaceAll(__CLIENT_TRY_DISCOVERY, {
+      { "<CLIENT>", client } }));
+}
+
+std::string MqttPluginCTransportable::GenClientStopDiscovery(
+    std::string client) const {
+  return std::string(ReplaceAll(__CLIENT_STOP_DISCOVERY, {
+      { "<CLIENT>", client } }));
+}
+
+std::string MqttPluginCTransportable::GenServerRegister() const {
+  return __SERVER_REGISTER;
+}
+
+std::string MqttPluginCTransportable::GenServerUnregister() const {
+  return __SERVER_UNREGISTER;
+}
+
+std::string MqttPluginCTransportable::GenClientExtraHeader() const {
+  return "";
+}
+
+std::string MqttPluginCTransportable::GenClientExtraBody() const {
+  return "";
+}
+
+std::string MqttPluginCTransportable::GenServerExtraHeader() const {
+  return "";
+}
+
+std::string MqttPluginCTransportable::GenServerExtraBody() const {
+  return "";
+}
+
+std::string MqttPluginCTransportable::GenServerAccept() const {
+  return __SERVER_ACCEPT;
+}
+
+std::string MqttPluginCTransportable::GenServerReject() const {
+  return __SERVER_REJECT;
+}
+
+std::string MqttPluginCTransportable::GenServerSetDisplayName() const {
+  return __SERVER_SET_DISPLAY_NAME;
+}
+
+std::string MqttPluginCTransportable::GenGroupPublish() const {
+  return __GROUP_PUBLISH;
+}
+
+std::string MqttPluginCTransportable::GenPayloadTypeEnum() const {
+  return "<INTERNAL_PREFIX>_payload_type_e";
+}
+
+std::string MqttPluginCTransportable::GenPayloadTypeData() const {
+  return "MQTT_PLUGIN_PAYLOAD_TYPE_DATA";
+}
+
+std::string MqttPluginCTransportable::GenPayloadTypeFile() const {
+  return "MQTT_PLUGIN_PAYLOAD_TYPE_FILE";
+}
+
+std::string MqttPluginCTransportable::GenPayloadGetType() const {
+  return "ret = <INTERNAL_PREFIX>_payload_get_type(payload, &type);";
+}
+
+std::string MqttPluginCTransportable::GenErrorNone() const {
+  return "MQTT_PLUGIN_ERROR_NONE";
+}
+
+std::string MqttPluginCTransportable::GenPayloadGetData() const {
+  return "ret = <INTERNAL_PREFIX>_payload_get_data(payload, &data, &data_len);";
+}
+
+std::string MqttPluginCTransportable::GenClientCreate() const {
+  return __CLIENT_CREATE;
+}
+
+std::string MqttPluginCTransportable::GenGroupCreate() const {
+  return __GROUP_CREATE;
+}
+
+std::string MqttPluginCTransportable::GenGroupDestroy() const {
+  return __GROUP_DESTROY;
+}
+
+std::string MqttPluginCTransportable::GenClientDestroy() const {
+  return __CLIENT_DESTROY;
+}
+
+std::string MqttPluginCTransportable::GenSetSecurityCA(std::string arg) const {
+  return "";
+}
+
+std::string MqttPluginCTransportable::GenSetSecurityCert(std::string arg) const {
+  return "";
+}
+
+std::string MqttPluginCTransportable::GenSetSecurityPrivateKey(std::string arg) const {
+  return "";
+}
+
+std::string MqttPluginCTransportable::GenPeerInfoClone(std::string src_peer,
+      std::string dest_peer) const {
+  return std::string(ReplaceAll(__PEER_INFO_CLONE, {
+      { "<SRC_PEER>", src_peer },
+      { "<DEST_PEER>", dest_peer } }));
+}
+
+std::string MqttPluginCTransportable::GenServerForeachConnectedPeerInfo(
+    std::string name) const {
+  return std::string(ReplaceAll(__SERVER_FOREACH_CONNECTED_PEER_INFO, {
+      { "<NAME>", name } }));
+}
+
+}  // namespace tidl
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_c_transportable.h b/idlc/gen_mqtt_plugin/mqtt_plugin_c_transportable.h
new file mode 100644 (file)
index 0000000..c88010f
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_GEN_MQTT_PLUGIN_C_TRANSPORTABLE_H_
+#define IDLC_GEN_MQTT_PLUGIN_C_TRANSPORTABLE_H_
+
+#include <string>
+
+#include "idlc/gen_cion/c_transportable.h"
+
+namespace tidl {
+
+class MqttPluginCTransportable : public CTransportable {
+ public:
+  virtual ~MqttPluginCTransportable() = default;
+  std::string GenInclude(bool body = true, int type = 0) const override;
+  std::string GenHeaderBase() const override;
+  std::string GenHeaderPayloadHandle() const override;
+  std::string GenHeaderCommonHandle() const override;
+  std::string GenHeaderConnectionHandle() const override;
+  std::string GenHeaderPayloadBase() const override;
+  std::string GenHeaderConnectionBase() const override;
+  std::string GenBodyPayloadBase() const override;
+  std::string GenBodyConnectionBase() const override;
+  std::string GenBodyPeerInfoBase() const override;
+  std::string GenProxyPrefix() const override;
+  std::string GenStubPrefix() const override;
+  std::string GenGroupPrefix() const override;
+  std::string GenModulePrefix() const override;
+  std::string GenErrorPrefix() const override;
+  std::string GenServerExtra(bool body = true) const override;
+  std::string GenClientExtra(bool body = true) const override;
+  std::string GenGroupExtra(bool body = true) const override;
+  std::string GenClientSendAsync(std::string client,
+      std::string payload, std::string size) const override;
+  std::string GenClientSend(std::string client, std::string data,
+      std::string data_size, std::string ret_data,
+      std::string ret_data_size) const override;
+  std::string GenServerSendAsync(std::string server, std::string client,
+      std::string payload, std::string size) const override;
+  std::string GenServerFileSend(std::string path,
+      std::string server, std::string peer) const override;
+  std::string GenClientFileSend(std::string path,
+      std::string client) const override;
+  std::string GenGroupType() const override;
+  std::string GenPayloadTransferStatusType(bool internal_type = false) const override;
+  std::string GenPeerInfoType() const override;
+  std::string GenPeerInfoDestroy(std::string peer) const override;
+  std::string GenPayloadType(bool internal_type = false) const override;
+  std::string GenClientType() const override;
+  std::string GenSecurityType(bool definition = true) const override;
+  std::string GenServerType() const override;
+  std::string GenClientTryConnect(std::string client,
+      std::string peer) const override;
+  std::string GenClientDisconnect(std::string client) const override;
+  std::string GenClientTryDiscovery(std::string client) const override;
+  std::string GenClientStopDiscovery(std::string client) const override;
+  std::string GenServerRegister() const override;
+  std::string GenServerUnregister() const override;
+  std::string GenClientExtraHeader() const override;
+  std::string GenClientExtraBody() const override;
+  std::string GenServerExtraHeader() const override;
+  std::string GenServerExtraBody() const override;
+  std::string GenServerAccept() const override;
+  std::string GenServerReject() const override;
+  std::string GenServerSetDisplayName() const override;
+  std::string GenGroupPublish() const override;
+  std::string GenPayloadTypeEnum() const override;
+  std::string GenPayloadTypeData() const override;
+  std::string GenPayloadTypeFile() const override;
+  std::string GenPayloadGetType() const override;
+  std::string GenErrorNone() const override;
+  std::string GenPayloadGetData() const override;
+  std::string GenClientCreate() const override;
+  std::string GenGroupCreate() const override;
+  std::string GenGroupDestroy() const override;
+  std::string GenClientDestroy() const override;
+  std::string GenSetSecurityCA(std::string arg) const override;
+  std::string GenSetSecurityCert(std::string arg) const override;
+  std::string GenSetSecurityPrivateKey(std::string arg) const override;
+  std::string GenPeerInfoClone(std::string src_peer,
+      std::string dest_peer) const override;
+  std::string GenServerForeachConnectedPeerInfo(std::string name) const override;
+};
+
+}  // namespace tidl
+
+#endif  // IDLC_GEN_MQTT_PLUGIN_C_TRANSPORTABLE_H_
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_cpp_transportable.cc b/idlc/gen_mqtt_plugin/mqtt_plugin_cpp_transportable.cc
new file mode 100644 (file)
index 0000000..3cbad61
--- /dev/null
@@ -0,0 +1,1189 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_cpp_transportable.h"
+
+#include <utility>
+
+#include "idlc/gen/replace_all.h"
+
+namespace {
+
+constexpr const char __CLINET_FILE_SEND[] =
+R"__cpp_cb(<PAYLOAD_T> pl;
+  int ret = <INTERNAL_PREFIX>_payload_create(&pl, MQTT_PLUGIN_PAYLOAD_TYPE_FILE);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret);
+    return;
+  }
+
+  ret = <INTERNAL_PREFIX>_payload_set_file_path(pl, <FILE_PATH>.c_str());
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_payload_set_file_path : %d - %s", ret, <FILE_PATH>.c_str());
+    <INTERNAL_PREFIX>_payload_destroy(pl);
+    return;
+  }
+
+  ret = <INTERNAL_PREFIX>_client_send_payload_async(<CLIENT_H>, pl, nullptr, nullptr);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_client_send_payload_async : %d", ret);
+    <INTERNAL_PREFIX>_payload_destroy(pl);
+    return;
+  }
+
+  <INTERNAL_PREFIX>_payload_destroy(pl);
+)__cpp_cb";
+
+constexpr const char __SERVER_FILE_SEND[] =
+R"__cpp_cb(<PAYLOAD_T> pl;
+  int ret = <INTERNAL_PREFIX>_payload_create(&pl, MQTT_PLUGIN_PAYLOAD_TYPE_FILE);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret);
+    return;
+  }
+
+  ret = <INTERNAL_PREFIX>_payload_set_file_path(pl, <FILE_PATH>.c_str());
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_payload_set_file_path : %d - %s", ret, <FILE_PATH>.c_str());
+    <INTERNAL_PREFIX>_payload_destroy(pl);
+    return;
+  }
+
+  ret = <INTERNAL_PREFIX>_server_send_payload_async(<SERVER_H>, <PEER_H>, pl, nullptr, nullptr);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_server_send_payload_async : %d", ret);
+    <INTERNAL_PREFIX>_payload_destroy(pl);
+    return;
+  }
+
+  <INTERNAL_PREFIX>_payload_destroy(pl);
+)__cpp_cb";
+
+constexpr const char __SERVER_REGISTER[] =
+R"__cpp_cb(<SERVER_T> server;
+  int ret = <INTERNAL_PREFIX>_server_create(&server, service_name.c_str(),
+      display_name.c_str(), broker_ip.c_str(), broker_port, user_name.c_str(), password.c_str());
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to create handle. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  ret = <INTERNAL_PREFIX>_server_add_connection_result_cb(server, OnConnectionResultCB,
+      this);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_server_add_connection_result_cb. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  ret = <INTERNAL_PREFIX>_server_add_payload_received_cb(server,
+      [](const char *service_name, const <INTERNAL_PREFIX>_peer_info_h peer_info,
+        const <INTERNAL_PREFIX>_payload_h payload, <INTERNAL_PREFIX>_transfer_status_e status, void *user_data) {
+            ## *sr = static_cast<##*>(user_data);
+            sr->OnPayloadReceivedCB(service_name, peer_info, payload,
+                static_cast<<MODULE_PREFIX>_payload_transfer_status_e>(status), user_data);
+          },
+      this);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_server_add_payload_received_cb. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  ret = <INTERNAL_PREFIX>_server_set_data_received_cb(server, OnDataReceivedCB, this);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_server_set_data_received_cb. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  ret = <INTERNAL_PREFIX>_server_add_disconnected_cb(server, OnDisconnectedCB, this);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_server_add_disconnected_cb. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  server_ = server;
+)__cpp_cb";
+
+
+
+constexpr const char __SERVER_UNREGISTER[] =
+R"__cpp_cb(
+  if (server_ != nullptr)
+    <INTERNAL_PREFIX>_server_destroy(server_);
+)__cpp_cb";
+
+constexpr const char __SERVER_ACCEPT[] =
+R"__cpp_cb(auto p = service->GetPeer();
+  int ret = <INTERNAL_PREFIX>_server_accept(server_, p);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_server_accept. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  service->OnCreate();
+  services_.emplace_back(std::move(service));
+)__cpp_cb";
+
+constexpr const char __SERVER_REJECT[] =
+R"__cpp_cb(auto p = service->GetPeer();
+  int ret = <INTERNAL_PREFIX>_server_reject(server_, p, reason.c_str());
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_server_reject. error(%d)", ret);
+    throw InvalidIOException();
+  }
+)__cpp_cb";
+
+constexpr const char __SERVER_SET_DISPLAY_NAME[] =
+R"__cpp_cb(int ret = <INTERNAL_PREFIX>_server_set_display_name(server_, display_name.c_str());
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_server_set_display_name. error(%d)", ret);
+    InvalidIOException();
+  }
+)__cpp_cb";
+
+constexpr const char __CLIENT_TRY_CONNECT[] =
+R"__cpp_cb(int ret = <INTERNAL_PREFIX>_client_connect(<CLIENT>, <PEER>);
+    if (ret != MQTT_PLUGIN_ERROR_NONE) {
+      _E("Failed to connect to stub. error(%d)", ret);
+      switch(ret) {
+      case MQTT_PLUGIN_ERROR_PERMISSION_DENIED :
+        throw UnauthorizedAccessException();
+        break;
+      case MQTT_PLUGIN_ERROR_INVALID_PARAMETER :
+        throw NotConnectedSocketException();
+        break;
+      default :
+        throw InvalidIOException();
+      }
+    }
+)__cpp_cb";
+
+constexpr const char __CLIENT_DISCONNECT[] =
+R"__cpp_cb(int ret = <INTERNAL_PREFIX>_client_disconnect(<CLIENT>);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to disconnect to stub. error(%d)", ret);
+    throw NotConnectedSocketException();
+  }
+)__cpp_cb";
+
+constexpr const char __CLIENT_TRY_DISCOVERY[] =
+R"__cpp_cb(int ret = <INTERNAL_PREFIX>_client_try_discovery(<CLIENT>, OnDiscoveredCB, this);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to discovery to stub. error(%d)", ret);
+    switch(ret) {
+      case MQTT_PLUGIN_ERROR_PERMISSION_DENIED :
+        throw UnauthorizedAccessException();
+        break;
+      default :
+        throw InvalidIOException();
+    }
+  }
+)__cpp_cb";
+
+constexpr const char __CLIENT_STOP_DISCOVERY[] =
+R"__cpp_cb(int ret = <INTERNAL_PREFIX>_client_stop_discovery(<CLIENT>);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to stop discovery. error(%d)", ret);
+    return;
+  }
+)__cpp_cb";
+
+constexpr const char __CLIENT_SEND_ASYNC[] =
+R"__cpp_cb(
+    ret = <INTERNAL_PREFIX>_payload_create(&<PAYLOAD>, MQTT_PLUGIN_PAYLOAD_TYPE_DATA);
+    if (ret != MQTT_PLUGIN_ERROR_NONE) {
+      _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret);
+      rpc_port_parcel_destroy(p);
+      throw InvalidIOException();
+    }
+
+    ret = <INTERNAL_PREFIX>_payload_set_data(<PAYLOAD>, (const unsigned char*)data, <SIZE>);
+    if (ret != MQTT_PLUGIN_ERROR_NONE) {
+      _E("Failed to <INTERNAL_PREFIX>_payload_set_data : %d", ret);
+      rpc_port_parcel_destroy(p);
+      <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
+      throw InvalidIOException();
+    }
+
+    ret = <INTERNAL_PREFIX>_client_send_payload_async(<CLIENT>, <PAYLOAD>, nullptr, nullptr);
+    if (ret != MQTT_PLUGIN_ERROR_NONE) {
+      _E("Failed to <INTERNAL_PREFIX>_client_send_payload_async : %d", ret);
+      rpc_port_parcel_destroy(p);
+      <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
+      throw InvalidIOException();
+    }
+
+    <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
+)__cpp_cb";
+
+constexpr const char __CLIENT_SEND[] =
+R"__cpp_cb(
+    ret = <INTERNAL_PREFIX>_client_send_data(<CLIENT>, (unsigned char *)<DATA>, <DATA_SIZE>,
+        100, &<RET_DATA>, &<RET_DATA_SIZE>);
+    if (ret != RPC_PORT_ERROR_NONE) {
+        _E("Failed to <INTERNAL_PREFIX>_client_send_data : error(%d)", ret);
+        rpc_port_parcel_destroy(p);
+        throw InvalidIOException();
+    }
+)__cpp_cb";
+
+constexpr const char __SERVER_SEND_ASYNC[] =
+R"__cpp_cb(ret_ = <INTERNAL_PREFIX>_payload_create(&<PAYLOAD>, MQTT_PLUGIN_PAYLOAD_TYPE_DATA);
+  if (ret_ != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret_);
+    rpc_port_parcel_destroy(p);
+    return;
+  }
+
+  ret_ = <INTERNAL_PREFIX>_payload_set_data(<PAYLOAD>, (const unsigned char*)data, <SIZE>);
+  if (ret_ != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_payload_set_data : %d", ret_);
+    rpc_port_parcel_destroy(p);
+    <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
+    return;
+  }
+
+  ret_ = <INTERNAL_PREFIX>_server_send_payload_async(<SERVER>, service_.lock()->GetPeer(), <PAYLOAD>, nullptr, nullptr);
+  <INTERNAL_PREFIX>_payload_destroy(<PAYLOAD>);
+  if (ret_ != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_client_send_payload_async : %d", ret_);
+    rpc_port_parcel_destroy(p);
+    return;
+  }
+)__cpp_cb";
+
+constexpr const char __GROUP_HANDLES[] =
+R"__c_cb(
+  /**
+  * @brief The mqtt group handle.
+  */
+typedef void *<MODULE_PREFIX>_group_h;
+
+)__c_cb";
+
+constexpr const char __GROUP_PUBLISH[] =
+R"__c_cb(ret = <INTERNAL_PREFIX>_payload_create(&pl, MQTT_PLUGIN_PAYLOAD_TYPE_DATA);
+    if (ret != MQTT_PLUGIN_ERROR_NONE) {
+      _E("Failed to <INTERNAL_PREFIX>_payload_create : %d", ret);
+      rpc_port_parcel_destroy(p);
+      throw InvalidIOException();
+    }
+
+    ret = <INTERNAL_PREFIX>_payload_set_data(pl, (const unsigned char*)data, size);
+    if (ret != MQTT_PLUGIN_ERROR_NONE) {
+      _E("Failed to <INTERNAL_PREFIX>_payload_set_data : %d", ret);
+      rpc_port_parcel_destroy(p);
+      <INTERNAL_PREFIX>_payload_destroy(pl);
+      throw InvalidIOException();
+    }
+
+    ret = <INTERNAL_PREFIX>_group_publish(group_, pl);
+    <INTERNAL_PREFIX>_payload_destroy(pl);
+    if (ret != MQTT_PLUGIN_ERROR_NONE) {
+      _E("Failed to <INTERNAL_PREFIX>_group_publish : %d", ret);
+      rpc_port_parcel_destroy(p);
+      throw InvalidIOException();
+    }
+)__c_cb";
+
+constexpr const char __CLIENT_CREATE[] =
+R"__c_cb(<CLIENT_T> client = nullptr;
+  int ret = <INTERNAL_PREFIX>_client_create(&client, service_name.c_str(),
+      broker_ip.c_str(), broker_port, user_name.c_str(), password.c_str());
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to create handle. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  ret = <INTERNAL_PREFIX>_client_add_disconnected_cb(client, OnDisconnectedCB,
+      this);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_client_add_disconnected_cb. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  ret = <INTERNAL_PREFIX>_client_add_connection_result_cb(client, OnConnectionResultCB,
+      this);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_client_add_connection_result_cb. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  ret = <INTERNAL_PREFIX>_client_add_payload_received_cb(client,
+      [](const char *service_name, const <INTERNAL_PREFIX>_peer_info_h peer_info,
+        const <INTERNAL_PREFIX>_payload_h payload, <INTERNAL_PREFIX>_transfer_status_e status, void *user_data) {
+            $$ *sr = static_cast<$$*>(user_data);
+            sr->OnPayloadReceivedCB(service_name, peer_info, payload,
+                static_cast<<MODULE_PREFIX>_payload_transfer_status_e>(status), user_data);
+          }, this);
+
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_client_add_payload_received_cb. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  client_ = client;
+)__c_cb";
+
+constexpr const char __GROUP_CREATE[] =
+R"__c_cb(<GROUP_T> group = nullptr;
+  int ret = <INTERNAL_PREFIX>_group_create(&group, topic_name_.c_str(),
+      broker_ip.c_str(), broker_port, user_name.c_str(), password.c_str());
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to create handle. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  ret = <INTERNAL_PREFIX>_group_add_joined_cb(group,
+      [](const char *topic_name, const <PEER_INFO_T> peer_info,
+          void *user_data) {
+            <CLS_NAME> *gr = static_cast<<CLS_NAME>*>(user_data);
+            gr->OnJoined(peer_info);
+          },
+      this);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_group_add_joined_cb. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  ret = <INTERNAL_PREFIX>_group_add_left_cb(group,
+      [](const char *topic_name, const <PEER_INFO_T> peer_info,
+          void *user_data) {
+            <CLS_NAME> *gr = static_cast<<CLS_NAME>*>(user_data);
+            gr->OnLeft(peer_info);
+          },
+      this);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_group_add_left_cb. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  ret = <INTERNAL_PREFIX>_group_add_payload_received_cb(group,
+      [](const char *topic_name, const <PEER_INFO_T> peer_info,
+          const <PAYLOAD_T> payload, void *user_data) {
+            <CLS_NAME> *gr = static_cast<<CLS_NAME>*>(user_data);
+            gr->OnPayloadReceivedCB(peer_info, payload);
+          },
+      this);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_group_add_payload_received_cb. error(%d)", ret);
+    throw InvalidIOException();
+  }
+
+  ret = <INTERNAL_PREFIX>_group_subscribe(group);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to subscribe. error(%d)", ret);
+    switch (ret) {
+    case MQTT_PLUGIN_ERROR_PERMISSION_DENIED :
+      throw UnauthorizedAccessException();
+      break;
+    case MQTT_PLUGIN_ERROR_INVALID_PARAMETER :
+      throw NotConnectedSocketException();
+      break;
+    default :
+      throw InvalidIOException();
+    }
+  }
+
+  group_ = group;
+)__c_cb";
+
+constexpr const char __GROUP_DESTROY[] =
+R"__c_cb(if (group_ != nullptr) {
+    <INTERNAL_PREFIX>_group_unsubscribe(group_);
+    <INTERNAL_PREFIX>_group_destroy(group_);
+  }
+)__c_cb";
+
+constexpr const char __CLIENT_DESTROY[] =
+R"__c_cb(
+  if (client_ != nullptr)
+    <INTERNAL_PREFIX>_client_destroy(client_);
+)__c_cb";
+
+const char __PEER_INFO_CLONE[] =
+  "<INTERNAL_PREFIX>_peer_info_clone(<SRC_PEER>, <DEST_PEER>);";
+
+constexpr const char __SERVER_SET_ONDEMAND_LAUNCH_ENABLED[] =
+R"__c_cb(int ret = <INTERNAL_PREFIX>_server_set_on_demand_launch_enabled(server_, enabled);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_server_set_on_demand_launch_enabled. error(%d)", ret);
+    switch(ret) {
+      case MQTT_PLUGIN_ERROR_PERMISSION_DENIED :
+        throw UnauthorizedAccessException();
+        break;
+      default :
+        throw InvalidIOException();
+    }
+  }
+)__c_cb";
+
+constexpr const char __SERVER_LISTEN[] =
+R"__c_cb(int ret = <INTERNAL_PREFIX>_server_listen(server_, OnConnectionRequestCB, this);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_server_listen. error(%d)", ret);
+    switch(ret) {
+      case MQTT_PLUGIN_ERROR_PERMISSION_DENIED :
+        throw UnauthorizedAccessException();
+        break;
+      default :
+        throw InvalidIOException();
+    }
+  }
+)__c_cb";
+
+constexpr const char __SERVER_DISCONNECT[] =
+R"__c_cb(int ret = <INTERNAL_PREFIX>_server_disconnect(<SERVER>, <PEER>);
+  if (ret != MQTT_PLUGIN_ERROR_NONE) {
+    _E("Failed to <INTERNAL_PREFIX>_server_disconnect. error(%d)", ret);
+    throw InvalidIOException();
+  }
+)__c_cb";
+
+constexpr const char __PEER_INFO_GET_APPID[] =
+    "<INTERNAL_PREFIX>_peer_info_get_app_id(<PEER>, <APPID>);";
+
+constexpr const char __PEER_INFO_GET_UUID[] =
+    "<INTERNAL_PREFIX>_peer_info_get_uuid(<PEER>, <UUID>);";
+
+}  // namespace
+
+constexpr const char __COMMON_HEADER_PAYLOAD_HANDLE[] =
+R"__c_cb(
+/**
+ * @brief Enumeration for <MODULE_PREFIX>_payload transfer status types.
+ */
+typedef enum _<MODULE_PREFIX>_payload_transfer_status_e {
+  MQTT_PLUGIN_PAYLOAD_TRANSFER_STATUS_SUCCESS, /**< Transfer is success **/
+  MQTT_PLUGIN_PAYLOAD_TRANSFER_STATUS_FAILURE, /**< Transfer is failed **/
+  MQTT_PLUGIN_PAYLOAD_TRANSFER_STATUS_IN_PROGRESS, /**< Transfer is in progress **/
+} <MODULE_PREFIX>_payload_transfer_status_e;
+
+/**
+  * @brief The <MODULE_PREFIX>_payload handle.
+  */
+ typedef void *<MODULE_PREFIX>_payload_h;
+ typedef void *<MODULE_PREFIX>_payload_async_result_h;
+
+)__c_cb";
+
+constexpr const char __COMMON_HEADER_HANDLES[] =
+R"__c_cb(
+
+typedef enum _<MODULE_PREFIX>_error {
+  MQTT_PLUGIN_ERROR_NONE = TIZEN_ERROR_NONE, /**< Success */
+  MQTT_PLUGIN_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
+  MQTT_PLUGIN_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+  MQTT_PLUGIN_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+  MQTT_PLUGIN_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+  MQTT_PLUGIN_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Function not implemented */
+  MQTT_PLUGIN_ERROR_ALREADY_IN_PROGRESS = TIZEN_ERROR_ALREADY_IN_PROGRESS, /**< Already in progress */
+  MQTT_PLUGIN_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
+  MQTT_PLUGIN_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< Timed out */
+  MQTT_PLUGIN_ERROR_OPERATION_FAILED = TIZEN_ERROR_CION | 0x01, /**< Operation failed */
+} <MODULE_PREFIX>_error_e;
+
+enum MqttProtocol {
+  MQTT_TYPE_MQTT = (0x1 << 0),   // Publish message through the MQTT
+  MQTT_TYPE_TCP = (0x1 << 1),   // Publish message to peers using the TCP
+  MQTT_TYPE_UDP = (0x1 << 2),   // Publish message to peers using the UDP
+  MQTT_TYPE_SRTP = (0x1 << 3),   // Publish message to peers using the SRTP
+  MQTT_TYPE_WEBRTC = (0x1 << 4),  // Publish message to peers using the WEBRTC
+};
+
+/**
+  * @brief The mqtt plugin peer info handle.
+  */
+typedef void *<MODULE_PREFIX>_peer_info_h;
+
+)__c_cb";
+
+constexpr const char __CLIENT_HEADER_HANDLES[] =
+R"__c_cb(
+  /**
+  * @brief The mqtt client handle.
+  */
+typedef void *<MODULE_PREFIX>_client_h;
+
+)__c_cb";
+
+constexpr const char __CLIENT_SERVER_HANDLES[] =
+R"__c_cb(
+  /**
+  * @brief The mqtt server handle.
+  */
+typedef void *<MODULE_PREFIX>_server_h;
+
+)__c_cb";
+
+constexpr const char __COMMON_HEADER_CONNECTION_RESULT_HANDLE[] =
+R"__c_cb(
+typedef enum _mqtt_connection_status_e {
+  MQTT_PLUGIN_CONNECTION_STATUS_OK, /**< Connection is ok **/
+  MQTT_PLUGIN_CONNECTION_STATUS_REJECTED, /**< Connection is rejected **/
+  MQTT_PLUGIN_CONNECTION_STATUS_ERROR, /**< Connection error occurs **/
+} <MODULE_PREFIX>_connection_status_e;
+
+/**
+ * @brief The Mqtt plugin connection result handle.
+ */
+typedef void *<MODULE_PREFIX>_connection_result_h;
+
+)__c_cb";
+
+constexpr const char __COMMON_HEADER_COMMON_BASE[] =
+R"__c_cb(
+/**
+  * @brief Creates a clone of mqtt plugin peer info handle.
+  * @remarks @a peer_info_clone must be released using <MODULE_PREFIX>_peer_info_destroy().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] peer_info_clone The cloned peer information handle
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  * @retval #MQTT_PLUGIN_ERROR_IO_ERROR IO error
+  * @see <MODULE_PREFIX>_peer_info_destroy()
+  */
+int <MODULE_PREFIX>_peer_info_clone(const <MODULE_PREFIX>_peer_info_h peer_info,
+    <MODULE_PREFIX>_peer_info_h *peer_info_clone);
+
+/**
+  * @brief Destroys the peer info handle and releases all its resources.
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @see <MODULE_PREFIX>_peer_info_clone()
+  */
+int <MODULE_PREFIX>_peer_info_destroy(<MODULE_PREFIX>_peer_info_h peer_info);
+
+/**
+  * @brief Gets the device ID.
+  * @remarks @a device_id must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] device_id The device ID
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_device_id(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_id);
+
+/**
+  * @brief Gets the device name.
+  * @remarks @a device_name must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] device_name The device name
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_device_name(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_name);
+
+/**
+  * @brief Gets the device's platform.
+  * @remarks @a device_platform must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] device_platform The platform name
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_device_platform(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_platform);
+
+/**
+  * @brief Gets the device's platform version.
+  * @remarks @a device_platform_version must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] device_platform_version The platform version
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_device_platform_version(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_platform_version);
+
+/**
+  * @brief Gets the device's type.
+  * @remarks @a device_type must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] device_type Device type
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_device_type(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_type);
+
+/**
+  * @brief Gets application ID of peer.
+  * @remarks @a app_id must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] app_id The application ID
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_app_id(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **app_id);
+
+/**
+  * @brief Gets application version of peer.
+  * @remarks @a app_version must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] app_version The application version
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_app_version(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **app_version);
+
+/**
+  * @brief Gets UUID of peer.
+  * @remarks @a uuid must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] uuid The UUID
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_uuid(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **uuid);
+
+/**
+  * @brief Gets display name of peer.
+  * @details The custom name for service name. \n
+  *          It is possible that @a display_name does not exist.
+  * @remarks @a display_name must be released using free().
+  * @param[in] peer_info The mqtt plugin peer information handle
+  * @param[out] display_name The display name
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+int <MODULE_PREFIX>_peer_info_get_display_name(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **display_name);
+
+)__c_cb";
+
+
+constexpr const char __COMMON_HEADER_PAYLOAD_BASE[] =
+R"__c_cb(
+/**
+  * @brief Saves the payload as a file.
+  * @remarks The @a path is absolute path.
+  * @remarks If the media storage is used, %http://tizen.org/privilege/mediastorage privilege is necessary. \n
+  *          If the external storage is used, %http://tizen.org/privilege/externalstorage privilege is necessary.
+  * @param[in] payload The <MODULE_PREFIX>_payload handle
+  * @param[in] path The path of file
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_PERMISSION_DENIED Permission denied
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OPERATION_FAILED Operation failed
+  */
+int <MODULE_PREFIX>_payload_save_as_file(<MODULE_PREFIX>_payload_h payload, const char *path);
+
+/**
+  * @brief Gets the name of received file from the payload.
+  * @remarks @a file_name must be released using free().
+  * @param[in] payload The <MODULE_PREFIX>_payload handle
+  * @param[out] file_name The name of file
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+  */
+
+int <MODULE_PREFIX>_payload_get_received_file_name(<MODULE_PREFIX>_payload_h payload,
+    char **file_name);
+
+/**
+  * @brief Gets the size of currently received file from the payload.
+  * @param[in] payload The <MODULE_PREFIX>_payload handle
+  * @param[out] bytes The size of file
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  */
+int <MODULE_PREFIX>_payload_get_received_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes);
+
+/**
+  * @brief Gets the total size of file from the payload.
+  * @param[in] payload The <MODULE_PREFIX>_payload handle
+  * @param[out] bytes The size of file
+  * @return @c 0 on success, otherwise a negative error value
+  * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+  * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+  */
+int <MODULE_PREFIX>_payload_get_total_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes);
+
+)__c_cb";
+
+constexpr const char __COMMON_HEADER_CONNECTION_RESULT_BASE[] =
+R"__c_cb(
+/**
+ * @brief Gets the connection result status.
+ * @param[in] result The connection result handle
+ * @param[out] status Connection result status
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+ * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int <MODULE_PREFIX>_connection_result_get_status(const <MODULE_PREFIX>_connection_result_h result,
+         <MODULE_PREFIX>_connection_status_e *status);
+
+/**
+ * @brief Gets the connection result reason.
+ * @remarks @a reason must be released using free().
+ * @param[in] result The connection result handle
+ * @param[out] reason Connection result reason, should be freed after use
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MQTT_PLUGIN_ERROR_NONE Successful
+ * @retval #MQTT_PLUGIN_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MQTT_PLUGIN_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int <MODULE_PREFIX>_connection_result_get_reason(const <MODULE_PREFIX>_connection_result_h result,
+        char **reason);
+
+)__c_cb";
+
+constexpr const char __COMMON_BODY_PAYLOAD_BASE[] =
+R"__c_cb(
+int <MODULE_PREFIX>_payload_save_as_file(<MODULE_PREFIX>_payload_h payload, const char *path) {
+  return <INTERNAL_PREFIX>_payload_save_as_file(payload, path);
+}
+
+int <MODULE_PREFIX>_payload_get_received_file_name(<MODULE_PREFIX>_payload_h payload,
+    char **file_name) {
+  return <INTERNAL_PREFIX>_payload_get_received_file_name(payload, file_name);
+}
+
+int <MODULE_PREFIX>_payload_get_received_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes) {
+  return <INTERNAL_PREFIX>_payload_get_received_bytes(payload, bytes);
+}
+
+int <MODULE_PREFIX>_payload_get_total_bytes(<MODULE_PREFIX>_payload_h payload, uint64_t *bytes) {
+  return <INTERNAL_PREFIX>_payload_get_total_bytes(payload, bytes);
+}
+
+)__c_cb";
+
+constexpr const char __COMMON_BODY_CONNECTION_RESULT_BASE[] =
+R"__c_cb(
+int <MODULE_PREFIX>_connection_result_get_status(const <MODULE_PREFIX>_connection_result_h result,
+    <MODULE_PREFIX>_connection_status_e *status) {
+  return <INTERNAL_PREFIX>_connection_result_get_status(result,(<INTERNAL_PREFIX>_connection_status_e *)status);
+}
+
+int <MODULE_PREFIX>_connection_result_get_reason(const <MODULE_PREFIX>_connection_result_h result,
+    char **reason) {
+  return <INTERNAL_PREFIX>_connection_result_get_reason(result, reason);
+}
+
+)__c_cb";
+
+constexpr const char __COMMON_BODY_PEERINFO_BASE[] =
+R"__c_cb(
+int <MODULE_PREFIX>_peer_info_clone(const <MODULE_PREFIX>_peer_info_h peer_info,
+    <MODULE_PREFIX>_peer_info_h *peer_info_clone) {
+  return  <INTERNAL_PREFIX>_peer_info_clone(peer_info, peer_info_clone);
+}
+
+int <MODULE_PREFIX>_peer_info_destroy(<MODULE_PREFIX>_peer_info_h peer_info) {
+  return <INTERNAL_PREFIX>_peer_info_destroy(peer_info);
+}
+
+int <MODULE_PREFIX>_peer_info_get_device_id(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_id) {
+  return <INTERNAL_PREFIX>_peer_info_get_device_id(peer_info, device_id);
+}
+
+int <MODULE_PREFIX>_peer_info_get_device_name(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_name) {
+  return <INTERNAL_PREFIX>_peer_info_get_device_name(peer_info, device_name);
+}
+
+int <MODULE_PREFIX>_peer_info_get_device_platform(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_platform) {
+  return <INTERNAL_PREFIX>_peer_info_get_device_platform(peer_info, device_platform);
+}
+
+int <MODULE_PREFIX>_peer_info_get_device_platform_version(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_platform_version) {
+  return <INTERNAL_PREFIX>_peer_info_get_device_platform_version(peer_info, device_platform_version);
+}
+
+int <MODULE_PREFIX>_peer_info_get_device_type(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **device_type) {
+  return <INTERNAL_PREFIX>_peer_info_get_device_type(peer_info, device_type);
+}
+
+int <MODULE_PREFIX>_peer_info_get_app_id(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **app_id) {
+  return <INTERNAL_PREFIX>_peer_info_get_app_id(peer_info, app_id);
+}
+
+int <MODULE_PREFIX>_peer_info_get_app_version(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **app_version) {
+  return <INTERNAL_PREFIX>_peer_info_get_app_version(peer_info,  app_version);
+}
+
+int <MODULE_PREFIX>_peer_info_get_uuid(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **uuid) {
+  return <INTERNAL_PREFIX>_peer_info_get_uuid(peer_info, uuid);
+}
+
+int <MODULE_PREFIX>_peer_info_get_display_name(<MODULE_PREFIX>_peer_info_h peer_info,
+    char **display_name) {
+  return <INTERNAL_PREFIX>_peer_info_get_display_name(peer_info, display_name);
+}
+
+)__c_cb";
+
+namespace tidl {
+
+std::string MqttPluginCppTransportable::GenInclude(int type) const {
+    return "#include \"<FILENAME>_internal.h\"";
+}
+
+std::string MqttPluginCppTransportable::GenHeaderBase() const {
+  return __COMMON_HEADER_COMMON_BASE;
+}
+
+std::string MqttPluginCppTransportable::GenHeaderPayloadHandle() const {
+  return __COMMON_HEADER_PAYLOAD_HANDLE;
+}
+
+std::string MqttPluginCppTransportable::GenHeaderCommonHandle() const {
+  return __COMMON_HEADER_HANDLES;
+}
+
+std::string MqttPluginCppTransportable::GenHeaderClientHandle() const {
+  return __CLIENT_HEADER_HANDLES;
+}
+
+std::string MqttPluginCppTransportable::GenHeaderServerHandle() const {
+  return __CLIENT_SERVER_HANDLES;
+}
+std::string MqttPluginCppTransportable::GenHeaderGroupHandle() const {
+  return __GROUP_HANDLES;
+}
+
+std::string MqttPluginCppTransportable::GenHeaderConnectionHandle() const {
+  return __COMMON_HEADER_CONNECTION_RESULT_HANDLE;
+}
+
+std::string MqttPluginCppTransportable::GenHeaderPayloadBase() const {
+  return __COMMON_HEADER_PAYLOAD_BASE;
+}
+
+std::string MqttPluginCppTransportable::GenHeaderConnectionBase() const {
+  return __COMMON_HEADER_CONNECTION_RESULT_BASE;
+}
+
+std::string MqttPluginCppTransportable::GenBodyPayloadBase() const {
+  return __COMMON_BODY_PAYLOAD_BASE;
+}
+
+std::string MqttPluginCppTransportable::GenBodyConnectionBase() const {
+  return __COMMON_BODY_CONNECTION_RESULT_BASE;
+}
+
+std::string MqttPluginCppTransportable::GenBodyPeerInfoBase() const {
+  return __COMMON_BODY_PEERINFO_BASE;
+}
+
+std::string MqttPluginCppTransportable::GenNamespace() const {
+  return "mqtt";
+}
+
+std::string MqttPluginCppTransportable::GenProxyPrefix() const {
+  return "mqtt_plugin_proxy";
+}
+
+std::string MqttPluginCppTransportable::GenStubPrefix() const {
+  return "mqtt_plugin_stub";
+}
+
+std::string MqttPluginCppTransportable::GenGroupPrefix() const {
+  return "mqtt_plugin_group";
+}
+
+std::string MqttPluginCppTransportable::GenModulePrefix() const {
+  return "mqtt_plugin";
+}
+
+std::string MqttPluginCppTransportable::GenErrorPrefix() const {
+  return "MQTT_PLUGIN";
+}
+
+std::string MqttPluginCppTransportable::GenConnectionResultPrefix() const {
+  return "";
+}
+
+std::string MqttPluginCppTransportable::GenClientSendAsync(std::string client,
+    std::string payload, std::string size) const {
+  return std::string(ReplaceAll(__CLIENT_SEND_ASYNC, {
+      { "<CLIENT>", client },
+      { "<PAYLOAD>", payload},
+      { "<SIZE>", size} }));
+}
+
+std::string MqttPluginCppTransportable::GenClientSend(std::string client,
+    std::string data, std::string data_size,
+    std::string ret_data, std::string ret_data_size) const {
+  return std::string(ReplaceAll(__CLIENT_SEND, {
+      { "<CLIENT>", client },
+      { "<DATA>", data},
+      { "<DATA_SIZE>", data_size},
+      { "<RET_DATA>", ret_data},
+      { "<RET_DATA_SIZE>", ret_data_size} }));
+}
+
+std::string MqttPluginCppTransportable::GenServerSendAsync(std::string server,
+    std::string client,
+    std::string payload, std::string size) const {
+  return std::string(ReplaceAll(__SERVER_SEND_ASYNC, {
+      { "<SERVER>", server },
+      { "<CLIENT>", client},
+      { "<PAYLOAD>", payload},
+      { "<SIZE>", size} }));
+}
+
+std::string MqttPluginCppTransportable::GenServerFileSend(std::string path,
+    std::string server, std::string peer) const {
+  return std::string(ReplaceAll(__SERVER_FILE_SEND, {
+      { "<FILE_PATH>", path },
+      { "<SERVER_H>", server },
+      { "<PEER_H>", peer } }));
+}
+
+std::string MqttPluginCppTransportable::GenClientFileSend(std::string path,
+    std::string client) const {
+  return std::string(ReplaceAll(__CLINET_FILE_SEND, {
+      { "<FILE_PATH>", path },
+      { "<CLIENT_H>", client } }));
+}
+
+std::string MqttPluginCppTransportable::GenGroupType() const {
+  return "<MODULE_PREFIX>_group_h";
+}
+
+std::string MqttPluginCppTransportable::GenPayloadTransferStatusType(bool internal_type) const {
+  if (internal_type)
+    return "<INTERNAL_PREFIX>_transfer_status_e";
+  else
+    return "<MODULE_PREFIX>_payload_transfer_status_e";
+}
+
+std::string MqttPluginCppTransportable::GenPayloadAsyncResultType() const {
+  return "<MODULE_PREFIX>_payload_async_result_h";
+}
+
+std::string MqttPluginCppTransportable::GenPeerInfoType() const {
+  return "<MODULE_PREFIX>_peer_info_h";
+}
+
+std::string MqttPluginCppTransportable::GenPeerInfoDestroy(
+    std::string peer) const {
+  return std::string(ReplaceAll("<MODULE_PREFIX>_peer_info_destroy(<PEER>);", {
+      { "<PEER>", peer } }));
+}
+
+std::string MqttPluginCppTransportable::GenPayloadType() const {
+  return "<MODULE_PREFIX>_payload_h";
+}
+
+std::string MqttPluginCppTransportable::GenClientType() const {
+  return "<MODULE_PREFIX>_client_h";
+}
+
+std::string MqttPluginCppTransportable::GenSecurityType(bool definition) const {
+  return "";
+}
+
+std::string MqttPluginCppTransportable::GenServerType() const {
+  return "<MODULE_PREFIX>_server_h";
+}
+
+std::string MqttPluginCppTransportable::GenClientTryConnect(std::string client,
+    std::string peer) const {
+  return std::string(ReplaceAll(__CLIENT_TRY_CONNECT, {
+      { "<CLIENT>", client },
+      { "<PEER>", peer } }));
+}
+
+std::string MqttPluginCppTransportable::GenClientDisconnect(
+    std::string client) const {
+  return std::string(ReplaceAll(__CLIENT_DISCONNECT, {
+      { "<CLIENT>", client } }));
+}
+
+std::string MqttPluginCppTransportable::GenClientTryDiscovery(
+    std::string client) const {
+  return std::string(ReplaceAll(__CLIENT_TRY_DISCOVERY, {
+      { "<CLIENT>", client } }));
+}
+
+std::string MqttPluginCppTransportable::GenClientStopDiscovery(
+    std::string client) const {
+  return std::string(ReplaceAll(__CLIENT_STOP_DISCOVERY, {
+      { "<CLIENT>", client } }));
+}
+
+std::string MqttPluginCppTransportable::GenServerRegister() const {
+  return __SERVER_REGISTER;
+}
+
+std::string MqttPluginCppTransportable::GenServerUnregister() const {
+  return __SERVER_UNREGISTER;
+}
+
+std::string MqttPluginCppTransportable::GenClientExtraHeader() const {
+  return "";
+}
+
+std::string MqttPluginCppTransportable::GenClientExtraBody() const {
+  return "";
+}
+
+std::string MqttPluginCppTransportable::GenServerExtraHeader() const {
+  return "";
+}
+
+std::string MqttPluginCppTransportable::GenServerExtraBody() const {
+  return "";
+}
+
+std::string MqttPluginCppTransportable::GenServerAccept() const {
+  return __SERVER_ACCEPT;
+}
+
+std::string MqttPluginCppTransportable::GenServerReject() const {
+  return __SERVER_REJECT;
+}
+
+std::string MqttPluginCppTransportable::GenServerSetDisplayName() const {
+  return __SERVER_SET_DISPLAY_NAME;
+}
+
+std::string MqttPluginCppTransportable::GenGroupPublish() const {
+  return __GROUP_PUBLISH;
+}
+
+std::string MqttPluginCppTransportable::GenPayloadTypeEnum() const {
+  return "<INTERNAL_PREFIX>_payload_type_e";
+}
+
+std::string MqttPluginCppTransportable::GenPayloadTypeData() const {
+  return "MQTT_PLUGIN_PAYLOAD_TYPE_DATA";
+}
+
+std::string MqttPluginCppTransportable::GenPayloadTypeFile() const {
+  return "MQTT_PLUGIN_PAYLOAD_TYPE_FILE";
+}
+
+std::string MqttPluginCppTransportable::GenPayloadGetType() const {
+  return "ret = <INTERNAL_PREFIX>_payload_get_type(payload, &type);";
+}
+
+std::string MqttPluginCppTransportable::GenErrorNone() const {
+  return "MQTT_PLUGIN_ERROR_NONE";
+}
+
+std::string MqttPluginCppTransportable::GenPayloadGetData() const {
+  return "ret = <INTERNAL_PREFIX>_payload_get_data(payload, &data, &size);";
+}
+
+std::string MqttPluginCppTransportable::GenClientCreate() const {
+  return __CLIENT_CREATE;
+}
+
+std::string MqttPluginCppTransportable::GenGroupCreate() const {
+  return __GROUP_CREATE;
+}
+
+std::string MqttPluginCppTransportable::GenGroupDestroy() const {
+  return __GROUP_DESTROY;
+}
+
+std::string MqttPluginCppTransportable::GenClientDestroy() const {
+  return __CLIENT_DESTROY;
+}
+
+std::string MqttPluginCppTransportable::GenSetSecurityCA(std::string arg) const {
+  return "";
+}
+
+std::string MqttPluginCppTransportable::GenSetSecurityCert(std::string arg) const {
+  return "";
+}
+
+std::string MqttPluginCppTransportable::GenSetSecurityPrivateKey(
+    std::string arg) const {
+  return "";
+}
+
+std::string MqttPluginCppTransportable::GenPeerInfoClone(std::string src_peer,
+      std::string dest_peer) const {
+  return std::string(ReplaceAll(__PEER_INFO_CLONE, {
+      { "<SRC_PEER>", src_peer },
+      { "<DEST_PEER>", dest_peer } }));
+}
+
+std::string MqttPluginCppTransportable::GenServerSetOnDemandLaunchEnabled() const {
+  return "";
+}
+
+std::string MqttPluginCppTransportable::GenServerListen() const {
+  return __SERVER_LISTEN;
+}
+
+std::string MqttPluginCppTransportable::GenServerDisconnect(std::string server,
+      std::string peer) const {
+  return std::string(ReplaceAll(__SERVER_DISCONNECT, {
+      { "<SERVER>", server },
+      { "<PEER>", peer } }));
+}
+
+std::string MqttPluginCppTransportable::GenPeerInfoGetAppID(std::string peer,
+      std::string appid) const {
+  return std::string(ReplaceAll(__PEER_INFO_GET_APPID, {
+      { "<PEER>", peer},
+      { "<APPID>", appid} }));
+}
+
+std::string MqttPluginCppTransportable::GenPeerInfoGetUUID(std::string peer,
+      std::string uuid) const {
+  return std::string(ReplaceAll(__PEER_INFO_GET_UUID, {
+      { "<PEER>", peer},
+      { "<UUID>", uuid} }));
+}
+
+}  // namespace tidl
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_cpp_transportable.h b/idlc/gen_mqtt_plugin/mqtt_plugin_cpp_transportable.h
new file mode 100644 (file)
index 0000000..d55507e
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_GEN_MQTT_PLUGIN_CPP_TRANSPORTABLE_H_
+#define IDLC_GEN_MQTT_PLUGIN_CPP_TRANSPORTABLE_H_
+
+#include <string>
+
+#include "idlc/gen_cion/cpp_transportable.h"
+
+namespace tidl {
+
+class MqttPluginCppTransportable : public CppTransportable {
+ public:
+  virtual ~MqttPluginCppTransportable() = default;
+  std::string GenInclude(int type = 0) const override;
+  std::string GenClientSendAsync(std::string client,
+      std::string payload, std::string size) const override;
+  std::string GenClientSend(std::string client, std::string data,
+      std::string data_size, std::string ret_data,
+      std::string ret_data_size) const override;
+  std::string GenServerSendAsync(std::string server, std::string client,
+      std::string payload, std::string size) const override;
+  std::string GenServerFileSend(std::string path,
+      std::string server, std::string peer) const override;
+  std::string GenClientFileSend(std::string path,
+      std::string client) const override;
+  std::string GenGroupType() const override;
+  std::string GenPayloadTransferStatusType(bool internal_type = false) const override;
+  std::string GenPayloadAsyncResultType() const override;
+  std::string GenPeerInfoType() const override;
+  std::string GenPeerInfoDestroy(std::string peer) const override;
+  std::string GenPayloadType() const override;
+  std::string GenClientType() const override;
+  std::string GenSecurityType(bool definition = true) const override;
+  std::string GenServerType() const override;
+  std::string GenClientTryConnect(std::string client,
+      std::string peer) const override;
+  std::string GenClientDisconnect(std::string client) const override;
+  std::string GenClientTryDiscovery(std::string client) const override;
+  std::string GenClientStopDiscovery(std::string client) const override;
+  std::string GenServerRegister() const override;
+  std::string GenServerUnregister() const override;
+  std::string GenClientExtraHeader() const override;
+  std::string GenClientExtraBody() const override;
+  std::string GenServerExtraHeader() const override;
+  std::string GenServerExtraBody() const override;
+  std::string GenServerAccept() const override;
+  std::string GenServerReject() const override;
+  std::string GenServerSetDisplayName() const override;
+  std::string GenGroupPublish() const override;
+  std::string GenPayloadTypeEnum() const override;
+  std::string GenPayloadTypeData() const override;
+  std::string GenPayloadTypeFile() const override;
+  std::string GenPayloadGetType() const override;
+  std::string GenErrorNone() const override;
+  std::string GenPayloadGetData() const override;
+  std::string GenClientCreate() const override;
+  std::string GenGroupCreate() const override;
+  std::string GenGroupDestroy() const override;
+  std::string GenClientDestroy() const override;
+  std::string GenSetSecurityCA(std::string arg) const override;
+  std::string GenSetSecurityCert(std::string arg) const override;
+  std::string GenSetSecurityPrivateKey(std::string arg) const override;
+  std::string GenPeerInfoClone(std::string src_peer,
+      std::string dest_peer) const override;
+  std::string GenServerSetOnDemandLaunchEnabled() const override;
+  std::string GenServerListen() const override;
+  std::string GenServerDisconnect(std::string server,
+      std::string peer) const override;
+  std::string GenPeerInfoGetAppID(std::string peer,
+      std::string appid) const override;
+  std::string GenPeerInfoGetUUID(std::string peer,
+      std::string uuid) const override;
+  std::string GenHeaderBase() const override;
+  std::string GenHeaderPayloadHandle() const override;
+  std::string GenHeaderCommonHandle() const override;
+  std::string GenHeaderClientHandle() const override;
+  std::string GenHeaderServerHandle() const override;
+  std::string GenHeaderGroupHandle() const override;
+  std::string GenHeaderConnectionHandle() const override;
+  std::string GenHeaderPayloadBase() const override;
+  std::string GenHeaderConnectionBase() const override;
+  std::string GenBodyPayloadBase() const override;
+  std::string GenBodyConnectionBase() const override;
+  std::string GenBodyPeerInfoBase() const override;
+  std::string GenNamespace() const override;
+  std::string GenProxyPrefix() const override;
+  std::string GenStubPrefix() const override;
+  std::string GenGroupPrefix() const override;
+  std::string GenModulePrefix() const override;
+  std::string GenErrorPrefix() const override;
+  std::string GenConnectionResultPrefix() const override;
+};
+
+}  // namespace tidl
+
+#endif  // IDLC_GEN_MQTT_PLUGIN_CPP_TRANSPORTABLE_H_
\ No newline at end of file
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_cs_base_gen.cc b/idlc/gen_mqtt_plugin/mqtt_plugin_cs_base_gen.cc
new file mode 100644 (file)
index 0000000..24f9a34
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_cs_base_gen.h"
+
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_cs_base_gen_cb.h"
+
+namespace tidl {
+
+MqttPluginCsBaseGen::MqttPluginCsBaseGen(std::shared_ptr<Document> doc,
+    std::shared_ptr<tidl::Transportable> trans) : CionPluginBase(doc, trans) {
+}
+
+void MqttPluginCsBaseGen::OnInitGen(std::ofstream& stream) {
+  GenUsing(stream);
+  stream << "namespace Tizen.Applications.MqttPlugin\n";
+  stream << "{\n";
+  GenBase(stream);
+  stream << "}\n";
+}
+
+void MqttPluginCsBaseGen::OnFiniGen(std::ofstream& stream) {
+}
+
+void MqttPluginCsBaseGen::GenUsing(std::ofstream& stream) {
+  stream << CB_BASE_USING;
+}
+
+void MqttPluginCsBaseGen::GenBase(std::ofstream& stream) {
+  stream << CB_ERROR_FACTORY;
+  stream << CB_DATA_PAYLOAD;
+  stream << CB_FILE_PAYLOAD;
+  stream << CB_PEER_INFO;
+  stream << CB_PEER_INFO_SAFE_HANDLE;
+  stream << CB_PAYLOAD;
+  stream << CB_PAYLOAD_ASYNC_RESULT;
+  stream << CB_PAYLOAD_ASYNC_RESULT_CODE;
+  stream << CB_PAYLOAD_SAFE_HANDLE;
+  stream << CB_PAYLOAD_TRANSFER_STATUS;
+  stream << CB_PAYLOAD_TYPE;
+  stream << CB_CONNECTION_RESULT;
+  stream << CB_CONNECTION_STATUS;
+
+  switch (GetType()) {
+    // client
+    case 1:
+      stream << CB_CLIENT_SAFE_HANDLE;
+      stream << CB_CLIENT_BASE;
+      break;
+    // server
+    case 2:
+      stream << CB_SERVER_SAFE_HANDLE;
+      stream << CB_SERVER_BASE;
+      break;
+    // group
+    case 3:
+      stream << CB_GROUP_SAFE_HANDLE;
+      stream << CB_GROUP_BASE;
+      break;
+    default:
+      break;
+  }
+}
+
+}  // namespace tidl
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_cs_base_gen.h b/idlc/gen_mqtt_plugin/mqtt_plugin_cs_base_gen.h
new file mode 100644 (file)
index 0000000..5e9dc9e
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_BASE_GEN_H_
+#define IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_BASE_GEN_H_
+
+#include <memory>
+
+#include "idlc/gen_cion/cion_plugin_base.h"
+
+namespace tidl {
+
+class MqttPluginCsBaseGen : public CionPluginBase {
+ public:
+  explicit MqttPluginCsBaseGen(std::shared_ptr<Document> doc,
+      std::shared_ptr<tidl::Transportable> trans);
+  virtual ~MqttPluginCsBaseGen() = default;
+
+  void OnInitGen(std::ofstream& stream) override;
+  void OnFiniGen(std::ofstream& stream) override;
+
+ private:
+  void GenUsing(std::ofstream& stream);
+  void GenBase(std::ofstream& stream);
+};
+
+}  // namespace tidl
+
+#endif  // IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_BASE_GEN_H_
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_cs_base_gen_cb.h b/idlc/gen_mqtt_plugin/mqtt_plugin_cs_base_gen_cb.h
new file mode 100644 (file)
index 0000000..a30bc14
--- /dev/null
@@ -0,0 +1,1301 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_BASE_GEN_CB_H_
+#define IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_BASE_GEN_CB_H_
+
+constexpr char CB_BASE_USING[] =
+R"__cs_cb(
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+)__cs_cb";
+
+constexpr char CB_ERROR_FACTORY[] =
+R"__cs_cb(
+    internal static class MqttPluginErrorFactory
+    {
+        internal static Exception GetException(Interop.MqttPlugin.ErrorCode err, string message)
+        {
+            string errMessage = string.Format("{0} err = {1}", message, err);
+            switch (err)
+            {
+                case Interop.MqttPlugin.ErrorCode.IoError:
+                    return new InvalidOperationException(errMessage);
+                case Interop.MqttPlugin.ErrorCode.OutOfMemory:
+                    return new InvalidOperationException(errMessage);
+                case Interop.MqttPlugin.ErrorCode.PermissionDenied:
+                    return new UnauthorizedAccessException(errMessage);
+                case Interop.MqttPlugin.ErrorCode.InvalidParameter:
+                    return new ArgumentException(errMessage);
+                case Interop.MqttPlugin.ErrorCode.InvalidOperation:
+                    return new InvalidOperationException(errMessage);
+                case Interop.MqttPlugin.ErrorCode.AlreadyInProgress:
+                    return new InvalidOperationException(errMessage);
+                case Interop.MqttPlugin.ErrorCode.NotSupported:
+                    return new NotSupportedException(errMessage);
+                case Interop.MqttPlugin.ErrorCode.TimedOut:
+                    return new TimeoutException(errMessage);
+                case Interop.MqttPlugin.ErrorCode.OperationFailed:
+                    return new InvalidOperationException(errMessage);
+                default:
+                    return new InvalidOperationException(errMessage);
+            }
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_CLIENT_BASE[] =
+R"__cs_cb(
+    public abstract class ClientBase : IDisposable
+    {
+        private readonly string LogTag = "Tizen.Applications.MqttPlugin";
+        private readonly ClientSafeHandle _handle;
+
+        private PeerInfo _peer;
+
+        private Interop.MqttPluginClient.MqttPluginClientServerDiscoveredCb _discoveredCb;
+        private Interop.MqttPluginClient.MqttPluginClientConnectionResultCb _connectionResultCb;
+        private Interop.MqttPluginClient.MqttPluginClientPayloadReceivedCb _payloadRecievedCb;
+        private Interop.MqttPluginClient.MqttPluginClientDisconnectedCb _disconnectedCb;
+        private Dictionary<string, TaskCompletionSource<PayloadAsyncResult>> _tcsDictionary = new Dictionary<string, TaskCompletionSource<PayloadAsyncResult>>();
+        private Dictionary<string, Interop.MqttPluginClient.MqttPluginClientPayloadAsyncResultCb> _payloadAsyncCbDictionary = new Dictionary<string, Interop.MqttPluginClient.MqttPluginClientPayloadAsyncResultCb>();
+
+        public string ServiceName { get; }
+
+        public PeerInfo PeerInfo
+        {
+            get
+            {
+                return _peer;
+            }
+        }
+
+        public ClientBase(string serviceName, string brokerIp, int brokerPort, string userName, string password)
+        {
+            ServiceName = serviceName;
+
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginClient.MqttPluginClientCreate(out _handle, serviceName, brokerIp, brokerPort, userName, password);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to create client.");
+            }
+
+            _connectionResultCb = new Interop.MqttPluginClient.MqttPluginClientConnectionResultCb(
+                (string service, IntPtr peerInfo, IntPtr result, IntPtr userData) =>
+                {
+                    Interop.MqttPlugin.ErrorCode clone_ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                    if (clone_ret != Interop.MqttPlugin.ErrorCode.None)
+                    {
+                        Log.Error(LogTag, string.Format("Failed to clone peer info."));
+                        return;
+                    }
+
+                    PeerInfo peer = new PeerInfo(clone);
+                    ConnectionResult connectionResult = new ConnectionResult(result);
+                    if (connectionResult.Status == ConnectionStatus.OK)
+                    {
+                        _peer = peer;
+                    }
+
+                    OnConnectionResult(peer, connectionResult);
+                });
+            ret = Interop.MqttPluginClient.MqttPluginClientAddConnectionResultCb(_handle, _connectionResultCb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                _handle.Dispose();
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to add connection status changed callback.");
+            }
+
+            _payloadRecievedCb = new Interop.MqttPluginClient.MqttPluginClientPayloadReceivedCb(
+                (string service, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData) =>
+                {
+                    Payload receivedPayload;
+                    Interop.MqttPluginPayload.MqttPluginPayloadGetType(payload, out Interop.MqttPluginPayload.PayloadType type);
+                    switch (type)
+                    {
+                        case Interop.MqttPluginPayload.PayloadType.Data:
+                            receivedPayload = new DataPayload(new PayloadSafeHandle(payload, false));
+                            break;
+                        case Interop.MqttPluginPayload.PayloadType.File:
+                            receivedPayload = new FilePayload(new PayloadSafeHandle(payload, false));
+                            break;
+                        default:
+                            Log.Error(LogTag, "Invalid payload type received.");
+                            return;
+                    }
+                    OnPayloadReceived(receivedPayload, (PayloadTransferStatus)status);
+                });
+            ret = Interop.MqttPluginClient.MqttPluginClientAddPayloadReceivedCb(_handle, _payloadRecievedCb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                _handle.Dispose();
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to add payload received callback.");
+            }
+
+            _disconnectedCb = new Interop.MqttPluginClient.MqttPluginClientDisconnectedCb(
+                (string service, IntPtr peerInfo, IntPtr userData) =>
+                {
+                    Interop.MqttPlugin.ErrorCode clone_ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                    if (clone_ret != Interop.MqttPlugin.ErrorCode.None)
+                    {
+                        Log.Error(LogTag, string.Format("Failed to clone peer info."));
+                        return;
+                    }
+                    OnDisconnected(new PeerInfo(clone));
+                });
+            ret = Interop.MqttPluginClient.MqttPluginClientAddDisconnectedCb(_handle, _disconnectedCb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                _handle.Dispose();
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to add disconnected callback.");
+            }
+        }
+
+        public void TryDiscovery()
+        {
+            if (_discoveredCb == null)
+            {
+                Interop.MqttPluginClient.MqttPluginClientServerDiscoveredCb cb = new Interop.MqttPluginClient.MqttPluginClientServerDiscoveredCb(
+                    (string serviceName, IntPtr peerInfo, IntPtr userData) =>
+                    {
+                        Interop.MqttPlugin.ErrorCode clone_ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                        if (clone_ret != Interop.MqttPlugin.ErrorCode.None)
+                        {
+                            Log.Error(LogTag, "Failed to clone peer info.");
+                            return;
+                        }
+                        OnDiscovered(new PeerInfo(clone));
+                    });
+                _discoveredCb = cb;
+            }
+
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginClient.MqttPluginClientTryDiscovery(_handle, _discoveredCb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to try discovery.");
+            }
+        }
+
+        public void StopDiscovery()
+        {
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginClient.MqttPluginClientStopDiscovery(_handle);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to stop discovery.");
+            }
+        }
+
+        public void Connect(PeerInfo peer)
+        {
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginClient.MqttPluginClientConnect(_handle, peer?._handle);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to connect.");
+            }
+        }
+
+        public void Disconnect()
+        {
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginClient.MqttPluginClientDisconnect(_handle);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                Log.Error(LogTag, string.Format("Failed to disconnect: {0}", ret));
+            }
+            _peer = null;
+        }
+
+        public byte[] SendData(byte[] data, int timeout)
+        {
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginClient.MqttPluginClientSendData(_handle, data, data?.Length ?? -1, timeout, out IntPtr returnDataPtr, out int returnDataSize);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to send data.");
+            }
+            byte[] returnData = new byte[returnDataSize];
+            Marshal.Copy(returnDataPtr, returnData, 0, returnDataSize);
+            Log.Info(LogTag, string.Format("Returned data size: {0}", returnDataSize));
+
+            return returnData;
+        }
+
+        public Task<PayloadAsyncResult> SendPayloadAsync(Payload payload)
+        {
+            if (payload == null || payload.Id.Length == 0)
+            {
+                throw new ArgumentException("Payload is invalid.");
+            }
+
+            if (_tcsDictionary.ContainsKey(payload.Id))
+            {
+                throw new InvalidOperationException("Payload is already sent.");
+            }
+
+            TaskCompletionSource<PayloadAsyncResult> tcs = new TaskCompletionSource<PayloadAsyncResult>();
+            _tcsDictionary[payload.Id] = tcs;
+
+            Interop.MqttPluginClient.MqttPluginClientPayloadAsyncResultCb cb = new Interop.MqttPluginClient.MqttPluginClientPayloadAsyncResultCb(
+                (IntPtr result, IntPtr userData) =>
+                {
+                    TaskCompletionSource<PayloadAsyncResult> tcsToReturn = _tcsDictionary[payload.Id];
+                    PayloadAsyncResult resultPayload = null;
+                    try
+                    {
+                        resultPayload = PayloadAsyncResult.CreateFromHandle(result);
+                    }
+                    catch (Exception e)
+                    {
+                        Log.Error(LogTag, string.Format("Failed to create PayloadAsyncResult from result handle: {0}.", e.Message));
+                        tcsToReturn.SetException(e);
+                        return;
+                    }
+                    tcsToReturn.SetResult(resultPayload);
+                    _payloadAsyncCbDictionary.Remove(resultPayload.PayloadId);
+                    _tcsDictionary.Remove(resultPayload.PayloadId);
+                });
+
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginClient.MqttPluginClientSendPayloadAsync(_handle, payload?._handle, cb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to send payload.");
+            }
+
+            _payloadAsyncCbDictionary[payload?.Id] = cb;
+
+            return tcs.Task;
+        }
+
+        protected abstract void OnConnectionResult(PeerInfo peerInfo, ConnectionResult result);
+        protected abstract void OnPayloadReceived(Payload payload, PayloadTransferStatus status);
+        protected abstract void OnDiscovered(PeerInfo peerInfo);
+        protected abstract void OnDisconnected(PeerInfo peerInfo);
+
+        private bool disposedValue = false;
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                if (disposing)
+                {
+                    _handle.Dispose();
+                }
+                disposedValue = true;
+            }
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_CLIENT_SAFE_HANDLE[] =
+R"__cs_cb(
+    internal sealed class ClientSafeHandle : SafeHandle
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public ClientSafeHandle() : base(IntPtr.Zero, true)
+        {
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override bool IsInvalid
+        {
+            get { return this.DangerousGetHandle() == IntPtr.Zero; }
+        }
+
+        protected override bool ReleaseHandle()
+        {
+            Interop.MqttPluginClient.MqttPluginClientDestroy(this.handle);
+            SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_CONNECTION_RESULT[] =
+R"__cs_cb(
+    public class ConnectionResult
+    {
+        private readonly string _reason;
+        private readonly ConnectionStatus _status;
+
+        internal ConnectionResult(IntPtr handle)
+        {
+            Interop.MqttPluginConnectionResult.MqttPluginConnectionResultGetReason(handle, out _reason);
+            Interop.MqttPluginConnectionResult.MqttPluginConnectionResultGetStatus(handle, out _status);
+        }
+
+        public ConnectionStatus Status
+        {
+            get
+            {
+                return _status;
+            }
+        }
+
+        public string Reason
+        {
+            get
+            {
+                return _reason;
+            }
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_CONNECTION_STATUS[] =
+R"__cs_cb(
+    public enum ConnectionStatus
+    {
+        OK,
+        Rejected,
+        Error,
+    }
+)__cs_cb";
+
+constexpr char CB_DATA_PAYLOAD[] =
+R"__cs_cb(
+    public class DataPayload : Payload
+    {
+        internal DataPayload(PayloadSafeHandle handle)
+        {
+            _handle = handle;
+        }
+
+        public DataPayload(byte[] data)
+        {
+            Interop.MqttPluginPayload.MqttPluginPayloadCreate(out _handle, Interop.MqttPluginPayload.PayloadType.Data);
+            Interop.MqttPluginPayload.MqttPluginPayloadSetData(_handle, data, data?.Length ?? -1);
+        }
+
+        public override PayloadType PayloadType
+        {
+            get
+            {
+                return PayloadType.DataPayload;
+            }
+        }
+
+        public byte[] Data
+        {
+            get
+            {
+                Interop.MqttPluginPayload.MqttPluginPayloadGetData(_handle, out IntPtr byteArrPtr, out int size);
+                byte[] byteArr = new byte[size];
+                Marshal.Copy(byteArrPtr, byteArr, 0, size);
+                return byteArr;
+            }
+            set
+            {
+                Interop.MqttPluginPayload.MqttPluginPayloadSetData(_handle, value, value?.Length ?? 0);
+            }
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_FILE_PAYLOAD[] =
+R"__cs_cb(
+    public class FilePayload : Payload
+    {
+        private readonly string LogTag = "Tizen.Applications.MqttPlugin";
+
+        internal FilePayload(PayloadSafeHandle handle)
+        {
+            _handle = handle;
+        }
+
+        public FilePayload(string path)
+        {
+            Interop.MqttPluginPayload.MqttPluginPayloadCreate(out _handle, Interop.MqttPluginPayload.PayloadType.File);
+            Interop.MqttPluginPayload.MqttPluginPayloadSetFilePath(_handle, path);
+        }
+
+        public string ReceivedFileName
+        {
+            get
+            {
+                Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPayload.MqttPluginPayloadGetReceivedFileName(_handle, out string path);
+                if (ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    // property should not throw exception.
+                    return "";
+                }
+                return path;
+            }
+        }
+
+        public UInt64 ReceivedBytes
+        {
+            get
+            {
+                Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPayload.MqttPluginPayloadGetReceivedBytes(_handle, out UInt64 bytes);
+                if (ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    Log.Error(LogTag, "Failed to get received bytes.");
+                    return Byte.MinValue;
+                }
+                return bytes;
+            }
+        }
+
+        public UInt64 TotalBytes
+        {
+            get
+            {
+                Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPayload.MqttPluginPayloadGetTotalBytes(_handle, out UInt64 bytes);
+                if (ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    Log.Error(LogTag, "Failed to get total bytes.");
+                    return Byte.MinValue;
+                }
+                return bytes;
+            }
+        }
+
+        public override PayloadType PayloadType
+        {
+            get
+            {
+                return PayloadType.FilePayload;
+            }
+        }
+
+        public void SaveAsFile(string path)
+        {
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPayload.MqttPluginPayloadSaveAsFile(_handle, path);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to save as file.");
+            }
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_GROUP_BASE[] =
+R"__cs_cb(
+    public abstract class GroupBase : IDisposable
+    {
+        private readonly string LogTag = "Tizen.Applications.MqttPlugin";
+        private readonly GroupSafeHandle _handle;
+
+        private Interop.MqttPluginGroup.MqttPluginGroupPayloadReceivedCb _payloadReceivedCb;
+        private Interop.MqttPluginGroup.MqttPluginGroupLeftCb _leftCb;
+        private Interop.MqttPluginGroup.MqttPluginGroupJoinedCb _joinedCb;
+
+        public string Topic { get; }
+
+        public GroupBase(string topicName, string brokerIp, int brokerPort, string userName, string password)
+        {
+            Topic = topicName;
+
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginGroup.MqttPluginGroupCreate(out _handle, topicName, brokerIp, brokerPort, userName, password);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to create group.");
+            }
+
+            _payloadReceivedCb = new Interop.MqttPluginGroup.MqttPluginGroupPayloadReceivedCb(
+                (IntPtr group, IntPtr peerInfo, IntPtr payload, IntPtr userData) =>
+                {
+                    Payload receivedPayload;
+                    Interop.MqttPluginPayload.MqttPluginPayloadGetType(payload, out Interop.MqttPluginPayload.PayloadType type);
+                    switch (type)
+                    {
+                        case Interop.MqttPluginPayload.PayloadType.Data:
+                            receivedPayload = new DataPayload(new PayloadSafeHandle(payload, false));
+                            break;
+                        case Interop.MqttPluginPayload.PayloadType.File:
+                            receivedPayload = new FilePayload(new PayloadSafeHandle(payload, false));
+                            break;
+                        default:
+                            Log.Error(LogTag, "Invalid payload type received.");
+                            return;
+                    }
+                    Interop.MqttPlugin.ErrorCode clone_ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                    if (clone_ret != Interop.MqttPlugin.ErrorCode.None)
+                    {
+                        Log.Error(LogTag, "Failed to clone peer info.");
+                        return;
+                    }
+                    OnPayloadReceived(receivedPayload, new PeerInfo(clone));
+                });
+            ret = Interop.MqttPluginGroup.MqttPluginGroupAddPayloadReceivedCb(_handle, _payloadReceivedCb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                _handle.Dispose();
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to add payload received callback.");
+            }
+
+            _joinedCb = new Interop.MqttPluginGroup.MqttPluginGroupJoinedCb(
+                (string name, IntPtr peerInfo, IntPtr userData) =>
+                {
+                    Interop.MqttPlugin.ErrorCode clone_ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                    if (clone_ret != Interop.MqttPlugin.ErrorCode.None)
+                    {
+                        return;
+                    }
+                    OnJoined(new PeerInfo(clone));
+                });
+            ret = Interop.MqttPluginGroup.MqttPluginGroupAddJoinedCb(_handle, _joinedCb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                _handle.Dispose();
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to add joined callback.");
+            }
+
+            _leftCb = new Interop.MqttPluginGroup.MqttPluginGroupLeftCb(
+                (string name, IntPtr peerInfo, IntPtr userData) =>
+                {
+                    Interop.MqttPlugin.ErrorCode clone_ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                    if (clone_ret != Interop.MqttPlugin.ErrorCode.None)
+                    {
+                        return;
+                    }
+                    OnLeft(new PeerInfo(clone));
+                });
+            ret = Interop.MqttPluginGroup.MqttPluginGroupAddLeftCb(_handle, _leftCb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                _handle.Dispose();
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to add joined callback.");
+            }
+        }
+
+        public void Subscribe()
+        {
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginGroup.MqttPluginGroupSubscribe(_handle);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to subscribe.");
+            }
+        }
+
+        public void Unsubscribe()
+        {
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginGroup.MqttPluginGroupUnsubscribe(_handle);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                Log.Error(LogTag, string.Format("Failed to unsubscribe: {0}", ret));
+            }
+        }
+
+        public void Publish(Payload payload)
+        {
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginGroup.MqttPluginGroupPublish(_handle, payload?._handle);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to publish payload.");
+            }
+        }
+
+        protected abstract void OnPayloadReceived(Payload payload, PeerInfo peer);
+        protected abstract void OnJoined(PeerInfo peerInfo);
+        protected abstract void OnLeft(PeerInfo peerInfo);
+
+        private bool disposedValue = false;
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                if (disposing)
+                {
+                    _handle.Dispose();
+                }
+                disposedValue = true;
+            }
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_GROUP_SAFE_HANDLE[] =
+R"__cs_cb(
+    internal sealed class GroupSafeHandle : SafeHandle
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public GroupSafeHandle() : base(IntPtr.Zero, true)
+        {
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override bool IsInvalid
+        {
+            get { return this.DangerousGetHandle() == IntPtr.Zero; }
+        }
+
+        protected override bool ReleaseHandle()
+        {
+            Interop.MqttPluginGroup.MqttPluginGroupDestroy(this.handle);
+            SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_PAYLOAD[] =
+R"__cs_cb(
+    public abstract class Payload
+    {
+        private readonly string LogTag = "Tizen.Applications.MqttPlugin";
+        internal PayloadSafeHandle _handle;
+
+        public abstract PayloadType PayloadType { get; }
+
+        public string Id
+        {
+            get
+            {
+                Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPayload.MqttPluginPayloadGetPayloadID(_handle, out string id);
+                if (ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    Log.Error(LogTag, "Failed to get id of payload.");
+                    return "";
+                }
+                return id;
+            }
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_PAYLOAD_ASYNC_RESULT[] =
+R"__cs_cb(
+    public class PayloadAsyncResult : IDisposable
+    {
+        private PayloadAsyncResult(PayloadAsyncResultCode result, PeerInfo peer, string payloadId)
+        {
+            Result = result;
+            PeerInfo = peer;
+            PayloadId = payloadId;
+        }
+
+        internal static PayloadAsyncResult CreateFromHandle(IntPtr handle)
+        {
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPayloadAsyncResult.MqttPluginPayloadAsyncResultGetResult(handle, out int code);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Fail to get result code from the AsyncResult");
+            }
+
+            ret = Interop.MqttPluginPayloadAsyncResult.MqttPluginPayloadAsyncResultGetPayloadID(handle, out string payloadId);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Fail to get payload id from the AsyncResult");
+            }
+
+            ret = Interop.MqttPluginPayloadAsyncResult.MqttPluginPayloadAsyncResultGetPeerInfo(handle, out IntPtr peer);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Fail to get peerinfo from the AsyncResult");
+            }
+            ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoClone(peer, out PeerInfoSafeHandle clone);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to clone peer info.");
+            }
+
+            return new PayloadAsyncResult((PayloadAsyncResultCode)code, new PeerInfo(clone), payloadId);
+        }
+
+        public PayloadAsyncResultCode Result { get; }
+
+        public PeerInfo PeerInfo { get; }
+
+        public string PayloadId { get; }
+
+        private bool disposedValue = false;
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                if (disposing)
+                {
+                    PeerInfo?.Dispose();
+                }
+                disposedValue = true;
+            }
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_PAYLOAD_ASYNC_RESULT_CODE[] =
+R"__cs_cb(
+    public enum PayloadAsyncResultCode
+    {
+        Error = -1,
+        Pending = 0,
+        Success,
+        Fail,
+    }
+)__cs_cb";
+
+constexpr char CB_PAYLOAD_SAFE_HANDLE[] =
+R"__cs_cb(
+    internal sealed class PayloadSafeHandle : SafeHandle
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public PayloadSafeHandle() : base(IntPtr.Zero, true)
+        {
+        }
+
+        internal PayloadSafeHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
+        {
+            SetHandle(existingHandle);
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override bool IsInvalid
+        {
+            get { return this.DangerousGetHandle() == IntPtr.Zero; }
+        }
+
+        protected override bool ReleaseHandle()
+        {
+            Interop.MqttPluginPayload.MqttPluginPayloadDestroy(this.handle);
+            SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_PAYLOAD_TRANSFER_STATUS[] =
+R"__cs_cb(
+    public enum PayloadTransferStatus
+    {
+        Success,
+        Failure,
+        InProgress,
+    }
+)__cs_cb";
+
+constexpr char CB_PAYLOAD_TYPE[] =
+R"__cs_cb(
+    public enum PayloadType
+    {
+        DataPayload,
+        FilePayload,
+    }
+)__cs_cb";
+
+constexpr char CB_PEER_INFO[] =
+R"__cs_cb(
+    public class PeerInfo : IDisposable
+    {
+        private readonly string LogTag = "Tizen.Applications.MqttPlugin";
+        internal PeerInfoSafeHandle _handle;
+
+        internal PeerInfo(PeerInfoSafeHandle handle)
+        {
+            _handle = handle;
+        }
+
+        public string DeviceId
+        {
+            get
+            {
+                Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoGetDeviceId(_handle, out string deviceId);
+                if (ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    Log.Error(LogTag, "Failed to get device id.");
+                    return "";
+                }
+                return deviceId;
+            }
+        }
+
+        public string DeviceName
+        {
+            get
+            {
+                Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoGetDeviceName(_handle, out string deviceName);
+                if (ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    Log.Error(LogTag, "Failed to get device name.");
+                    return "";
+                }
+                return deviceName;
+            }
+        }
+
+        public string DevicePlatform
+        {
+            get
+            {
+                Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoGetDevicePlatform(_handle, out string devicePlatform);
+                if (ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    Log.Error(LogTag, "Failed to get device platform.");
+                    return "";
+                }
+                return devicePlatform;
+            }
+        }
+
+        public string DevicePlatformVersion
+        {
+            get
+            {
+                Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoGetDevicePlatformVersion(_handle, out string devicePlatformVersion);
+                if (ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    Log.Error(LogTag, "Failed to get device platform version.");
+                    return "";
+                }
+                return devicePlatformVersion;
+            }
+        }
+
+        public string DeviceType
+        {
+            get
+            {
+                Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoGetDeviceType(_handle, out string deviceType);
+                if (ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    Log.Error(LogTag, "Failed to get device platform type.");
+                    return "";
+                }
+                return deviceType;
+            }
+        }
+
+        public string AppId
+        {
+            get
+            {
+                Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoGetAppId(_handle, out string AppId);
+                if (ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    Log.Error(LogTag, "Failed to get application id.");
+                    return "";
+                }
+                return AppId;
+            }
+        }
+
+        public string AppVersion
+        {
+            get
+            {
+                Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoGetAppVersion(_handle, out string AppVersion);
+                if (ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    Log.Error(LogTag, "Failed to get application version.");
+                    return "";
+                }
+                return AppVersion;
+            }
+        }
+
+        public string UUID
+        {
+            get
+            {
+                Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoGetUuid(_handle, out string uuid);
+                if (ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    Log.Error(LogTag, "Failed to get UUID.");
+                    return "";
+                }
+                return uuid;
+            }
+        }
+
+        private bool disposedValue = false;
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                if (disposing)
+                {
+                    _handle.Dispose();
+                }
+                disposedValue = true;
+            }
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_PEER_INFO_SAFE_HANDLE[] =
+R"__cs_cb(
+    internal sealed class PeerInfoSafeHandle : SafeHandle
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public PeerInfoSafeHandle() : base(IntPtr.Zero, true)
+        {
+        }
+
+        internal PeerInfoSafeHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
+        {
+            SetHandle(existingHandle);
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override bool IsInvalid
+        {
+            get { return this.DangerousGetHandle() == IntPtr.Zero; }
+        }
+
+        protected override bool ReleaseHandle()
+        {
+            Interop.MqttPluginPeerInfo.MqttPluginPeerInfoDestroy(this.handle);
+            SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_SERVER_BASE[] =
+R"__cs_cb(
+    public abstract class ServerBase : IDisposable
+    {
+        private readonly string LogTag = "Tizen.Applications.MqttPlugin";
+
+        private string _displayName;
+        private readonly ServerSafeHandle _handle;
+        private Interop.MqttPluginServer.MqttPluginServerConnectionRequestCb _connectionRequestCb;
+        private Interop.MqttPluginServer.MqttPluginServerConnectionResultCb _connectionResultCb;
+        private Interop.MqttPluginServer.MqttPluginServerDataReceivedCb _dataReceivedCb;
+        private Interop.MqttPluginServer.MqttPluginServerPayloadReceivedCb _payloadRecievedCb;
+        private Interop.MqttPluginServer.MqttPluginServerDisconnectedCb _disconnectedCb;
+        private Interop.MqttPluginServer.MqttPluginServerPayloadAsyncResultCb _payloadAsyncResultCb;
+        private Dictionary<Tuple<string, string>, TaskCompletionSource<PayloadAsyncResult>> _tcsDictionary = new Dictionary<Tuple<string, string>, TaskCompletionSource<PayloadAsyncResult>>();
+
+        public string ServiceName { get; }
+
+        public string DisplayName
+        {
+            get
+            {
+                return _displayName;
+            }
+
+            set
+            {
+                Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginServer.MqttPluginServerSetDisplayName(_handle, value);
+                if (ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    Log.Error(LogTag, string.Format("Failed to set display name: {0}", ret));
+                }
+                else
+                {
+                    _displayName = value;
+                }
+            }
+        }
+
+        public ServerBase(string serviceName, string displayName, string brokerIp, int brokerPort, string userName, string password)
+        {
+            ServiceName = serviceName;
+            _displayName = displayName;
+
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginServer.MqttPluginServerCreate(out _handle, serviceName, displayName, brokerIp, brokerPort, userName, password);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to create server handle.");
+            }
+
+            _connectionResultCb = new Interop.MqttPluginServer.MqttPluginServerConnectionResultCb(
+                (string service, IntPtr peerInfo, IntPtr result, IntPtr userData) =>
+                {
+                    Interop.MqttPlugin.ErrorCode clone_ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                    if (clone_ret != Interop.MqttPlugin.ErrorCode.None)
+                    {
+                        Log.Error(LogTag, "Failed to clone peer info.");
+                        return;
+                    }
+                    OnConnectionResult(new PeerInfo(clone), new ConnectionResult(result));
+                });
+            ret = Interop.MqttPluginServer.MqttPluginServerAddConnectionResultCb(_handle, _connectionResultCb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                _handle.Dispose();
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to add connection status changed callback.");
+            }
+
+            _dataReceivedCb = new Interop.MqttPluginServer.MqttPluginServerDataReceivedCb(
+                (string service, IntPtr peerInfo, IntPtr data, int dataSize, out IntPtr returnData, out int returnDataSize, IntPtr userData) =>
+                {
+                    Interop.MqttPlugin.ErrorCode clone_ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                    if (clone_ret != Interop.MqttPlugin.ErrorCode.None)
+                    {
+                        Log.Error(LogTag, "Failed to clone peer info.");
+                        returnData = IntPtr.Zero;
+                        returnDataSize = -1;
+                    }
+                    byte[] receivedData = new byte[dataSize];
+                    Marshal.Copy(data, receivedData, 0, dataSize);
+                    byte[] returnDataRaw = OnDataReceived(receivedData, new PeerInfo(clone));
+                    returnDataSize = returnDataRaw.Length;
+                    returnData = Interop.MqttPlugin.Malloc(returnDataSize);
+                    Marshal.Copy(returnDataRaw, 0, returnData, returnDataSize);
+                });
+            ret = Interop.MqttPluginServer.MqttPluginServerSetDataReceivedCb(_handle, _dataReceivedCb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                _handle.Dispose();
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to set data received callback.");
+            }
+
+            _payloadRecievedCb = new Interop.MqttPluginServer.MqttPluginServerPayloadReceivedCb(
+                (string service, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData) =>
+                {
+                    Payload receivedPayload;
+                    Interop.MqttPluginPayload.MqttPluginPayloadGetType(payload, out Interop.MqttPluginPayload.PayloadType type);
+                    switch (type)
+                    {
+                        case Interop.MqttPluginPayload.PayloadType.Data:
+                            receivedPayload = new DataPayload(new PayloadSafeHandle(payload, false));
+                            break;
+                        case Interop.MqttPluginPayload.PayloadType.File:
+                            receivedPayload = new FilePayload(new PayloadSafeHandle(payload, false));
+                            break;
+                        default:
+                            Log.Error(LogTag, "Invalid payload type received.");
+                            return;
+                    }
+                    Interop.MqttPlugin.ErrorCode clone_ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                    if (clone_ret != Interop.MqttPlugin.ErrorCode.None)
+                    {
+                        Log.Error(LogTag, "Failed to clone peer info.");
+                        return;
+                    }
+                    OnPayloadReceived(receivedPayload, new PeerInfo(clone), (PayloadTransferStatus)status);
+                });
+            ret = Interop.MqttPluginServer.MqttPluginServerAddPayloadReceivedCb(_handle, _payloadRecievedCb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                _handle.Dispose();
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to add payload received callback.");
+            }
+
+            _disconnectedCb = new Interop.MqttPluginServer.MqttPluginServerDisconnectedCb(
+                (string service, IntPtr peerInfo, IntPtr userData) =>
+                {
+                    Interop.MqttPlugin.ErrorCode clone_ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                    if (clone_ret != Interop.MqttPlugin.ErrorCode.None)
+                    {
+                        Log.Error(LogTag, string.Format("Failed to clone peer info."));
+                        return;
+                    }
+                    OnDisconnected(new PeerInfo(clone));
+                });
+            ret = Interop.MqttPluginServer.MqttPluginServerAddDisconnectedCb(_handle, _disconnectedCb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                _handle.Dispose();
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to add disconnected callback.");
+            }
+        }
+
+        public void Listen()
+        {
+            if (_connectionRequestCb == null)
+            {
+                Interop.MqttPluginServer.MqttPluginServerConnectionRequestCb cb = new Interop.MqttPluginServer.MqttPluginServerConnectionRequestCb(
+                    (serviceName, peerInfo, userData) =>
+                    {
+                        Interop.MqttPlugin.ErrorCode clone_ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                        if (clone_ret != Interop.MqttPlugin.ErrorCode.None)
+                        {
+                            Log.Error(LogTag, "Failed to clone peer info");
+                            return;
+                        }
+                        OnConnectionRequest(new PeerInfo(clone));
+                    });
+                _connectionRequestCb = cb;
+            }
+
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginServer.MqttPluginServerListen(_handle, _connectionRequestCb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to listen server.");
+            }
+        }
+
+        public void Stop()
+        {
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginServer.MqttPluginServerStop(_handle);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to stop server.");
+            }
+        }
+
+        public void Disconnect(PeerInfo peerInfo)
+        {
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginServer.MqttPluginServerDisconnect(_handle, peerInfo?._handle);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to stop server.");
+            }
+        }
+
+        public Task<PayloadAsyncResult> SendPayloadAsync(Payload payload, PeerInfo peerInfo)
+        {
+            if (payload == null || payload.Id.Length == 0 || peerInfo == null || peerInfo.UUID.Length == 0)
+            {
+                throw new ArgumentException("Payload or peerinfo is invalid.");
+            }
+
+            TaskCompletionSource<PayloadAsyncResult> tcs = new TaskCompletionSource<PayloadAsyncResult>();
+            _tcsDictionary[Tuple.Create(payload.Id, peerInfo.UUID)] = tcs;
+
+            if (_payloadAsyncResultCb == null)
+            {
+                Interop.MqttPluginServer.MqttPluginServerPayloadAsyncResultCb cb = new Interop.MqttPluginServer.MqttPluginServerPayloadAsyncResultCb(
+                    (IntPtr result, IntPtr userData) =>
+                    {
+                        PayloadAsyncResult resultPayload = null;
+                        try
+                        {
+                            resultPayload = PayloadAsyncResult.CreateFromHandle(result);
+                        }
+                        catch (Exception e)
+                        {
+                            Log.Error(LogTag, string.Format("Failed to create PayloadAsyncResult from result handle: {0}.", e.Message));
+                            return;
+                        }
+                        TaskCompletionSource<PayloadAsyncResult> tcsToReturn = _tcsDictionary[Tuple.Create(resultPayload.PayloadId, resultPayload.PeerInfo.UUID)];
+                        tcsToReturn.SetResult(resultPayload);
+                        _tcsDictionary.Remove(Tuple.Create(resultPayload.PayloadId, resultPayload.PeerInfo.UUID));
+                    });
+                _payloadAsyncResultCb = cb;
+            }
+
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginServer.MqttPluginServerSendPayloadAsync(_handle, peerInfo?._handle, payload?._handle, _payloadAsyncResultCb, IntPtr.Zero);
+            if (ret != Interop.MqttPlugin.ErrorCode.None)
+            {
+                throw MqttPluginErrorFactory.GetException(ret, "Failed to send payload.");
+            }
+
+            return tcs.Task;
+        }
+
+        public void SendPayloadAsync(Payload payload)
+        {
+            var peerList = GetConnectedPeerList();
+            foreach (var peer in peerList)
+            {
+                SendPayloadAsync(payload, peer);
+            }
+        }
+
+        public void Accept(PeerInfo peerInfo)
+        {
+            Interop.MqttPluginServer.MqttPluginServerAccept(_handle, peerInfo?._handle);
+        }
+
+        public void Reject(PeerInfo peerInfo, string reason)
+        {
+            Interop.MqttPluginServer.MqttPluginServerReject(_handle, peerInfo?._handle, reason);
+        }
+
+        public IEnumerable<PeerInfo> GetConnectedPeerList()
+        {
+            List<PeerInfo> peerInfoList = new List<PeerInfo>();
+            Interop.MqttPlugin.ErrorCode ret = Interop.MqttPluginServer.MqttPluginServerForeachConnectedPeerInfo(_handle, (peer, userData) =>
+            {
+                Interop.MqttPlugin.ErrorCode clone_ret = Interop.MqttPluginPeerInfo.MqttPluginPeerInfoClone(peer, out PeerInfoSafeHandle clone);
+                if (clone_ret != Interop.MqttPlugin.ErrorCode.None)
+                {
+                    Log.Error(LogTag, "Failed to clone peer info.");
+                    return false;
+                }
+                peerInfoList.Add(new PeerInfo(clone));
+                return true;
+            }, IntPtr.Zero);
+            return peerInfoList;
+        }
+
+        protected abstract void OnConnectionResult(PeerInfo peerInfo, ConnectionResult result);
+        protected abstract byte[] OnDataReceived(byte[] data, PeerInfo peerInfo);
+        protected abstract void OnPayloadReceived(Payload data, PeerInfo peerInfo, PayloadTransferStatus status);
+        protected abstract void OnConnectionRequest(PeerInfo peerInfo);
+        protected abstract void OnDisconnected(PeerInfo peerInfo);
+
+        private bool disposedValue = false;
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposedValue)
+            {
+                if (disposing)
+                {
+                    _handle.Dispose();
+                }
+                disposedValue = true;
+            }
+        }
+
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_SERVER_SAFE_HANDLE[] =
+R"__cs_cb(
+    internal sealed class ServerSafeHandle : SafeHandle
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public ServerSafeHandle() : base(IntPtr.Zero, true)
+        {
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override bool IsInvalid
+        {
+            get { return this.DangerousGetHandle() == IntPtr.Zero; }
+        }
+
+        protected override bool ReleaseHandle()
+        {
+            Interop.MqttPluginServer.MqttPluginServerDestroy(this.handle);
+            SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+)__cs_cb";
+
+#endif  // IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_BASE_GEN_CB_H_
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_cs_interop_gen.cc b/idlc/gen_mqtt_plugin/mqtt_plugin_cs_interop_gen.cc
new file mode 100644 (file)
index 0000000..d4dba40
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_cs_interop_gen.h"
+
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_cs_interop_gen_cb.h"
+
+namespace tidl {
+
+MqttPluginCsInteropGen::MqttPluginCsInteropGen(std::shared_ptr<Document> doc,
+    std::shared_ptr<tidl::Transportable> trans) : CionPluginBase(doc, trans) {
+}
+
+void MqttPluginCsInteropGen::OnInitGen(std::ofstream& stream) {
+  GenUsing(stream);
+  stream << "internal static partial class Interop\n";
+  stream << "{\n";
+  GenLibraries(stream);
+  GenErrorCode(stream);
+  GenMalloc(stream);
+  GenInterop(stream);
+  stream << "}\n";
+}
+
+void MqttPluginCsInteropGen::OnFiniGen(std::ofstream& stream) {
+}
+
+void MqttPluginCsInteropGen::GenUsing(std::ofstream& stream) {
+  stream << CB_INTEROP_USING;
+}
+
+void MqttPluginCsInteropGen::GenLibraries(std::ofstream& stream) {
+  stream << CB_LIBRARIES;
+}
+
+void MqttPluginCsInteropGen::GenErrorCode(std::ofstream& stream) {
+  stream << CB_ERROR_CODE;
+}
+
+void MqttPluginCsInteropGen::GenMalloc(std::ofstream& stream) {
+  stream << CB_INTEROP_MALLOC;
+}
+
+void MqttPluginCsInteropGen::GenInterop(std::ofstream& stream) {
+  stream << CB_INTEROP_PAYLOAD;
+  stream << CB_INTEROP_PAYLOAD_ASYNC_RESULT;
+  stream << CB_INTEROP_PEER_INFO;
+  stream << CB_INTEROP_CONNECTION_RESULT;
+  switch (GetType()) {
+    // client
+    case 1:
+      stream << CB_INTEROP_CLIENT;
+      break;
+    // server
+    case 2:
+      stream << CB_INTEROP_SERVER;
+      break;
+    // group
+    case 3:
+      stream << CB_INTEROP_GROUP;
+      break;
+    default:
+      break;
+  }
+}
+
+}  // namespace tidl
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_cs_interop_gen.h b/idlc/gen_mqtt_plugin/mqtt_plugin_cs_interop_gen.h
new file mode 100644 (file)
index 0000000..c6fd1d9
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_INTEROP_GEN_H_
+#define IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_INTEROP_GEN_H_
+
+#include <memory>
+
+#include "idlc/gen_cion/cion_plugin_base.h"
+
+namespace tidl {
+
+class MqttPluginCsInteropGen : public CionPluginBase {
+ public:
+  explicit MqttPluginCsInteropGen(std::shared_ptr<Document> doc,
+      std::shared_ptr<tidl::Transportable> trans);
+  virtual ~MqttPluginCsInteropGen() = default;
+
+  void OnInitGen(std::ofstream& stream) override;
+  void OnFiniGen(std::ofstream& stream) override;
+
+ private:
+  void GenUsing(std::ofstream& stream);
+  void GenLibraries(std::ofstream& stream);
+  void GenErrorCode(std::ofstream& stream);
+  void GenMalloc(std::ofstream& stream);
+  void GenInterop(std::ofstream& stream);
+};
+
+}  // namespace tidl
+
+#endif  // IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_INTEROP_GEN_H_
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_cs_interop_gen_cb.h b/idlc/gen_mqtt_plugin/mqtt_plugin_cs_interop_gen_cb.h
new file mode 100644 (file)
index 0000000..090183a
--- /dev/null
@@ -0,0 +1,371 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_INTEROP_GEN_CB_H_
+#define IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_INTEROP_GEN_CB_H_
+
+constexpr char CB_INTEROP_USING[] =
+R"__cs_cb(
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Applications.MqttPlugin;
+
+using ErrorCode = Interop.MqttPlugin.ErrorCode;
+
+)__cs_cb";
+
+constexpr char CB_LIBRARIES[] =
+R"__cs_cb(
+    internal static partial class Libraries
+    {
+        public const string MqttPlugin = "libcion-mqtt-plugin.so.1";
+        public const string Libc = "libc.so.6";
+    }
+)__cs_cb";
+
+constexpr char CB_ERROR_CODE[] =
+R"__cs_cb(
+    internal static partial class MqttPlugin
+    {
+        internal enum ErrorCode : int
+        {
+            None = Tizen.Internals.Errors.ErrorCode.None,
+            IoError = Tizen.Internals.Errors.ErrorCode.IoError,
+            OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+            PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+            InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+            InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation,
+            AlreadyInProgress = Tizen.Internals.Errors.ErrorCode.AlreadyInProgress,
+            NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported,
+            TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut,
+            OperationFailed = -0x030C0000 | 0x01,
+        }
+    }
+)__cs_cb";
+
+constexpr char CB_INTEROP_MALLOC[] =
+R"__cs_cb(
+    internal static partial class MqttPlugin
+    {
+        [DllImport(Libraries.Libc, EntryPoint = "malloc")]
+        internal static extern IntPtr Malloc(int size);
+    }
+)__cs_cb";
+
+constexpr char CB_INTEROP_CLIENT[] =
+R"__cs_cb(
+    internal static partial class MqttPluginClient
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginClientServerDiscoveredCb(string serviceName, IntPtr peerInfo, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginClientConnectionResultCb(string serviceName, IntPtr peerInfo, IntPtr result, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginClientPayloadReceivedCb(string serviceName, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginClientDisconnectedCb(string serviceName, IntPtr peerInfo, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginClientPayloadAsyncResultCb(IntPtr result, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_create")]
+        internal static extern ErrorCode MqttPluginClientCreate(out ClientSafeHandle client, string serviceName, string brokerIp, int brokerPort, string userName, string password);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_destroy")]
+        internal static extern ErrorCode MqttPluginClientDestroy(IntPtr client);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_try_discovery")]
+        internal static extern ErrorCode MqttPluginClientTryDiscovery(ClientSafeHandle client, MqttPluginClientServerDiscoveredCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_stop_discovery")]
+        internal static extern ErrorCode MqttPluginClientStopDiscovery(ClientSafeHandle client);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_connect")]
+        internal static extern ErrorCode MqttPluginClientConnect(ClientSafeHandle client, PeerInfoSafeHandle peerInfo);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_disconnect")]
+        internal static extern ErrorCode MqttPluginClientDisconnect(ClientSafeHandle client);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_send_data")]
+        internal static extern ErrorCode MqttPluginClientSendData(ClientSafeHandle client, byte[] data, int dataSize, int timeout, out IntPtr returnData, out int returnDataSize);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_send_payload_async")]
+        internal static extern ErrorCode MqttPluginClientSendPayloadAsync(ClientSafeHandle client, PayloadSafeHandle payload, MqttPluginClientPayloadAsyncResultCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_add_connection_result_cb")]
+        internal static extern ErrorCode MqttPluginClientAddConnectionResultCb(ClientSafeHandle client, MqttPluginClientConnectionResultCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_remove_connection_result_cb")]
+        internal static extern ErrorCode MqttPluginClientRemoveConnectionResultCb(ClientSafeHandle client, MqttPluginClientConnectionResultCb cb);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_add_payload_received_cb")]
+        internal static extern ErrorCode MqttPluginClientAddPayloadReceivedCb(ClientSafeHandle client, MqttPluginClientPayloadReceivedCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_remove_payload_received_cb")]
+        internal static extern ErrorCode MqttPluginClientRemovePayloadReceivedCb(ClientSafeHandle client, MqttPluginClientPayloadReceivedCb cb);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_add_disconnected_cb")]
+        internal static extern ErrorCode MqttPluginClientAddDisconnectedCb(ClientSafeHandle client, MqttPluginClientDisconnectedCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_client_remove_disconnected_cb")]
+        internal static extern ErrorCode MqttPluginClientRemoveDisconnectedCb(ClientSafeHandle client, MqttPluginClientDisconnectedCb cb);
+    }
+)__cs_cb";
+
+constexpr char CB_INTEROP_CONNECTION_RESULT[] =
+R"__cs_cb(
+    internal static partial class MqttPluginConnectionResult
+    {
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_connection_result_get_status")]
+        internal static extern ErrorCode MqttPluginConnectionResultGetStatus(IntPtr result, out ConnectionStatus status);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_connection_result_get_reason")]
+        internal static extern ErrorCode MqttPluginConnectionResultGetReason(IntPtr result, out string reason);
+    }
+)__cs_cb";
+
+constexpr char CB_INTEROP_GROUP[] =
+R"__cs_cb(
+    internal static partial class MqttPluginGroup
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginGroupPayloadReceivedCb(IntPtr group, IntPtr peerInfo, IntPtr payload, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginGroupJoinedCb(string topicName, IntPtr peerInfo, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginGroupLeftCb(string topicName, IntPtr peerInfo, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_group_create")]
+        internal static extern ErrorCode MqttPluginGroupCreate(out GroupSafeHandle group, string topicName, string brokerIp, int brokerPort, string userName, string password);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_group_destroy")]
+        internal static extern ErrorCode MqttPluginGroupDestroy(IntPtr group);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_group_subscribe")]
+        internal static extern ErrorCode MqttPluginGroupSubscribe(GroupSafeHandle group);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_group_unsubscribe")]
+        internal static extern ErrorCode MqttPluginGroupUnsubscribe(GroupSafeHandle group);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_group_publish")]
+        internal static extern ErrorCode MqttPluginGroupPublish(GroupSafeHandle group, PayloadSafeHandle data);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_group_add_payload_received_cb")]
+        internal static extern ErrorCode MqttPluginGroupAddPayloadReceivedCb(GroupSafeHandle group, MqttPluginGroupPayloadReceivedCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_group_remove_payload_received_cb")]
+        internal static extern ErrorCode MqttPluginGroupRemovePayloadReceivedCb(GroupSafeHandle group, MqttPluginGroupPayloadReceivedCb cb);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_group_add_joined_cb")]
+        internal static extern ErrorCode MqttPluginGroupAddJoinedCb(GroupSafeHandle group, MqttPluginGroupJoinedCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_group_remove_joined_cb")]
+        internal static extern ErrorCode MqttPluginGroupRemoveJoinedCb(GroupSafeHandle group, MqttPluginGroupJoinedCb cb);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_group_add_left_cb")]
+        internal static extern ErrorCode MqttPluginGroupAddLeftCb(GroupSafeHandle group, MqttPluginGroupLeftCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_group_remove_left_cb")]
+        internal static extern ErrorCode MqttPluginGroupRemoveLeftCb(GroupSafeHandle group, MqttPluginGroupLeftCb cb);
+    }
+)__cs_cb";
+
+constexpr char CB_INTEROP_PAYLOAD[] =
+R"__cs_cb(
+    internal static partial class MqttPluginPayload
+    {
+        internal enum PayloadType : int
+        {
+            Data,
+            File,
+        }
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_create")]
+        internal static extern ErrorCode MqttPluginPayloadCreate(out PayloadSafeHandle payload, PayloadType type);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_destroy")]
+        internal static extern ErrorCode MqttPluginPayloadDestroy(IntPtr payload);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_get_type")]
+        internal static extern ErrorCode MqttPluginPayloadGetType(IntPtr payload, out PayloadType type);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_get_data")]
+        internal static extern ErrorCode MqttPluginPayloadGetData(PayloadSafeHandle payload, out IntPtr data, out int dataSize);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_set_data")]
+        internal static extern ErrorCode MqttPluginPayloadSetData(PayloadSafeHandle payload, byte[] data, int dataSize);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_save_as_file")]
+        internal static extern ErrorCode MqttPluginPayloadSaveAsFile(PayloadSafeHandle payload, string path);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_get_received_file_name")]
+        internal static extern ErrorCode MqttPluginPayloadGetReceivedFileName(PayloadSafeHandle payload, out string path);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_get_received_bytes")]
+        internal static extern ErrorCode MqttPluginPayloadGetReceivedBytes(PayloadSafeHandle payload, out UInt64 bytes);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_get_total_bytes")]
+        internal static extern ErrorCode MqttPluginPayloadGetTotalBytes(PayloadSafeHandle payload, out UInt64 bytes);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_set_file_path")]
+        internal static extern ErrorCode MqttPluginPayloadSetFilePath(PayloadSafeHandle payload, string path);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_get_payload_id")]
+        internal static extern ErrorCode MqttPluginPayloadGetPayloadID(PayloadSafeHandle payload, out string id);
+    }
+)__cs_cb";
+
+constexpr char CB_INTEROP_PAYLOAD_ASYNC_RESULT[] =
+R"__cs_cb(
+    internal static partial class MqttPluginPayloadAsyncResult
+    {
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_async_result_get_result")]
+        internal static extern ErrorCode MqttPluginPayloadAsyncResultGetResult(IntPtr result, out int code);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_async_result_get_peer_info")]
+        internal static extern ErrorCode MqttPluginPayloadAsyncResultGetPeerInfo(IntPtr result, out IntPtr peerInfo);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_payload_async_result_get_payload_id")]
+        internal static extern ErrorCode MqttPluginPayloadAsyncResultGetPayloadID(IntPtr result, out string payloadID);
+    }
+)__cs_cb";
+
+constexpr char CB_INTEROP_PEER_INFO[] =
+R"__cs_cb(
+    internal static partial class MqttPluginPeerInfo
+    {
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_peer_info_clone")]
+        internal static extern ErrorCode MqttPluginPeerInfoClone(IntPtr peerInfo, out PeerInfoSafeHandle peerInfoClone);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_peer_info_destroy")]
+        internal static extern ErrorCode MqttPluginPeerInfoDestroy(IntPtr peerInfo);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_peer_info_get_device_id")]
+        internal static extern ErrorCode MqttPluginPeerInfoGetDeviceId(PeerInfoSafeHandle peerInfo, out string deviceId);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_peer_info_get_device_name")]
+        internal static extern ErrorCode MqttPluginPeerInfoGetDeviceName(PeerInfoSafeHandle peerInfo, out string deviceName);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_peer_info_get_device_platform")]
+        internal static extern ErrorCode MqttPluginPeerInfoGetDevicePlatform(PeerInfoSafeHandle peerInfo, out string devicePlatform);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_peer_info_get_device_platform_version")]
+        internal static extern ErrorCode MqttPluginPeerInfoGetDevicePlatformVersion(PeerInfoSafeHandle peerInfo, out string devicePlatformVersion);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_peer_info_get_device_type")]
+        internal static extern ErrorCode MqttPluginPeerInfoGetDeviceType(PeerInfoSafeHandle peerInfo, out string deviceType);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_peer_info_get_app_id")]
+        internal static extern ErrorCode MqttPluginPeerInfoGetAppId(PeerInfoSafeHandle peerInfo, out string appId);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_peer_info_get_app_version")]
+        internal static extern ErrorCode MqttPluginPeerInfoGetAppVersion(PeerInfoSafeHandle peerInfo, out string appVersion);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_peer_info_get_uuid")]
+        internal static extern ErrorCode MqttPluginPeerInfoGetUuid(PeerInfoSafeHandle peerInfo, out string uuid);
+    }
+)__cs_cb";
+
+constexpr char CB_INTEROP_SERVER[] =
+R"__cs_cb(
+    internal static partial class MqttPluginServer
+    {
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate bool MqttPluginServerPeerInfoIterator(IntPtr peerInfo, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginServerPayloadAsyncResultCb(IntPtr result, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginServerConnectionResultCb(string serviceName, IntPtr peerInfo, IntPtr result, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginServerDataReceivedCb(string serviceName, IntPtr peerInfo, IntPtr data, int dataSize, out IntPtr returnData, out int returnDataSize, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginServerPayloadReceivedCb(string serviceName, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginServerConnectionRequestCb(string serviceName, IntPtr peerInfo, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginServerErrorReportedCb(string serviceName, IntPtr peerInfo, int error, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void MqttPluginServerDisconnectedCb(string serviceName, IntPtr peerInfo, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_create")]
+        internal static extern ErrorCode MqttPluginServerCreate(out ServerSafeHandle server, string serviceName, string displayName, string brokerIp, int brokerPort, string userName, string password);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_destroy")]
+        internal static extern ErrorCode MqttPluginServerDestroy(IntPtr server);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_listen")]
+        internal static extern ErrorCode MqttPluginServerListen(ServerSafeHandle server, MqttPluginServerConnectionRequestCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_stop")]
+        internal static extern ErrorCode MqttPluginServerStop(ServerSafeHandle server);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_accept")]
+        internal static extern ErrorCode MqttPluginServerAccept(ServerSafeHandle server, PeerInfoSafeHandle peerInfo);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_reject")]
+        internal static extern ErrorCode MqttPluginServerReject(ServerSafeHandle server, PeerInfoSafeHandle peerInfo, string reason);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_disconnect")]
+        internal static extern ErrorCode MqttPluginServerDisconnect(ServerSafeHandle server, PeerInfoSafeHandle peerInfo);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_send_payload_async")]
+        internal static extern ErrorCode MqttPluginServerSendPayloadAsync(ServerSafeHandle server, PeerInfoSafeHandle peerInfo, PayloadSafeHandle payload, MqttPluginServerPayloadAsyncResultCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_foreach_connected_peer_info")]
+        internal static extern ErrorCode MqttPluginServerForeachConnectedPeerInfo(ServerSafeHandle server, MqttPluginServerPeerInfoIterator cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_add_connection_result_cb")]
+        internal static extern ErrorCode MqttPluginServerAddConnectionResultCb(ServerSafeHandle server, MqttPluginServerConnectionResultCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_remove_connection_result_cb")]
+        internal static extern ErrorCode MqttPluginServerRemoveConnectionResultCb(ServerSafeHandle server, MqttPluginServerConnectionResultCb cb);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_add_payload_received_cb")]
+        internal static extern ErrorCode MqttPluginServerAddPayloadReceivedCb(ServerSafeHandle server, MqttPluginServerPayloadReceivedCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_remove_payload_received_cb")]
+        internal static extern ErrorCode MqttPluginServerRemovePayloadReceivedCb(ServerSafeHandle server, MqttPluginServerPayloadReceivedCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_set_data_received_cb")]
+        internal static extern ErrorCode MqttPluginServerSetDataReceivedCb(ServerSafeHandle server, MqttPluginServerDataReceivedCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_unset_data_received_cb")]
+        internal static extern ErrorCode MqttPluginServerUnsetDataReceivedCb(ServerSafeHandle server, MqttPluginServerDataReceivedCb cb);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_add_disconnected_cb")]
+        internal static extern ErrorCode MqttPluginServerAddDisconnectedCb(ServerSafeHandle server, MqttPluginServerDisconnectedCb cb, IntPtr userData);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_remove_disconnected_cb")]
+        internal static extern ErrorCode MqttPluginServerRemoveDisconnectedCb(ServerSafeHandle server, MqttPluginServerDisconnectedCb cb);
+
+        [DllImport(Libraries.MqttPlugin, EntryPoint = "mqtt_plugin_server_set_display_name")]
+        internal static extern ErrorCode MqttPluginServerSetDisplayName(ServerSafeHandle server, string displayName);
+    }
+)__cs_cb";
+
+#endif  // IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_INTEROP_GEN_CB_H_
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_cs_transportable.cc b/idlc/gen_mqtt_plugin/mqtt_plugin_cs_transportable.cc
new file mode 100644 (file)
index 0000000..342c194
--- /dev/null
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_cs_transportable.h"
+
+#include <utility>
+
+#include "idlc/gen/replace_all.h"
+
+namespace {
+
+constexpr const char __USING[] =
+R"__cs_cb(
+using System;
+using System.Collections.Generic;
+using Tizen.Applications;
+using Tizen.Applications.MqttPlugin;
+using Tizen.Applications.RPCPort;
+)__cs_cb";
+
+constexpr const char __FILE_SEND[] =
+R"__cs_cb(if (path == null)
+  throw new ArgumentException("Invalid path");
+
+  Payload fp = new FilePayload(<FILE_PATH>);
+  base.SendPayloadAsync(fp);
+)__cs_cb";
+
+constexpr const char __CLIENT_CTOR[] =
+R"__cs_cb(
+            public ##(string serviceName, string brokerIp, int brokerPort, string userName, string password) : base(serviceName, brokerIp, brokerPort, userName, password)
+            {
+                ServiceName = serviceName;
+            }
+)__cs_cb";
+
+constexpr const char __GROUP_CTOR[] =
+R"__cs_cb(
+            public ##(string topicName, string brokerIp, int brokerPort, string userName, string password) : base(topicName, brokerIp, brokerPort, userName, password)
+            {
+                TopicName = topicName;
+                try
+                {
+                    base.Subscribe();
+                }
+                catch
+                {
+                    throw;
+                }
+            }
+)__cs_cb";
+
+constexpr const char __SERVER_CTOR[] =
+R"__cs_cb(
+            public ##(string serviceName, string displayName, string brokerIp, int brokerPort, string userName, string password) : base(serviceName, displayName, brokerIp, brokerPort, userName, password)
+            {
+            }
+)__cs_cb";
+
+}  // namespace
+
+namespace tidl {
+
+std::string MqttPluginCsTransportable::GenInclude() const {
+  return __USING;
+}
+
+std::string MqttPluginCsTransportable::GenFileSend(std::string path) const {
+  return std::string(ReplaceAll(__FILE_SEND, {
+      { "<FILE_PATH>", path } }));
+}
+
+std::string MqttPluginCsTransportable::GenGroupType() const {
+  return "GroupBase";
+}
+
+std::string MqttPluginCsTransportable::GenPayloadTransferStatusType() const {
+  return "PayloadTransferStatus";
+}
+
+std::string MqttPluginCsTransportable::GenPeerInfoType() const {
+  return "PeerInfo";
+}
+
+std::string MqttPluginCsTransportable::GenPayloadType() const {
+  return "Payload";
+}
+
+std::string MqttPluginCsTransportable::GenClientType() const {
+  return "ClientBase";
+}
+
+std::string MqttPluginCsTransportable::GenServerType() const {
+  return "ServerBase";
+}
+
+std::string MqttPluginCsTransportable::GenClientExtraHeader() const {
+  return "";
+}
+
+std::string MqttPluginCsTransportable::GenClientExtraBody() const {
+  return "";
+}
+
+std::string MqttPluginCsTransportable::GenServerExtraHeader() const {
+  return "";
+}
+
+std::string MqttPluginCsTransportable::GenServerExtraBody() const {
+  return "";
+}
+
+std::string MqttPluginCsTransportable::GenPayloadTypeData() const {
+  return "PayloadType.DataPayload";
+}
+
+std::string MqttPluginCsTransportable::GenPayloadTypeFile() const {
+  return "PayloadType.FilePayload";
+}
+
+std::string MqttPluginCsTransportable::GenClientBaseCtor(
+    const Interface& iface) const {
+  std::string ctor(ReplaceAll(__CLIENT_CTOR, "##", iface.GetID()));
+  return ctor;
+}
+
+std::string MqttPluginCsTransportable::GenGroupBaseCtor(
+    const Interface& iface) const {
+  std::string ctor(ReplaceAll(__GROUP_CTOR, "##", iface.GetID()));
+  return ctor;
+}
+
+std::string MqttPluginCsTransportable::GenServerBaseCtor(
+    const Interface& iface) const {
+  std::string ctor(ReplaceAll(__SERVER_CTOR, "##", iface.GetID()));
+  return ctor;
+}
+
+}  // namespace tidl
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_cs_transportable.h b/idlc/gen_mqtt_plugin/mqtt_plugin_cs_transportable.h
new file mode 100644 (file)
index 0000000..056094f
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_TRANSPORTABLE_H_
+#define IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_TRANSPORTABLE_H_
+
+#include <string>
+
+#include "idlc/gen_cion/cs_transportable.h"
+
+namespace tidl {
+
+class MqttPluginCsTransportable : public CsTransportable {
+ public:
+  virtual ~MqttPluginCsTransportable() = default;
+  std::string GenInclude() const override;
+  std::string GenFileSend(std::string path) const override;
+  std::string GenGroupType() const override;
+  std::string GenPayloadTransferStatusType() const override;
+  std::string GenPeerInfoType() const override;
+  std::string GenPayloadType() const override;
+  std::string GenClientType() const override;
+  std::string GenServerType() const override;
+  std::string GenClientExtraHeader() const override;
+  std::string GenClientExtraBody() const override;
+  std::string GenServerExtraHeader() const override;
+  std::string GenServerExtraBody() const override;
+  std::string GenPayloadTypeData() const override;
+  std::string GenPayloadTypeFile() const override;
+  std::string GenClientBaseCtor(const Interface& iface) const override;
+  std::string GenGroupBaseCtor(const Interface& iface) const override;
+  std::string GenServerBaseCtor(const Interface& iface) const override;
+};
+
+}  // namespace tidl
+
+#endif  // IDLC_GEN_MQTT_PLUGIN_MQTT_PLUGIN_CS_TRANSPORTABLE_H_
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_internal_body_gen.cc b/idlc/gen_mqtt_plugin/mqtt_plugin_internal_body_gen.cc
new file mode 100644 (file)
index 0000000..9bce062
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <algorithm>
+
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_internal_body_gen.h"
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_internal_body_gen_cb.h"
+
+namespace tidl {
+
+MqttPluginInternalBodyGen::MqttPluginInternalBodyGen(std::shared_ptr<Document> doc, std::shared_ptr<tidl::Transportable> trans)
+    : CCionBodyGeneratorBase(doc, trans) {
+}
+
+void MqttPluginInternalBodyGen::OnInitGen(std::ofstream& stream) {
+  GenVersion(stream);
+  GenGNUSourceDefinition(stream);
+  GenIncludeHeader(stream);
+  GenLogTag(stream, std::string("MQTT_PLUGIN_INTERNAL"));
+  GenLogDefinition(stream);
+  GenBody(stream);
+  GenPluginInit(stream);
+}
+
+
+void MqttPluginInternalBodyGen::GenPluginInit(std::ofstream& stream) {
+  stream << CB_PLUGIN_INIT_BASE;
+}
+
+void MqttPluginInternalBodyGen::GenIncludeHeader(std::ofstream& stream) {
+  stream << tidl::ReplaceAll(CB_INTERNAL_HEADER, "<FILENAME>", GetFileNamespace());
+}
+
+void MqttPluginInternalBodyGen::GenLoadModule(std::ofstream& stream) {
+  std::string code;
+  code = CB_LOAD_MOUDLE_BASE;
+  code += CB_LOAD_MOUDLE_PAYLOAD;
+  code += CB_LOAD_MOUDLE_PEERINFO;
+  code += CB_LOAD_MOUDLE_CONNECTION;
+
+  switch (GetType()) {
+    case 1:
+    {
+      code += CB_LOAD_MOUDLE_CLIENT;
+      break;
+    }
+    case 2:
+    {
+      code += CB_LOAD_MOUDLE_SERVER;
+      break;
+    }
+    case 3:
+    {
+      code += CB_LOAD_MOUDLE_GROUP;
+      break;
+    }
+    default:
+      break;
+  }
+   code += CB_LOAD_MOUDLE_BASE_RETURN;
+
+   stream << tidl::ReplaceAll(code, "<PREFIX>", GetHandlePrefix());
+}
+
+void MqttPluginInternalBodyGen::GenBody(std::ofstream& stream) {
+  stream << tidl::ReplaceAll(CB_BODY_BASE, "<PREFIX>", GetHandlePrefix());
+  switch (GetType()) {
+    case 1:
+    {
+      stream << tidl::ReplaceAll(CB_BODY_CLIENT, "<PREFIX>", GetHandlePrefix());
+      break;
+    }
+    case 2:
+    {
+      stream << tidl::ReplaceAll(CB_BODY_SERVER, "<PREFIX>", GetHandlePrefix());
+      break;
+    }
+    case 3:
+    {
+      stream << tidl::ReplaceAll(CB_BODY_GROUP, "<PREFIX>", GetHandlePrefix());
+      break;
+    }
+
+    default:
+      break;
+  }
+
+  GenLoadModule(stream);
+}
+
+void MqttPluginInternalBodyGen::OnFiniGen(std::ofstream& stream) {
+}
+
+}  // namespace tidl
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_internal_body_gen.h b/idlc/gen_mqtt_plugin/mqtt_plugin_internal_body_gen.h
new file mode 100644 (file)
index 0000000..a0bd005
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_MQTT_PLUGIN_C_INTERNAL_BODY_GEN_H_
+#define IDLC_MQTT_PLUGIN_C_INTERNAL_BODY_GEN_H_
+
+#include <memory>
+#include <string>
+
+#include "idlc/gen_cion/c_cion_body_gen_base.h"
+
+namespace tidl {
+
+class MqttPluginInternalBodyGen : public CCionBodyGeneratorBase {
+ public:
+  explicit MqttPluginInternalBodyGen(std::shared_ptr<Document> doc, std::shared_ptr<tidl::Transportable> trans);
+  virtual ~MqttPluginInternalBodyGen() = default;
+
+  void OnInitGen(std::ofstream& stream) override;
+  void OnFiniGen(std::ofstream& stream) override;
+
+ private:
+  void GenPluginInit(std::ofstream& stream);
+  void GenIncludeHeader(std::ofstream& stream);
+  void GenLoadModule(std::ofstream& stream);
+  void GenBody(std::ofstream& stream);
+};
+
+}  // namespace tidl
+
+#endif  // IDLC_MQTT_PLUGIN_C_INTERNAL_BODY_GEN_H_
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_internal_body_gen_cb.h b/idlc/gen_mqtt_plugin/mqtt_plugin_internal_body_gen_cb.h
new file mode 100644 (file)
index 0000000..7f47ecf
--- /dev/null
@@ -0,0 +1,523 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_C_MQTT_PLUGIN_GEN_INTERNAL_BODY_GEN_CB_H_
+#define IDLC_C_MQTT_PLUGIN_GEN_INTERNAL_BODY_GEN_CB_H_
+
+constexpr const char CB_INTERNAL_HEADER[] =
+R"__c_cb(
+
+#include <dlfcn.h>
+#include <stdio.h>
+#include <dlog.h>
+
+#include "<FILENAME>.h"
+
+)__c_cb";
+
+constexpr const char CB_LOAD_MOUDLE_SERVER[] =
+R"__c_cb(
+  if (!__load_server_channel())
+    goto out;
+)__c_cb";
+
+constexpr const char CB_LOAD_MOUDLE_PAYLOAD[] =
+R"__c_cb(
+  if (!__load_payload())
+    goto out;
+)__c_cb";
+
+constexpr const char CB_LOAD_MOUDLE_PEERINFO[] =
+R"__c_cb(
+  if (!__load_peerinfo())
+    goto out;
+)__c_cb";
+
+constexpr const char CB_LOAD_MOUDLE_CONNECTION[] =
+R"__c_cb(
+  if (!__load_connection())
+    goto out;
+)__c_cb";
+
+constexpr const char CB_LOAD_MOUDLE_CLIENT[] =
+R"__c_cb(
+  if (!__load_client_channel())
+    goto out;
+)__c_cb";
+
+constexpr const char CB_LOAD_MOUDLE_GROUP[] =
+R"__c_cb(
+  if (!__load_group_channel())
+    goto out;
+)__c_cb";
+
+constexpr const char CB_PLUGIN_INIT_BASE[] =
+R"__c_cb(
+PLUGIN_CTOR static void _plugin_init(void)
+{
+  __load_module();
+}
+)__c_cb";
+
+constexpr const char CB_LOAD_MOUDLE_BASE[] =
+R"__c_cb(
+static void __load_module() {
+  plugin_handle = dlopen(LIBMQTT_PLUGIN_INFO, RTLD_LAZY | RTLD_GLOBAL);
+  if (!plugin_handle) {
+    LOGE("Failed to load - %s", dlerror());
+    return;
+  }
+)__c_cb";
+
+constexpr const char CB_LOAD_MOUDLE_BASE_RETURN[] =
+R"__c_cb(
+  return;
+
+out:
+
+  dlclose(plugin_handle);
+}
+)__c_cb";
+
+constexpr const char CB_BODY_BASE[] =
+R"__c_cb(
+
+#define LIBMQTT_PLUGIN_INFO "/usr/lib/libcion-mqtt-plugin.so.1"
+static void *plugin_handle;
+
+#define PLUGIN_CTOR __attribute__((constructor))
+
+static bool __load_payload() {
+  <PREFIX>_payload_create = dlsym(plugin_handle,
+      "mqtt_plugin_payload_create");
+  if (!<PREFIX>_payload_create) {
+    LOGE("Failed to find plugin_payload_create");
+    return false;
+  }
+
+  <PREFIX>_payload_destroy = dlsym(plugin_handle,
+      "mqtt_plugin_payload_destroy");
+  if (!<PREFIX>_payload_destroy) {
+    LOGE("Failed to find plugin_payload_destroy");
+    return false;
+  }
+
+  <PREFIX>_payload_get_type = dlsym(plugin_handle,
+      "mqtt_plugin_payload_get_type");
+  if (!<PREFIX>_payload_get_type) {
+    LOGE("Failed to find plugin_payload_get_type");
+    return false;
+  }
+
+  <PREFIX>_payload_get_data = dlsym(plugin_handle,
+      "mqtt_plugin_payload_get_data");
+  if (!<PREFIX>_payload_get_data) {
+    LOGE("Failed to find plugin_payload_get_data");
+    return false;
+  }
+
+  <PREFIX>_payload_set_data = dlsym(plugin_handle,
+      "mqtt_plugin_payload_set_data");
+  if (!<PREFIX>_payload_set_data) {
+    LOGE("Failed to find plugin_payload_set_data");
+    return false;
+  }
+
+  <PREFIX>_payload_save_as_file = dlsym(plugin_handle,
+      "mqtt_plugin_payload_save_as_file");
+  if (!<PREFIX>_payload_save_as_file) {
+    LOGE("Failed to find plugin_payload_save_as_file");
+    return false;
+  }
+
+  <PREFIX>_payload_get_received_file_name = dlsym(plugin_handle,
+      "mqtt_plugin_payload_get_received_file_name");
+  if (!<PREFIX>_payload_get_received_file_name) {
+    LOGE("Failed to find plugin_payload_get_received_file_name");
+    return false;
+  }
+
+  <PREFIX>_payload_get_received_bytes = dlsym(plugin_handle,
+      "mqtt_plugin_payload_get_received_bytes");
+  if (!<PREFIX>_payload_get_received_bytes) {
+    LOGE("Failed to init plugin_payload_get_received_bytes");
+    return false;
+  }
+
+  <PREFIX>_payload_get_total_bytes = dlsym(plugin_handle,
+      "mqtt_plugin_payload_get_total_bytes");
+  if (!<PREFIX>_payload_get_total_bytes) {
+    LOGE("Failed to find plugin_payload_get_total_bytes");
+    return false;
+  }
+
+  <PREFIX>_payload_set_file_path = dlsym(plugin_handle,
+      "mqtt_plugin_payload_set_file_path");
+  if (!<PREFIX>_payload_set_file_path) {
+    LOGE("Failed to find plugin_payload_set_file_path");
+    return false;
+  }
+
+  <PREFIX>_payload_get_payload_id = dlsym(plugin_handle,
+      "mqtt_plugin_payload_get_payload_id");
+  if (!<PREFIX>_payload_get_payload_id) {
+    LOGE("Failed to find plugin_payload_get_payload_id");
+    return false;
+  }
+
+  return true;
+}
+
+static bool __load_peerinfo() {
+  <PREFIX>_peer_info_clone = dlsym(plugin_handle,
+      "mqtt_plugin_peer_info_clone");
+  if (!<PREFIX>_peer_info_clone) {
+    LOGE("Failed to find plugin_peer_info_clone");
+    return false;
+  }
+
+  <PREFIX>_peer_info_destroy = dlsym(plugin_handle,
+      "mqtt_plugin_peer_info_destroy");
+  if (!<PREFIX>_peer_info_destroy) {
+    LOGE("Failed to find plugin_peer_info_destroy");
+    return false;
+  }
+
+  <PREFIX>_peer_info_get_device_id = dlsym(plugin_handle,
+      "mqtt_plugin_peer_info_get_device_id");
+  if (!<PREFIX>_peer_info_get_device_id) {
+    LOGE("Failed to find plugin_peer_info_get_device_id");
+    return false;
+  }
+
+  <PREFIX>_peer_info_get_device_name = dlsym(plugin_handle,
+      "mqtt_plugin_peer_info_get_device_name");
+  if (!<PREFIX>_peer_info_get_device_name) {
+    LOGE("Failed to find plugin_peer_info_get_device_name");
+    return false;
+  }
+
+  <PREFIX>_peer_info_get_device_platform = dlsym(plugin_handle,
+      "mqtt_plugin_peer_info_get_device_platform");
+  if (!<PREFIX>_peer_info_get_device_platform) {
+    LOGE("Failed to find plugin_peer_info_get_device_platform");
+    return false;
+  }
+
+  <PREFIX>_peer_info_get_device_platform_version = dlsym(plugin_handle,
+      "mqtt_plugin_peer_info_get_device_platform_version");
+  if (!<PREFIX>_peer_info_get_device_platform_version) {
+    LOGE("Failed to find plugin_peer_info_get_device_platform_version");
+    return false;
+  }
+
+  <PREFIX>_peer_info_get_device_type = dlsym(plugin_handle,
+      "mqtt_plugin_peer_info_get_device_type");
+  if (!<PREFIX>_peer_info_get_device_type) {
+    LOGE("Failed to find plugin_peer_info_get_device_type");
+    return false;
+  }
+
+  <PREFIX>_peer_info_get_app_id = dlsym(plugin_handle,
+      "mqtt_plugin_peer_info_get_app_id");
+  if (!<PREFIX>_peer_info_get_app_id) {
+    LOGE("Failed to init plugin_peer_info_get_app_id");
+    return false;
+  }
+
+  <PREFIX>_peer_info_get_app_version = dlsym(plugin_handle,
+      "mqtt_plugin_peer_info_get_app_version");
+  if (!<PREFIX>_peer_info_get_app_version) {
+    LOGE("Failed to find plugin_peer_info_get_app_version");
+    return false;
+  }
+
+  <PREFIX>_peer_info_get_uuid = dlsym(plugin_handle,
+      "mqtt_plugin_peer_info_get_uuid");
+  if (!<PREFIX>_peer_info_get_uuid) {
+    LOGE("Failed to find plugin_peer_info_get_uuid");
+    return false;
+  }
+
+  <PREFIX>_peer_info_get_display_name = dlsym(plugin_handle,
+      "mqtt_plugin_peer_info_get_display_name");
+  if (!<PREFIX>_peer_info_get_display_name) {
+    LOGE("Failed to find plugin_peer_info_get_display_name");
+    return false;
+  }
+
+  return true;
+}
+
+static bool __load_connection() {
+  <PREFIX>_connection_result_get_status = dlsym(plugin_handle,
+      "mqtt_plugin_connection_result_get_status");
+  if (!<PREFIX>_connection_result_get_status) {
+    LOGE("Failed to find plugin_connection_result_get_status");
+    return false;
+  }
+
+  <PREFIX>_connection_result_get_reason = dlsym(plugin_handle,
+      "mqtt_plugin_connection_result_get_reason");
+  if (!<PREFIX>_connection_result_get_reason) {
+    LOGE("Failed to find plugin_connection_result_get_reason");
+    return false;
+  }
+
+  return true;
+}
+)__c_cb";
+
+constexpr const char CB_BODY_GROUP[] =
+R"__c_cb(
+static bool __load_group_channel() {
+  <PREFIX>_group_create = dlsym(plugin_handle, "mqtt_plugin_group_create");
+  if (!<PREFIX>_group_create) {
+    LOGE("Failed to find plugin_group_create");
+    return false;
+  }
+
+  <PREFIX>_group_destroy = dlsym(plugin_handle,
+      "mqtt_plugin_group_destroy");
+  if (!<PREFIX>_group_destroy) {
+    LOGE("Failed to find plugin_group_destroy");
+    return false;
+  }
+
+  <PREFIX>_group_subscribe = dlsym(plugin_handle,
+      "mqtt_plugin_group_subscribe");
+  if (!<PREFIX>_group_subscribe) {
+    LOGE("Failed to find plugin_group_subscribe");
+    return false;
+  }
+
+  <PREFIX>_group_unsubscribe = dlsym(plugin_handle,
+      "mqtt_plugin_group_unsubscribe");
+  if (!<PREFIX>_group_unsubscribe) {
+    LOGE("Failed to find plugin_group_unsubscribe");
+    return false;
+  }
+
+  <PREFIX>_group_publish = dlsym(plugin_handle,
+      "mqtt_plugin_group_publish");
+  if (!<PREFIX>_group_publish) {
+    LOGE("Failed to find plugin_group_publish");
+    return false;
+  }
+
+  <PREFIX>_group_add_payload_received_cb = dlsym(plugin_handle,
+      "mqtt_plugin_group_add_payload_received_cb");
+  if (!<PREFIX>_group_add_payload_received_cb) {
+    LOGE("Failed to find plugin_group_add_payload_received_cb");
+    return false;
+  }
+
+  <PREFIX>_group_add_joined_cb = dlsym(plugin_handle,
+      "mqtt_plugin_group_add_joined_cb");
+  if (!<PREFIX>_group_add_joined_cb) {
+    LOGE("Failed to find plugin_group_add_joined_cb");
+    return false;
+  }
+
+  <PREFIX>_group_add_left_cb = dlsym(plugin_handle,
+      "mqtt_plugin_group_add_left_cb");
+  if (!<PREFIX>_group_add_left_cb) {
+    LOGE("Failed to init plugin_group_add_left_cb");
+    return false;
+  }
+
+  return true;
+}
+)__c_cb";
+
+constexpr const char CB_BODY_CLIENT[] =
+R"__c_cb(
+static bool __load_client_channel() {
+  <PREFIX>_client_create = dlsym(plugin_handle, "mqtt_plugin_client_create");
+  if (!<PREFIX>_client_create) {
+    LOGE("Failed to find plugin_client_create");
+    return false;
+  }
+
+  <PREFIX>_client_destroy = dlsym(plugin_handle,
+      "mqtt_plugin_client_destroy");
+  if (!<PREFIX>_client_destroy) {
+    LOGE("Failed to find plugin_client_destroy");
+    return false;
+  }
+
+  <PREFIX>_client_try_discovery = dlsym(plugin_handle,
+      "mqtt_plugin_client_try_discovery");
+  if (!<PREFIX>_client_try_discovery) {
+    LOGE("Failed to find plugin_client_try_discovery");
+    return false;
+  }
+
+  <PREFIX>_client_stop_discovery = dlsym(plugin_handle,
+      "mqtt_plugin_client_stop_discovery");
+  if (!<PREFIX>_client_stop_discovery) {
+    LOGE("Failed to find plugin_client_stop_discovery");
+    return false;
+  }
+
+  <PREFIX>_client_connect = dlsym(plugin_handle,
+      "mqtt_plugin_client_connect");
+  if (!<PREFIX>_client_connect) {
+    LOGE("Failed to find plugin_client_connect");
+    return false;
+  }
+
+  <PREFIX>_client_disconnect = dlsym(plugin_handle,
+      "mqtt_plugin_client_disconnect");
+  if (!<PREFIX>_client_disconnect) {
+    LOGE("Failed to find plugin_client_disconnect");
+    return false;
+  }
+
+  <PREFIX>_client_send_data = dlsym(plugin_handle,
+      "mqtt_plugin_client_send_data");
+  if (!<PREFIX>_client_send_data) {
+    LOGE("Failed to find plugin_client_send_data");
+    return false;
+  }
+
+  <PREFIX>_client_send_payload_async = dlsym(plugin_handle,
+      "mqtt_plugin_client_send_payload_async");
+  if (!<PREFIX>_client_send_payload_async) {
+    LOGE("Failed to init plugin_client_send_payload_async");
+    return false;
+  }
+
+  <PREFIX>_client_add_connection_result_cb = dlsym(plugin_handle,
+      "mqtt_plugin_client_add_connection_result_cb");
+  if (!<PREFIX>_client_add_connection_result_cb) {
+    LOGE("Failed to find plugin_client_add_connection_result_cb");
+    return false;
+  }
+
+  <PREFIX>_client_add_payload_received_cb = dlsym(plugin_handle,
+        "mqtt_plugin_client_add_payload_received_cb");
+  if (!<PREFIX>_client_add_payload_received_cb) {
+    LOGE("Failed to find plugin_client_add_payload_received_cb");
+    return false;
+  }
+
+  <PREFIX>_client_add_disconnected_cb = dlsym(plugin_handle,
+      "mqtt_plugin_client_add_disconnected_cb");
+  if (!<PREFIX>_client_add_disconnected_cb) {
+    LOGE("Failed to find plugin_client_add_disconnected_cb");
+    return false;
+  }
+
+  return true;
+}
+)__c_cb";
+
+constexpr const char CB_BODY_SERVER[] =
+R"__c_cb(
+static bool __load_server_channel() {
+  <PREFIX>_server_create = dlsym(plugin_handle, "mqtt_plugin_server_create");
+  if (!<PREFIX>_server_create) {
+    LOGE("Failed to find plugin_server_create");
+    return false;
+  }
+
+  <PREFIX>_server_add_connection_result_cb = dlsym(plugin_handle,
+      "mqtt_plugin_server_add_connection_result_cb");
+  if (!<PREFIX>_server_add_connection_result_cb) {
+    LOGE("Failed to find plugin_server_add_connection_result_cb");
+    return false;
+  }
+
+  <PREFIX>_server_add_payload_received_cb = dlsym(plugin_handle,
+      "mqtt_plugin_server_add_payload_received_cb");
+  if (!<PREFIX>_server_add_payload_received_cb) {
+    LOGE("Failed to find plugin_server_add_payload_received_cb");
+    return false;
+  }
+
+  <PREFIX>_server_add_disconnected_cb = dlsym(plugin_handle,
+      "mqtt_plugin_server_add_disconnected_cb");
+  if (!<PREFIX>_server_add_disconnected_cb) {
+    LOGE("Failed to find plugin_server_add_disconnected_cb");
+    return false;
+  }
+
+  <PREFIX>_server_set_data_received_cb = dlsym(plugin_handle,
+      "mqtt_plugin_server_set_data_received_cb");
+  if (!<PREFIX>_server_set_data_received_cb) {
+    LOGE("Failed to find plugin_server_set_data_received_cb");
+    return false;
+  }
+
+  <PREFIX>_server_listen = dlsym(plugin_handle, "mqtt_plugin_server_listen");
+  if (!<PREFIX>_server_listen) {
+    LOGE("Failed to find plugin_server_listen");
+    return false;
+  }
+
+  <PREFIX>_server_foreach_connected_peer_info = dlsym(plugin_handle,
+      "mqtt_plugin_server_foreach_connected_peer_info");
+  if (!<PREFIX>_server_foreach_connected_peer_info) {
+    LOGE("Failed to find <PREFIX>_server_foreach_connected_peer_info");
+    return false;
+  }
+
+  <PREFIX>_server_accept = dlsym(plugin_handle, "mqtt_plugin_server_accept");
+  if (!<PREFIX>_server_accept) {
+    LOGE("Failed to init plugin_server_accept");
+    return false;
+  }
+
+  <PREFIX>_server_reject = dlsym(plugin_handle, "mqtt_plugin_server_reject");
+  if (!<PREFIX>_server_reject) {
+    LOGE("Failed to find plugin_server_reject");
+    return false;
+  }
+
+  <PREFIX>_server_set_display_name = dlsym(plugin_handle,
+        "mqtt_plugin_server_set_display_name");
+  if (!<PREFIX>_server_set_display_name) {
+    LOGE("Failed to find plugin_server_set_display_name");
+    return false;
+  }
+
+  <PREFIX>_server_send_payload_async = dlsym(plugin_handle,
+      "mqtt_plugin_server_send_payload_async");
+  if (!<PREFIX>_server_send_payload_async) {
+    LOGE("Failed to find plugin_server_send_payload_async");
+    return false;
+  }
+
+  <PREFIX>_server_destroy = dlsym(plugin_handle,
+      "mqtt_plugin_server_destroy");
+  if (!<PREFIX>_server_destroy) {
+    LOGE("Failed to find plugin_server_destroy");
+    return false;
+  }
+
+  <PREFIX>_server_disconnect = dlsym(plugin_handle,
+      "mqtt_plugin_server_disconnect");
+  if (!<PREFIX>_server_disconnect) {
+    LOGE("Failed to find plugin_server_disconnect");
+    return false;
+  }
+
+  return true;
+}
+)__c_cb";
+
+#endif  // IDLC_C_MQTT_PLUGIN_GEN_INTERNAL_BODY_GEN_CB_H_
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_internal_header_gen.cc b/idlc/gen_mqtt_plugin/mqtt_plugin_internal_header_gen.cc
new file mode 100644 (file)
index 0000000..d9b3ada
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_internal_header_gen.h"
+
+namespace {
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_internal_header_gen_cb.h"
+}
+
+namespace tidl {
+
+MqttPluginInternalHeaderGen::MqttPluginInternalHeaderGen(std::shared_ptr<Document> doc, std::shared_ptr<tidl::Transportable> trans)
+    : CCionHeaderGeneratorBase(doc, trans) {}
+
+void MqttPluginInternalHeaderGen::OnInitGen(std::ofstream& stream) {
+  GenVersion(stream);
+
+  stream << tidl::ReplaceAll(CB_HEADER_START, "<PREFIX>", GetHandlePrefix());
+  stream << tidl::ReplaceAll(CB_HEADER_DEF_COMMON, "<PREFIX>", GetHandlePrefix());
+
+  switch (GetType()) {
+    case 1:
+    {
+      stream << tidl::ReplaceAll(CB_HEADER_DEF_CLIENT, "<PREFIX>", GetHandlePrefix());
+      stream << tidl::ReplaceAll(CB_HEADER_FUN_CLIENT, "<PREFIX>", GetHandlePrefix());
+      break;
+    }
+    case 2:
+    {
+      stream << tidl::ReplaceAll(CB_HEADER_DEF_SERVER, "<PREFIX>", GetHandlePrefix());
+      stream << tidl::ReplaceAll(CB_HEADER_FUN_SERVER, "<PREFIX>", GetHandlePrefix());
+      break;
+    }
+    case 3:
+    {
+      stream << tidl::ReplaceAll(CB_HEADER_DEF_GROUP, "<PREFIX>", GetHandlePrefix());
+      stream << tidl::ReplaceAll(CB_HEADER_FUN_GROUP, "<PREFIX>", GetHandlePrefix());
+      break;
+    }
+    default:
+      break;
+  }
+
+  stream << tidl::ReplaceAll(CB_HEADER_FUN_COMMOM, "<PREFIX>", GetHandlePrefix());
+}
+
+void MqttPluginInternalHeaderGen::OnFiniGen(std::ofstream& stream) {
+  GenExplicitLinkageClose(stream);
+}
+
+}  // namespace tidl
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_internal_header_gen.h b/idlc/gen_mqtt_plugin/mqtt_plugin_internal_header_gen.h
new file mode 100644 (file)
index 0000000..cbc43b9
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_MQTT_PLUGIN_C_INTERNAL_HEADER_GEN_H_
+#define IDLC_MQTT_PLUGIN_C_INTERNAL_HEADER_GEN_H_
+
+#include <memory>
+#include <string>
+
+#include "idlc/gen_cion/c_cion_header_gen_base.h"
+
+namespace tidl {
+
+class MqttPluginInternalHeaderGen : public CCionHeaderGeneratorBase {
+ public:
+  explicit MqttPluginInternalHeaderGen(std::shared_ptr<Document> doc, std::shared_ptr<tidl::Transportable> trans);
+  virtual ~MqttPluginInternalHeaderGen() = default;
+
+  void OnInitGen(std::ofstream& stream) override;
+  void OnFiniGen(std::ofstream& stream) override;
+};
+
+}  // namespace tidl
+
+#endif  // IDLC_MQTT_PLUGIN_C_INTERNAL_HEADER_GEN_H_
\ No newline at end of file
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_internal_header_gen_cb.h b/idlc/gen_mqtt_plugin/mqtt_plugin_internal_header_gen_cb.h
new file mode 100644 (file)
index 0000000..d6cedb0
--- /dev/null
@@ -0,0 +1,213 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_C_MQTT_PLUGIN_GEN_INTERNAL_HEADER_GEN_CB_H_
+#define IDLC_C_MQTT_PLUGIN_GEN_INTERNAL_HEADER_GEN_CB_H_
+constexpr const char CB_HEADER_START[] =
+R"__c_cb(
+
+#pragma once
+
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#include <tizen.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum _<PREFIX>_transfer_status_e {
+  SUCCESS, /**< Transfer is success **/
+  FAILURE, /**< Transfer is failed **/
+  IN_PROGRESS, /**< Transfer is in progress **/
+} <PREFIX>_transfer_status_e;
+
+typedef enum _<PREFIX>_payload_type_e {
+  MQTT_PLUGIN_PAYLOAD_TYPE_DATA, /**< Data type payload **/
+  MQTT_PLUGIN_PAYLOAD_TYPE_FILE, /**< File type payload **/
+} <PREFIX>_payload_type_e;
+
+typedef enum _<PREFIX>_connection_status_e {
+  CONNECTION_STATUS_OK, /**< Connection is ok **/
+  CONNECTION_STATUS_REJECTED, /**< Connection is rejected **/
+  CONNECTION_STATUS_ERROR, /**< Connection error occurs **/
+} <PREFIX>_connection_status_e;
+)__c_cb";
+
+constexpr const char CB_HEADER_DEF_COMMON[] =
+R"__c_cb(
+typedef void *<PREFIX>_peer_info_h;
+typedef void *<PREFIX>_connection_result_h;
+typedef void *<PREFIX>_payload_h;
+typedef void *<PREFIX>_payload_async_result_h;
+)__c_cb";
+
+constexpr const char CB_HEADER_DEF_SERVER[] =
+R"__c_cb(
+typedef void *<PREFIX>_server_h;
+
+typedef void (*<PREFIX>_server_connection_result_cb)(
+    const char *service_name, const <PREFIX>_peer_info_h peer_info,
+    const <PREFIX>_connection_result_h result, void *user_data);
+typedef void (*<PREFIX>_server_payload_received_cb)(const char *service_name,
+    const <PREFIX>_peer_info_h peer_info, const <PREFIX>_payload_h payload,
+    <PREFIX>_transfer_status_e status, void *user_data);
+typedef void (*<PREFIX>_server_connection_request_cb)(const char *service_name,
+    const <PREFIX>_peer_info_h peer_info, void *user_data);
+typedef void (*<PREFIX>_server_disconnected_cb)(const char *service_name,
+    const <PREFIX>_peer_info_h peer_info, void *user_data);
+typedef void (*<PREFIX>_server_data_received_cb)(const char *service_name,
+    const <PREFIX>_peer_info_h peer_info, const unsigned char *data,
+    unsigned int data_size, unsigned char **return_data,
+    unsigned int *return_data_size, void *user_data);
+typedef bool (*<PREFIX>_server_connected_peer_info_cb)(
+    const <PREFIX>_peer_info_h peer_info, void *user_data);
+typedef void (*<PREFIX>_server_payload_async_result_cb)(
+    const <PREFIX>_payload_async_result_h result, void *user_data);
+)__c_cb";
+
+constexpr const char CB_HEADER_DEF_GROUP[] =
+R"__c_cb(
+typedef void *<PREFIX>_group_h;
+
+typedef void (*<PREFIX>_group_payload_received_cb)(const char *topic_name,
+    const <PREFIX>_peer_info_h peer_info, <PREFIX>_payload_h payload,
+    void *user_data);
+typedef void (*<PREFIX>_group_joined_cb)(const char *topic_name,
+    const <PREFIX>_peer_info_h peer_info, void *user_data);
+
+typedef void (*<PREFIX>_group_left_cb)(const char *topic_name,
+    const <PREFIX>_peer_info_h peer_info, void *user_data);
+)__c_cb";
+
+constexpr const char CB_HEADER_DEF_CLIENT[] =
+R"__c_cb(
+typedef void *<PREFIX>_client_h;
+
+typedef void (*<PREFIX>_client_server_discovered_cb)(const char *service_name,
+    const <PREFIX>_peer_info_h peer_info, void *user_data);
+typedef void (*<PREFIX>_client_connection_result_cb)(
+    const char *service_name, const <PREFIX>_peer_info_h peer_info,
+    const <PREFIX>_connection_result_h result, void *user_data);
+typedef void (*<PREFIX>_client_payload_async_result_cb)(
+    const <PREFIX>_payload_async_result_h result, void *user_data);
+typedef void (*<PREFIX>_client_payload_received_cb)(const char *service_name,
+    const <PREFIX>_peer_info_h peer_info, const <PREFIX>_payload_h payload,
+    <PREFIX>_transfer_status_e status, void *user_data);
+typedef void (*<PREFIX>_client_disconnected_cb)(const char *service_name,
+    const <PREFIX>_peer_info_h peer_info, void *user_data);
+)__c_cb";
+
+constexpr const char CB_HEADER_FUN_GROUP[] =
+R"__c_cb(
+int (*<PREFIX>_group_create)(<PREFIX>_group_h *, const char *,
+    const char *, int , const char *, const char *,
+    const char *, int);
+int (*<PREFIX>_group_destroy)(<PREFIX>_group_h);
+int (*<PREFIX>_group_subscribe)(<PREFIX>_group_h);
+int (*<PREFIX>_group_unsubscribe)(<PREFIX>_group_h);
+int (*<PREFIX>_group_publish)(<PREFIX>_group_h, <PREFIX>_payload_h);
+int (*<PREFIX>_group_add_payload_received_cb)(<PREFIX>_group_h,
+    <PREFIX>_group_payload_received_cb, void *);
+int (*<PREFIX>_group_add_joined_cb)(<PREFIX>_group_h,
+    <PREFIX>_group_joined_cb, void *);
+int (*<PREFIX>_group_add_left_cb)(<PREFIX>_group_h,
+  <PREFIX>_group_left_cb, void *);
+)__c_cb";
+
+constexpr const char CB_HEADER_FUN_CLIENT[] =
+R"__c_cb(
+int (*<PREFIX>_client_create)(<PREFIX>_client_h *, const char *,
+    const char *, int , const char *, const char *,
+    const char *, int);
+int (*<PREFIX>_client_destroy)(<PREFIX>_client_h);
+int (*<PREFIX>_client_try_discovery)(<PREFIX>_client_h,
+    <PREFIX>_client_server_discovered_cb, void *);
+int (*<PREFIX>_client_stop_discovery)(<PREFIX>_client_h);
+int (*<PREFIX>_client_connect)(<PREFIX>_client_h, const <PREFIX>_peer_info_h);
+int (*<PREFIX>_client_disconnect)(<PREFIX>_client_h);
+int (*<PREFIX>_client_send_data)(<PREFIX>_client_h, unsigned char *,
+    unsigned int, int, unsigned char **, unsigned int *);
+int (*<PREFIX>_client_send_payload_async)(<PREFIX>_client_h,
+    <PREFIX>_payload_h, <PREFIX>_client_payload_async_result_cb, void *);
+int (*<PREFIX>_client_add_connection_result_cb)(<PREFIX>_client_h,
+    <PREFIX>_client_connection_result_cb, void *);
+int (*<PREFIX>_client_add_payload_received_cb)(<PREFIX>_client_h,
+    <PREFIX>_client_payload_received_cb, void *);
+int (*<PREFIX>_client_add_disconnected_cb)(<PREFIX>_client_h,
+    <PREFIX>_client_disconnected_cb, void *);
+)__c_cb";
+
+constexpr const char CB_HEADER_FUN_SERVER[] =
+R"__c_cb(
+int (*<PREFIX>_server_create)(<PREFIX>_server_h *, const char *,
+    const char *, const char *, int ,const char *, const char *, const char *, int);
+int (*<PREFIX>_server_add_connection_result_cb)(<PREFIX>_server_h,
+    <PREFIX>_server_connection_result_cb, void *);
+int (*<PREFIX>_server_add_payload_received_cb)(<PREFIX>_server_h,
+    <PREFIX>_server_payload_received_cb, void *);
+int (*<PREFIX>_server_add_disconnected_cb)(<PREFIX>_server_h,
+    <PREFIX>_server_disconnected_cb, void *);
+int (*<PREFIX>_server_set_data_received_cb)(<PREFIX>_server_h,
+    <PREFIX>_server_data_received_cb , void *);
+int (*<PREFIX>_server_destroy)(<PREFIX>_server_h);
+int (*<PREFIX>_server_listen)(<PREFIX>_server_h,
+    <PREFIX>_server_connection_request_cb, void *);
+int (*<PREFIX>_server_foreach_connected_peer_info)(<PREFIX>_server_h,
+    <PREFIX>_server_connected_peer_info_cb, void *);
+int (*<PREFIX>_server_accept)(<PREFIX>_server_h, const <PREFIX>_peer_info_h);
+int (*<PREFIX>_server_reject)(<PREFIX>_server_h,const <PREFIX>_peer_info_h,
+    const char *);
+int (*<PREFIX>_server_set_display_name)(<PREFIX>_server_h, const char *);
+int (*<PREFIX>_server_send_payload_async)(<PREFIX>_server_h,
+    <PREFIX>_peer_info_h, <PREFIX>_payload_h,
+    <PREFIX>_server_payload_async_result_cb, void *);
+int (*<PREFIX>_server_disconnect)(<PREFIX>_server_h, <PREFIX>_peer_info_h);
+)__c_cb";
+
+constexpr const char CB_HEADER_FUN_COMMOM[] =
+R"__c_cb(
+int (*<PREFIX>_payload_create)(<PREFIX>_payload_h *, <PREFIX>_payload_type_e);
+int (*<PREFIX>_payload_destroy)(<PREFIX>_payload_h);
+int (*<PREFIX>_payload_get_type)(<PREFIX>_payload_h, <PREFIX>_payload_type_e *);
+int (*<PREFIX>_payload_get_data)(<PREFIX>_payload_h, unsigned char **, unsigned int *);
+int (*<PREFIX>_payload_set_data)(<PREFIX>_payload_h, const unsigned char *, unsigned int);
+int (*<PREFIX>_payload_save_as_file)(<PREFIX>_payload_h, const char *);
+int (*<PREFIX>_payload_get_received_file_name)(<PREFIX>_payload_h, char **);
+int (*<PREFIX>_payload_get_received_bytes)(<PREFIX>_payload_h, uint64_t *);
+int (*<PREFIX>_payload_get_total_bytes)(<PREFIX>_payload_h, uint64_t *);
+int (*<PREFIX>_payload_set_file_path)(<PREFIX>_payload_h, const char *);
+int (*<PREFIX>_payload_get_payload_id)(<PREFIX>_payload_h, char **);
+
+int (*<PREFIX>_peer_info_clone)(const <PREFIX>_peer_info_h, <PREFIX>_peer_info_h *);
+int (*<PREFIX>_peer_info_destroy)(<PREFIX>_peer_info_h);
+int (*<PREFIX>_peer_info_get_device_id)(<PREFIX>_peer_info_h, char **);
+int (*<PREFIX>_peer_info_get_device_name)(<PREFIX>_peer_info_h, char **);
+int (*<PREFIX>_peer_info_get_device_platform)(<PREFIX>_peer_info_h, char **);
+int (*<PREFIX>_peer_info_get_device_platform_version)(<PREFIX>_peer_info_h, char **);
+int (*<PREFIX>_peer_info_get_device_type)(<PREFIX>_peer_info_h, char **);
+int (*<PREFIX>_peer_info_get_app_id)(<PREFIX>_peer_info_h, char **);
+int (*<PREFIX>_peer_info_get_app_version)(<PREFIX>_peer_info_h, char **);
+int (*<PREFIX>_peer_info_get_uuid)(<PREFIX>_peer_info_h, char **);
+int (*<PREFIX>_peer_info_get_display_name)(<PREFIX>_peer_info_h, char **);
+
+int (*<PREFIX>_connection_result_get_status)(const <PREFIX>_connection_result_h, <PREFIX>_connection_status_e *);
+int (*<PREFIX>_connection_result_get_reason)(const <PREFIX>_connection_result_h, char **reason);
+)__c_cb";
+
+#endif  // IDLC_C_MQTT_PLUGIN_GEN_INTERNAL_HEADER_GEN_CB_H_
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_java_transportable.cc b/idlc/gen_mqtt_plugin/mqtt_plugin_java_transportable.cc
new file mode 100644 (file)
index 0000000..c621d9c
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_java_transportable.h"
+
+#include <utility>
+
+#include "idlc/gen/replace_all.h"
+
+namespace {
+
+std::string ParamsToString(std::vector<std::string> params) {
+  std::string res;
+  for (auto it = params.begin(); it != params.end(); it++) {
+    res += *it;
+    if ((it + 1) != params.end())
+      res += ", ";
+  }
+
+  return res;
+}
+
+constexpr const char __CLIENT_BASE_CONSTRUCTOR[] =
+R"__java_cb(
+    /**
+     * Constructor
+     * @param mContext The Context
+     * @param serviceName Service name
+     */
+    public ClientBase(Context mContext, String serviceName, String brokerIp) {
+        mClient = new <CLIENT_CHANNEL>(mContext, serviceName, brokerIp);
+        this.mContext = mContext;
+    }
+)__java_cb";
+
+constexpr const char __SERVER_BASE_CONSTRUCTOR[] =
+R"__java_cb(
+    /**
+     * Constructor
+     * @param mContext Context
+     * @param mServiceName Service name
+     * @param mDisplayName Display name
+     */
+    public ServerBase(Context mContext, String mServiceName, String mDisplayName, String brokerIp) {
+        mServer = new <SERVER_CHANNEL>(mContext, mServiceName, mDisplayName, brokerIp);
+        this.mContext = mContext;
+        this.mServiceName = mServiceName;
+        this.mDisplayName = mDisplayName;
+    }
+)__java_cb";
+
+constexpr const char __GROUP_BASE_CONSTRUCTOR[] =
+R"__java_cb(
+    /**
+     * Constructor
+     * @param mContext The Context
+     * @param topicName Topic name
+     */
+    public GroupBase(Context mContext, String topicName, String brokerIp) {
+        mGroup = new <GROUP_CHANNEL>(mContext, topicName, brokerIp);
+        this.mContext = mContext;
+    }
+)__java_cb";
+
+constexpr const char __ON_LEFT_EVENT_METHOD[] =
+R"__java_cb(
+    @Override
+    public void onLeft(<PEER_INFO_T> peerInfo, String topic_name) {
+    }
+)__java_cb";
+
+constexpr const char __ON_JOINED_EVENT_METHOD[] =
+R"__java_cb(
+    @Override
+    public void onJoined(<PEER_INFO_T> peerInfo, String topic_name) {
+    }
+)__java_cb";
+
+constexpr const char __INHERITED_CLASS_CONSTRUCTOR[] =
+R"__java_cb(
+public $$(<PARAMETERS>, String brokerIp) {
+    super(<BASE_CLASS_PARAMETERS>, brokerIp);
+    <EXTRA_OPERATION>
+}
+)__java_cb";
+
+}  // namespace
+
+namespace tidl {
+
+std::string MqttPluginJavaTransportable::GenInclude() const {
+  return "import org.tizen.mqtt.*;";
+}
+
+std::string MqttPluginJavaTransportable::GenParcelInclude() const {
+  return "import org.tizen.mqtt.MqttParcel;";
+}
+
+std::string MqttPluginJavaTransportable::GenParcel() const {
+  return "MqttParcel";
+}
+
+std::string MqttPluginJavaTransportable::GenClientBaseConstructor() const {
+  return __CLIENT_BASE_CONSTRUCTOR;
+}
+
+std::string MqttPluginJavaTransportable::GenServerBaseConstructor() const {
+  return __SERVER_BASE_CONSTRUCTOR;
+}
+
+std::string MqttPluginJavaTransportable::GenGroupBaseConstructor() const {
+  return __GROUP_BASE_CONSTRUCTOR;
+}
+
+std::string MqttPluginJavaTransportable::GenOnLeftEventMethod() const {
+  return __ON_LEFT_EVENT_METHOD;
+}
+
+std::string MqttPluginJavaTransportable::GenOnJoinedEventMethod() const {
+  return __ON_JOINED_EVENT_METHOD;
+}
+
+std::string MqttPluginJavaTransportable::GenInheritedClassConstructor(
+    std::vector<std::string> params, std::vector<std::string> base_class_params,
+    std::string extra_operation) const {
+  return std::string(ReplaceAll(__INHERITED_CLASS_CONSTRUCTOR, {
+      { "<PARAMETERS>", ParamsToString(params) },
+      { "<BASE_CLASS_PARAMETERS>", ParamsToString(base_class_params) },
+      { "<EXTRA_OPERATION>", extra_operation }
+  }));
+}
+
+}  // namespace tidl
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_java_transportable.h b/idlc/gen_mqtt_plugin/mqtt_plugin_java_transportable.h
new file mode 100644 (file)
index 0000000..f0a9cb3
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_GEN_MQTT_PLUGIN_JAVA_TRANSPORTABLE_H_
+#define IDLC_GEN_MQTT_PLUGIN_JAVA_TRANSPORTABLE_H_
+
+#include <string>
+
+#include "idlc/gen_cion/default_java_transportable.h"
+
+namespace tidl {
+
+class MqttPluginJavaTransportable : public DefaultJavaTransportable {
+ public:
+  std::string GenInclude() const override;
+  std::string GenParcelInclude() const override;
+  std::string GenParcel() const override;
+  std::string GenClientBaseConstructor() const override;
+  std::string GenServerBaseConstructor() const override;
+  std::string GenGroupBaseConstructor() const override;
+  std::string GenOnLeftEventMethod() const override;
+  std::string GenOnJoinedEventMethod() const override;
+  std::string GenInheritedClassConstructor(std::vector<std::string> params,
+      std::vector<std::string> base_class_params,
+      std::string extra_operation) const override;
+};
+
+}  // namespace tidl
+
+#endif  // IDLC_GEN_MQTT_PLUGIN_JAVA_TRANSPORTABLE_H_
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_loader.cc b/idlc/gen_mqtt_plugin/mqtt_plugin_loader.cc
new file mode 100644 (file)
index 0000000..105bae9
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_loader.h"
+
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_c_transportable.h"
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_cs_transportable.h"
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_java_transportable.h"
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_cpp_transportable.h"
+#include "idlc/gen_cion/default_cpp_transportable.h"
+#include "idlc/gen_cion/default_java_transportable.h"
+#include "idlc/gen_cion/default_cs_transportable.h"
+
+namespace tidl {
+
+MqttPluginLoader::MqttPluginLoader(const std::string& plugin_path) {
+  if (plugin_path.empty()) {
+    C_.reset(new MqttPluginCTransportable());
+    Cs_.reset(new MqttPluginCsTransportable());
+    Cpp_.reset(new MqttPluginCppTransportable());
+    Java_.reset(new MqttPluginJavaTransportable());
+  } else {
+    // TODO
+  }
+}
+
+const CTransportable& MqttPluginLoader::C() {
+  return *C_;
+}
+
+const CppTransportable& MqttPluginLoader::Cpp() {
+  return *Cpp_;
+}
+
+const CsTransportable& MqttPluginLoader::Cs() {
+ return *Cs_;
+
+}
+
+const JavaTransportable& MqttPluginLoader::Java() {
+ return *Java_;
+}
+}  // namespace tidl
diff --git a/idlc/gen_mqtt_plugin/mqtt_plugin_loader.h b/idlc/gen_mqtt_plugin/mqtt_plugin_loader.h
new file mode 100644 (file)
index 0000000..125bb8c
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IDLC_GEN_MQTT_PLUGIN_LOADER_H_
+#define IDLC_GEN_MQTT_PLUGIN_LOADER_H_
+
+#include <memory>
+#include <string>
+
+#include "idlc/gen_cion/transportable.h"
+
+namespace tidl {
+
+class MqttPluginLoader : public Transportable {
+ public:
+  explicit MqttPluginLoader(const std::string& plugin_path);
+
+  const CTransportable& C() override;
+  const CppTransportable& Cpp() override;
+  const CsTransportable& Cs() override;
+  const JavaTransportable& Java() override;
+
+ private:
+  std::unique_ptr<CTransportable> C_;
+  std::unique_ptr<CppTransportable> Cpp_;
+  std::unique_ptr<CsTransportable> Cs_;
+  std::unique_ptr<JavaTransportable> Java_;
+};
+
+}  // namespace tidl
+
+#endif  // IDLC_GEN_MQTT_PLUGIN_LOADER_H_
\ No newline at end of file
index 816e510440cc512ae37ede423fd2ce056ac729b3..a2489af618f0cae2841223310de8706bbf47be25 100644 (file)
 #include "idlc/gen_cion/cpp_cion_group_header_gen.h"
 #include "idlc/gen_cion/cpp_cion_group_body_gen.h"
 #include "idlc/gen_cion/plugin_loader.h"
-#include "idlc/gen_aitt_plugin/aitt_plugin_internal_header_gen.h"
-#include "idlc/gen_aitt_plugin/aitt_plugin_internal_body_gen.h"
-#include "idlc/gen_aitt_plugin/aitt_plugin_c_transportable.h"
-#include "idlc/gen_aitt_plugin/aitt_plugin_loader.h"
-#include "idlc/gen_aitt_plugin/aitt_plugin_cs_base_gen.h"
-#include "idlc/gen_aitt_plugin/aitt_plugin_cs_interop_gen.h"
-#include "idlc/gen_aitt_plugin/aitt_plugin_cpp_transportable.h"
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_internal_header_gen.h"
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_internal_body_gen.h"
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_c_transportable.h"
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_loader.h"
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_cs_base_gen.h"
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_cs_interop_gen.h"
+#include "idlc/gen_mqtt_plugin/mqtt_plugin_cpp_transportable.h"
 
 #include "idlc/options.h"
 
@@ -131,19 +131,19 @@ void GenerateStubCodes(std::shared_ptr<tidl::Options> options,
     default:
       break;
     }
-  } else if (options->IsAitt()) {
+  } else if (options->IsMqtt()) {
     auto trans = std::shared_ptr<tidl::Transportable>(
-        new tidl::AIttPluginLoader(""));
+        new tidl::MqttPluginLoader(""));
     switch (options->GetLanguage()) {
     case tidl::Options::LANGUAGE_TYPE_C:
     {
-      tidl::AittPluginInternalHeaderGen internal_header(ps.GetDoc(), trans);
+      tidl::MqttPluginInternalHeaderGen internal_header(ps.GetDoc(), trans);
       internal_header.EnableNamespace(options->HasNamespace());
       internal_header.EnableGeneratedAPI(true);
       internal_header.SetType(static_cast<int>(options->GetType()));
       internal_header.Run(options->GetOutput() + "_internal.h");
 
-      tidl::AittPluginInternalBodyGen internal_body(ps.GetDoc(), trans);
+      tidl::MqttPluginInternalBodyGen internal_body(ps.GetDoc(), trans);
       internal_body.EnableNamespace(options->HasNamespace());
                 internal_body.EnableGeneratedAPI(true);
       internal_body.SetType(static_cast<int>(options->GetType()));
@@ -165,13 +165,13 @@ void GenerateStubCodes(std::shared_ptr<tidl::Options> options,
     }
     case tidl::Options::LANGUAGE_TYPE_CPP:
     {
-      tidl::AittPluginInternalHeaderGen internal_header(ps.GetDoc(), trans);
+      tidl::MqttPluginInternalHeaderGen internal_header(ps.GetDoc(), trans);
       internal_header.EnableNamespace(options->HasNamespace());
       internal_header.EnableGeneratedAPI(true);
       internal_header.SetType(static_cast<int>(options->GetType()));
       internal_header.Run(options->GetOutput() + "_internal.h");
 
-      tidl::AittPluginInternalBodyGen internal_body(ps.GetDoc(), trans);
+      tidl::MqttPluginInternalBodyGen internal_body(ps.GetDoc(), trans);
       internal_body.EnableNamespace(options->HasNamespace());
       internal_body.EnableGeneratedAPI(true);
       internal_body.SetType(static_cast<int>(options->GetType()));
@@ -192,12 +192,12 @@ void GenerateStubCodes(std::shared_ptr<tidl::Options> options,
     }
     case tidl::Options::LANGUAGE_TYPE_CSHARP:
     {
-      tidl::AittPluginCsInteropGen interop(ps.GetDoc(), trans);
+      tidl::MqttPluginCsInteropGen interop(ps.GetDoc(), trans);
       interop.SetType(static_cast<int>(options->GetType()));
-      interop.Run("Interop.AittPlugin.cs");
-      tidl::AittPluginCsBaseGen base(ps.GetDoc(), trans);
+      interop.Run("Interop.MqttPlugin.cs");
+      tidl::MqttPluginCsBaseGen base(ps.GetDoc(), trans);
       base.SetType(static_cast<int>(options->GetType()));
-      base.Run("AittPluginBase.cs");
+      base.Run("MqttPluginBase.cs");
 
       tidl::CsCionStubGen stub(ps.GetDoc(), trans);
       stub.Run(options->GetOutput() + ".cs");
@@ -326,19 +326,19 @@ void GenerateProxyCodes(std::shared_ptr<tidl::Options> options,
     default:
       break;
     }
-  } else if (options->IsAitt()) {
+  } else if (options->IsMqtt()) {
     auto trans = std::shared_ptr<tidl::Transportable>(
-        new tidl::AIttPluginLoader(""));
+        new tidl::MqttPluginLoader(""));
     switch (options->GetLanguage()) {
     case tidl::Options::LANGUAGE_TYPE_C:
     {
-      tidl::AittPluginInternalHeaderGen internal_header(ps.GetDoc(), trans);
+      tidl::MqttPluginInternalHeaderGen internal_header(ps.GetDoc(), trans);
       internal_header.EnableNamespace(options->HasNamespace());
       internal_header.EnableGeneratedAPI(true);
       internal_header.SetType(static_cast<int>(options->GetType()));
       internal_header.Run(options->GetOutput() + "_internal.h");
 
-      tidl::AittPluginInternalBodyGen internal_body(ps.GetDoc(), trans);
+      tidl::MqttPluginInternalBodyGen internal_body(ps.GetDoc(), trans);
       internal_body.EnableNamespace(options->HasNamespace());
       internal_body.EnableGeneratedAPI(true);
       internal_body.SetType(static_cast<int>(options->GetType()));
@@ -359,13 +359,13 @@ void GenerateProxyCodes(std::shared_ptr<tidl::Options> options,
     }
     case tidl::Options::LANGUAGE_TYPE_CPP:
     {
-      tidl::AittPluginInternalHeaderGen internal_header(ps.GetDoc(), trans);
+      tidl::MqttPluginInternalHeaderGen internal_header(ps.GetDoc(), trans);
       internal_header.SetType(static_cast<int>(options->GetType()));
       internal_header.EnableNamespace(options->HasNamespace());
       internal_header.EnableGeneratedAPI(true);
       internal_header.Run(options->GetOutput() + "_internal.h");
 
-      tidl::AittPluginInternalBodyGen internal_body(ps.GetDoc(), trans);
+      tidl::MqttPluginInternalBodyGen internal_body(ps.GetDoc(), trans);
       internal_body.SetType(static_cast<int>(options->GetType()));
       internal_body.EnableNamespace(options->HasNamespace());
       internal_body.EnableGeneratedAPI(true);
@@ -386,12 +386,12 @@ void GenerateProxyCodes(std::shared_ptr<tidl::Options> options,
     }
     case tidl::Options::LANGUAGE_TYPE_CSHARP:
     {
-      tidl::AittPluginCsInteropGen interop(ps.GetDoc(), trans);
+      tidl::MqttPluginCsInteropGen interop(ps.GetDoc(), trans);
       interop.SetType(static_cast<int>(options->GetType()));
-      interop.Run("Interop.AittPlugin.cs");
-      tidl::AittPluginCsBaseGen base(ps.GetDoc(), trans);
+      interop.Run("Interop.MqttPlugin.cs");
+      tidl::MqttPluginCsBaseGen base(ps.GetDoc(), trans);
       base.SetType(static_cast<int>(options->GetType()));
-      base.Run("AittPluginBase.cs");
+      base.Run("MqttPluginBase.cs");
 
       tidl::CsCionProxyGen proxy(ps.GetDoc(), trans);
       proxy.Run(options->GetOutput() + ".cs");
@@ -531,19 +531,19 @@ void GenerateGroupCodes(std::shared_ptr<tidl::Options> options,
     default:
       break;
     }
-  } else if (options->IsAitt()) {
+  } else if (options->IsMqtt()) {
     auto trans = std::shared_ptr<tidl::Transportable>(
-        new tidl::AIttPluginLoader(""));
+        new tidl::MqttPluginLoader(""));
     switch (options->GetLanguage()) {
     case tidl::Options::LANGUAGE_TYPE_C:
     {
-      tidl::AittPluginInternalHeaderGen internal_header(ps.GetDoc(), trans);
+      tidl::MqttPluginInternalHeaderGen internal_header(ps.GetDoc(), trans);
       internal_header.EnableNamespace(options->HasNamespace());
       internal_header.EnableGeneratedAPI(true);
       internal_header.SetType(static_cast<int>(options->GetType()));
       internal_header.Run(options->GetOutput() + "_internal.h");
 
-      tidl::AittPluginInternalBodyGen internal_body(ps.GetDoc(), trans);
+      tidl::MqttPluginInternalBodyGen internal_body(ps.GetDoc(), trans);
       internal_body.EnableNamespace(options->HasNamespace());
       internal_body.EnableGeneratedAPI(true);
       internal_body.SetType(static_cast<int>(options->GetType()));
@@ -566,13 +566,13 @@ void GenerateGroupCodes(std::shared_ptr<tidl::Options> options,
     }
     case tidl::Options::LANGUAGE_TYPE_CPP:
     {
-      tidl::AittPluginInternalHeaderGen internal_header(ps.GetDoc(), trans);
+      tidl::MqttPluginInternalHeaderGen internal_header(ps.GetDoc(), trans);
       internal_header.SetType(static_cast<int>(options->GetType()));
       internal_header.EnableNamespace(options->HasNamespace());
       internal_header.EnableGeneratedAPI(true);
       internal_header.Run(options->GetOutput() + "_internal.h");
 
-      tidl::AittPluginInternalBodyGen internal_body(ps.GetDoc(), trans);
+      tidl::MqttPluginInternalBodyGen internal_body(ps.GetDoc(), trans);
       internal_body.SetType(static_cast<int>(options->GetType()));
       internal_body.EnableNamespace(options->HasNamespace());
       internal_body.EnableGeneratedAPI(true);
@@ -593,12 +593,12 @@ void GenerateGroupCodes(std::shared_ptr<tidl::Options> options,
     }
     case tidl::Options::LANGUAGE_TYPE_CSHARP:
     {
-      tidl::AittPluginCsInteropGen interop(ps.GetDoc(), trans);
+      tidl::MqttPluginCsInteropGen interop(ps.GetDoc(), trans);
       interop.SetType(static_cast<int>(options->GetType()));
-      interop.Run("Interop.AittPlugin.cs");
-      tidl::AittPluginCsBaseGen base(ps.GetDoc(), trans);
+      interop.Run("Interop.MqttPlugin.cs");
+      tidl::MqttPluginCsBaseGen base(ps.GetDoc(), trans);
       base.SetType(static_cast<int>(options->GetType()));
-      base.Run("AittPluginBase.cs");
+      base.Run("MqttPluginBase.cs");
 
       tidl::CsCionGroupGen group(ps.GetDoc(), trans);
       group.Run(options->GetOutput() + ".cs");
@@ -683,7 +683,7 @@ int main(int argc, char** argv) {
     exit(1);
 
   tidl::Parser ps(options->IsBetaEnabled(), options->IsCion(),
-    options->IsAitt(),
+    options->IsMqtt(),
     options->GetType() == tidl::Options::Type::TYPE_GROUP ? true : false);
   std::string path(options->GetInput());
 
index d8a2361a652a5a50d154afe63af78d2f34e57d62..2d819a6cc5758375850d40d46c03da2d09b01364 100644 (file)
@@ -32,7 +32,7 @@ Help Options:
   -h, --help                  Show help options
 
 Additional Options:
-  -l, --language=LANGUAGE     Select generating language (C, C++, C#, Java(CION & AITT only), Dart).
+  -l, --language=LANGUAGE     Select generating language (C, C++, C#, Java(CION & MQTT only), Dart).
   -i, --input=INPUT           A tidl interface file.
   -o, --output=OUTPUT         The generated interface file.
   -n, --namespace             Add the prefix in the funtion name as output file name (C language only).
@@ -40,12 +40,12 @@ Additional Options:
   -b, --beta                  Use beta version (Support private file sharing).
   -t, --thread                Generate thread code (Stub only).
   -c, --cion                  Generate CION code.
-  -a, --aitt                  Generate AITT code.
+  -m, --mqtt                  Generate MQTT code.
 
 Application Options:
   -p, --proxy                 Generate proxy code
   -s, --stub                  Generate stub code
-  -g, --group                 Generate group code (CION and AITT only)
+  -g, --group                 Generate group code (CION and MQTT only)
   -v, --version               Show version information
 )__option_cb";
 }
@@ -98,12 +98,12 @@ std::shared_ptr<Options> Options::Parse(int argc, char** argv) {
     {"beta", no_argument,    NULL, 'b'},
     {"thread", no_argument,    NULL, 't'},
     {"cion", no_argument,    NULL, 'c'},
-    {"aitt", no_argument, NULL, 'a'},
+    {"mqtt", no_argument, NULL, 'm'},
     {0, 0, 0, 0}
   };
 
   while (true) {
-    int c = getopt_long(argc, argv, "tcbpsgvhal:i:o:nr", long_options,
+    int c = getopt_long(argc, argv, "tcbpsgvhml:i:o:nr", long_options,
         &option_index);
     if (c == -1)
       break;
@@ -166,8 +166,8 @@ std::shared_ptr<Options> Options::Parse(int argc, char** argv) {
         options->isCion_ = true;
         break;
 
-      case 'a':
-        options->isAitt_ = true;
+      case 'm':
+        options->isMqtt_ = true;
         break;
 
       default:
@@ -185,8 +185,8 @@ std::shared_ptr<Options> Options::Parse(int argc, char** argv) {
     return std::shared_ptr<Options>(nullptr);
   }
 
-  if (options->isCion_ && options->isAitt_) {
-    std::cerr << "Only one of cion and aitt is allowed." << std::endl;
+  if (options->isCion_ && options->isMqtt_) {
+    std::cerr << "Only one of cion and mqtt is allowed." << std::endl;
     return std::shared_ptr<Options>(nullptr);
   }
   switch (static_cast<int>(options->type_)) {
@@ -202,14 +202,14 @@ std::shared_ptr<Options> Options::Parse(int argc, char** argv) {
   switch (static_cast<int>(options->language_)) {
   case LANGUAGE_TYPE_UNKNOWN:
     std::cerr <<
-      "Select a language (C, C++, C#, Java(CION & AITT only)).." << std::endl;
+      "Select a language (C, C++, C#, Java(CION & MQTT only)).." << std::endl;
     options->PrintSample();
     return std::shared_ptr<Options>(nullptr);
   case LANGUAGE_TYPE_JAVA:
-    if (!options->isCion_ && !options->isAitt_) {
+    if (!options->isCion_ && !options->isMqtt_) {
       std::cerr <<
         "Java language is only allowed for the CION and "
-        "AITT codes." << std::endl;
+        "MQTT codes." << std::endl;
       options->PrintSample();
       return std::shared_ptr<Options>(nullptr);
     }
index 40c00b6872e5af412c9ba879c7a5eb150ea78ac3..1478f2520d4f916c6f89390b09cebb5a5971ced3 100644 (file)
@@ -45,7 +45,7 @@ class Options {
 
   static std::shared_ptr<Options> Parse(int argc, char** argv);
   bool IsCion() const { return isCion_; }
-  bool IsAitt() const { return isAitt_; }
+  bool IsMqtt() const { return isMqtt_; }
   Type GetType() const { return type_; }
   bool IsBetaEnabled() const { return isBetaEnabled_; }
   bool IsThreadEnabled() const { return isThreadEnabled_; }
@@ -76,7 +76,7 @@ class Options {
 
  private:
   bool isCion_ = false;
-  bool isAitt_ = false;
+  bool isMqtt_ = false;
   LanguageType language_;
   std::string input_;
   std::string output_;
index e79bd36f415758e85695b031cea1beabb1ce2dc9..4d0a356a320cad69ca76d8c78e223c9b1f92a150 100755 (executable)
Binary files a/release/windows-32/tidlc.exe and b/release/windows-32/tidlc.exe differ
index 17e498b9d26655b6067a65dd966d5b1280e6cf66..468459be5e087ef0c41d29037042adec10033a8a 100755 (executable)
Binary files a/release/windows-64/tidlc.exe and b/release/windows-64/tidlc.exe differ
index a23fc399f0a2840b02bff40ce257f7fead337bb3..86865fac75c705cebb92d243759b2c9fe3fa60b3 100644 (file)
@@ -23,10 +23,10 @@ SET(CMAKE_EXE_LINKER_FLAGS "-pie -Wl,--as-needed")
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} TIDL_BUILD_TESTS_SRCS)
 
 SET(TIDL_GEN_SRCS
-  BufferAittPluginProxy.cc
-  BufferAittPluginStub.cc
-  BufferAittPluginProxyC.c
-  BufferAittPluginStubC.c
+  BufferMqttPluginProxy.cc
+  BufferMqttPluginStub.cc
+  BufferMqttPluginProxyC.c
+  BufferMqttPluginStubC.c
   BufferCionProxy.cc
   BufferCionProxyC.c
   BufferCionStub.cc
@@ -36,10 +36,10 @@ SET(TIDL_GEN_SRCS
   BufferStub.cc
   BufferStubThread.cc
   BufferStubC.c
-  DataPortAittPluginProxy.cc
-  DataPortAittPluginStub.cc
-  DataPortAittPluginProxyC.c
-  DataPortAittPluginStubC.c
+  DataPortMqttPluginProxy.cc
+  DataPortMqttPluginStub.cc
+  DataPortMqttPluginProxyC.c
+  DataPortMqttPluginStubC.c
   DataPortCionProxy.cc
   DataPortCionProxyC.c
   DataPortCionStub.cc
@@ -49,10 +49,10 @@ SET(TIDL_GEN_SRCS
   DataPortStub.cc
   DataPortStubThread.cc
   DataPortStubC.c
-  ExCionAittPluginProxy.cc
-  ExCionAittPluginStub.cc
-  ExCionAittPluginProxyC.c
-  ExCionAittPluginStubC.c
+  ExCionMqttPluginProxy.cc
+  ExCionMqttPluginStub.cc
+  ExCionMqttPluginProxyC.c
+  ExCionMqttPluginStubC.c
   ExCionCionProxy.cc
   ExCionCionProxyC.c
   ExCionCionStub.cc
@@ -62,10 +62,10 @@ SET(TIDL_GEN_SRCS
   ExStub.cc
   ExStubThread.cc
   ExStubC.c
-  FooAittPluginProxy.cc
-  FooAittPluginStub.cc
-  FooAittPluginProxyC.c
-  FooAittPluginStubC.c
+  FooMqttPluginProxy.cc
+  FooMqttPluginStub.cc
+  FooMqttPluginProxyC.c
+  FooMqttPluginStubC.c
   FooCionProxy.cc
   FooCionProxyC.c
   FooCionStub.cc
@@ -75,10 +75,10 @@ SET(TIDL_GEN_SRCS
   FooStub.cc
   FooStubThread.cc
   FooStubC.c
-  MessageAittPluginProxy.cc
-  MessageAittPluginStub.cc
-  MessageAittPluginProxyC.c
-  MessageAittPluginStubC.c
+  MessageMqttPluginProxy.cc
+  MessageMqttPluginStub.cc
+  MessageMqttPluginProxyC.c
+  MessageMqttPluginStubC.c
   MessageCionProxy.cc
   MessageCionProxyC.c
   MessageCionStub.cc
@@ -87,8 +87,8 @@ SET(TIDL_GEN_SRCS
   MessageProxyC.c
   MessageStub.cc
   MessageStubThread.cc
-  FooPubsubAittPluginGroup.cc
-  FooPubsubAittPluginGroupC.c
+  FooPubsubMqttPluginGroup.cc
+  FooPubsubMqttPluginGroupC.c
   FooPubsubGroup.cc
   FooPubsubGroupC.c
   FooPubsubCionGroup.cc
index f93730134a82e327c4c31eeb7949ee7d10caa3e5..41bd95235dad7d5dd7b853898cdeb7a4f6c32a29 100755 (executable)
@@ -88,16 +88,16 @@ GenerateTIDL() {
 
     INPUT="${FILES_CION[index]}.tidl"
 
-    OUTPUT="${FILES_CION[index]}AittPluginProxyC"
+    OUTPUT="${FILES_CION[index]}MqttPluginProxyC"
     ${TIDLC} -b -p -n -a -l C -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT}
 
-    OUTPUT="${FILES_CION[index]}AittPluginStubC"
+    OUTPUT="${FILES_CION[index]}MqttPluginStubC"
     ${TIDLC} -b -s -n -a -l C -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT}
 
-    OUTPUT="${FILES_CION[index]}AittPluginProxy"
+    OUTPUT="${FILES_CION[index]}MqttPluginProxy"
     ${TIDLC} -b -p -n -a -l C++ -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT}
 
-    OUTPUT="${FILES_CION[index]}AittPluginStub"
+    OUTPUT="${FILES_CION[index]}MqttPluginStub"
     ${TIDLC} -b -s -n -a -l C++ -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT}
 
   done
@@ -107,10 +107,10 @@ GenerateTIDL() {
 
     INPUT="${FILES_FOR_GROUP[index]}.tidl"
 
-    OUTPUT="${FILES_FOR_GROUP[index]}AittPluginGroupC"
+    OUTPUT="${FILES_FOR_GROUP[index]}MqttPluginGroupC"
     ${TIDLC} -b -a -n -g -l C -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT}
 
-    OUTPUT="${FILES_FOR_GROUP[index]}AittPluginGroup"
+    OUTPUT="${FILES_FOR_GROUP[index]}MqttPluginGroup"
     ${TIDLC} -b -a -n -g -l C++ -i ${SCRIPT_DIR}/tidl/${INPUT} -o ${TARGET_DIR}/${OUTPUT}
   done
 }