cxx: Define types after forward declarations
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 28 Nov 2017 12:32:45 +0000 (21:32 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 5 Dec 2017 06:01:45 +0000 (15:01 +0900)
This is useful if the types refer to the current class.

src/bin/eolian_cxx/eolian_cxx.cc
src/lib/edje/efl_canvas_layout_signal.eo
src/lib/eolian_cxx/grammar/header.hpp

index f3f3c36..3720aa9 100644 (file)
@@ -161,13 +161,13 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts,
                , efl::eolian::grammar::context_null{});
 
    std::tuple<std::string, std::set<std::string>&, std::set<std::string>&
-              , std::string const&
               , std::vector<efl::eolian::grammar::attributes::klass_def>&
               , std::set<efl::eolian::grammar::attributes::klass_def> const&
+              , std::string const&
               , std::vector<efl::eolian::grammar::attributes::klass_def>&
               , std::vector<efl::eolian::grammar::attributes::klass_def>&
               > attributes
-   {guard_name, c_headers, cpp_headers, cpp_types_header, klasses, forward_klasses, klasses, klasses};
+   {guard_name, c_headers, cpp_headers, klasses, forward_klasses, cpp_types_header, klasses, klasses};
 
    if(opts.out_file == "-")
      {
index 67e3f37..669c7e4 100644 (file)
@@ -8,8 +8,6 @@
   match that.
 */
 
-//type Edje.Signal_Cb: __undefined_type; [[Edje signal callback type]]
-
 type Efl.Signal_Cb: __undefined_type; [[Signal callback.]]
 
 interface Efl.Canvas.Layout_Signal
index 4f1df92..2943540 100644 (file)
@@ -24,9 +24,9 @@ auto class_header =
     << "#include <Eina.hh>\n"
        "#include <Eo.hh>\n"
     << *header_include_directive // sequence<string>
-    <<  string                   // extra header <string>
     << *class_declaration          // sequence<class> | class
     << *class_forward_declaration          // sequence<class> | class
+    <<  string                   // extra header <string>
     << "\nnamespace eo_cxx {\n"
     << *base_class_definition      // sequence<class> | class
     << "}\n"