summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-22 20:46:26 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-12-05 10:14:03 +0900
commit03af836332b6b80975a402c865542fccf2f56de1 (patch)
tree0cd428e5a650bccb071a34edc747d4bc1e7821f3 /src/bin
parent4fdc5fd0b20bf9c56248858fb31aa02cad306e77 (diff)
cxx: Use set for forward classes
This avoids duplication. Not very important as there are FWD_GUARD macros anyway.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian_cxx/eolian_cxx.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/bin/eolian_cxx/eolian_cxx.cc b/src/bin/eolian_cxx/eolian_cxx.cc
index 29c81d32d7..2df5b9ae2d 100644
--- a/src/bin/eolian_cxx/eolian_cxx.cc
+++ b/src/bin/eolian_cxx/eolian_cxx.cc
@@ -74,7 +74,7 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts,
74 74
75 efl::eolian::grammar::attributes::klass_def klass_def(klass, opts.unit); 75 efl::eolian::grammar::attributes::klass_def klass_def(klass, opts.unit);
76 std::vector<efl::eolian::grammar::attributes::klass_def> klasses{klass_def}; 76 std::vector<efl::eolian::grammar::attributes::klass_def> klasses{klass_def};
77 std::vector<efl::eolian::grammar::attributes::klass_def> forward_klasses{}; 77 std::set<efl::eolian::grammar::attributes::klass_def> forward_klasses{};
78 78
79 std::set<std::string> c_headers; 79 std::set<std::string> c_headers;
80 std::set<std::string> cpp_headers; 80 std::set<std::string> cpp_headers;
@@ -90,8 +90,7 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts,
90 c_headers.insert(eolian_class_file_get(klass2) + std::string(".h")); 90 c_headers.insert(eolian_class_file_get(klass2) + std::string(".h"));
91 cpp_headers.insert(eolian_class_file_get(klass2) + std::string(".hh")); 91 cpp_headers.insert(eolian_class_file_get(klass2) + std::string(".hh"));
92 efl::eolian::grammar::attributes::klass_def cls{klass2, opts.unit}; 92 efl::eolian::grammar::attributes::klass_def cls{klass2, opts.unit};
93 if(std::find(forward_klasses.begin(), forward_klasses.end(), cls) == forward_klasses.end()) 93 forward_klasses.insert(cls);
94 forward_klasses.push_back(cls);
95 }; 94 };
96 auto complex_function 95 auto complex_function
97 = [&] (efl::eolian::grammar::attributes::complex_type_def const& complex) 96 = [&] (efl::eolian::grammar::attributes::complex_type_def const& complex)
@@ -123,8 +122,7 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts,
123 c_headers.insert(eolian_class_file_get(inherit) + std::string(".h")); 122 c_headers.insert(eolian_class_file_get(inherit) + std::string(".h"));
124 cpp_headers.insert(eolian_class_file_get(inherit) + std::string(".hh")); 123 cpp_headers.insert(eolian_class_file_get(inherit) + std::string(".hh"));
125 efl::eolian::grammar::attributes::klass_def klass3{inherit, opts.unit}; 124 efl::eolian::grammar::attributes::klass_def klass3{inherit, opts.unit};
126 if(std::find(forward_klasses.begin(), forward_klasses.end(), klass3) == forward_klasses.end()) 125 forward_klasses.insert(klass3);
127 forward_klasses.push_back(klass3);
128 126
129 klass_function(inherit); 127 klass_function(inherit);
130 } 128 }
@@ -157,7 +155,7 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts,
157 std::tuple<std::string, std::set<std::string>&, std::set<std::string>& 155 std::tuple<std::string, std::set<std::string>&, std::set<std::string>&
158 , std::string const& 156 , std::string const&
159 , std::vector<efl::eolian::grammar::attributes::klass_def>& 157 , std::vector<efl::eolian::grammar::attributes::klass_def>&
160 , std::vector<efl::eolian::grammar::attributes::klass_def>& 158 , std::set<efl::eolian::grammar::attributes::klass_def> const&
161 , std::vector<efl::eolian::grammar::attributes::klass_def>& 159 , std::vector<efl::eolian::grammar::attributes::klass_def>&
162 , std::vector<efl::eolian::grammar::attributes::klass_def>& 160 , std::vector<efl::eolian::grammar::attributes::klass_def>&
163 > attributes 161 > attributes