summaryrefslogtreecommitdiff
path: root/src/bin/eolian_cxx
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-07-09 16:33:07 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-07-09 16:33:19 +0100
commit96eaaaf0746b960c7da7a55fa84602138ef5da64 (patch)
tree8e4980972fcf0b2ab6ff46738b8ff97c9fa665a0 /src/bin/eolian_cxx
parentca82befa8a30a38c28f1dc8b46e350c8ca2d0446 (diff)
eolian: refactoring step two
Move from all instances of Eolian_Class to Eolian_Class*.
Diffstat (limited to 'src/bin/eolian_cxx')
-rw-r--r--src/bin/eolian_cxx/convert.cc20
-rw-r--r--src/bin/eolian_cxx/convert.hh4
-rw-r--r--src/bin/eolian_cxx/convert_comments.cc2
-rw-r--r--src/bin/eolian_cxx/convert_comments.hh2
-rw-r--r--src/bin/eolian_cxx/eolian_cxx.cc10
-rw-r--r--src/bin/eolian_cxx/eolian_wrappers.hh28
6 files changed, 33 insertions, 33 deletions
diff --git a/src/bin/eolian_cxx/convert.cc b/src/bin/eolian_cxx/convert.cc
index e50dd4626d..1a5917d95e 100644
--- a/src/bin/eolian_cxx/convert.cc
+++ b/src/bin/eolian_cxx/convert.cc
@@ -73,7 +73,7 @@ convert_eolian_parameters(Eolian_Function const& func)
73} 73}
74 74
75static efl::eolian::functions_container_type 75static efl::eolian::functions_container_type
76convert_eolian_property_to_functions(Eolian_Class const& klass) 76convert_eolian_property_to_functions(Eolian_Class const *& klass)
77{ 77{
78 efl::eolian::functions_container_type container; 78 efl::eolian::functions_container_type container;
79 std::string cxx_classname = safe_lower(class_name(klass)); 79 std::string cxx_classname = safe_lower(class_name(klass));
@@ -156,7 +156,7 @@ convert_eolian_property_to_functions(Eolian_Class const& klass)
156} 156}
157 157
158void 158void
159convert_eolian_inheritances(efl::eolian::eo_class& cls, Eolian_Class const& klass) 159convert_eolian_inheritances(efl::eolian::eo_class& cls, Eolian_Class const *& klass)
160{ 160{
161 const Eina_List *inheritances = 161 const Eina_List *inheritances =
162 ::eolian_class_inherits_list_get(klass); 162 ::eolian_class_inherits_list_get(klass);
@@ -190,7 +190,7 @@ convert_eolian_inheritances(efl::eolian::eo_class& cls, Eolian_Class const& klas
190} 190}
191 191
192void 192void
193convert_eolian_implements(efl::eolian::eo_class& cls, Eolian_Class const& klass) 193convert_eolian_implements(efl::eolian::eo_class& cls, Eolian_Class const *& klass)
194{ 194{
195 const Eina_List *it; 195 const Eina_List *it;
196 std::string prefix(class_prefix(klass)); 196 std::string prefix(class_prefix(klass));
@@ -199,7 +199,7 @@ convert_eolian_implements(efl::eolian::eo_class& cls, Eolian_Class const& klass)
199 EINA_LIST_FOREACH(eolian_class_implements_list_get(klass), it, impl_desc_) 199 EINA_LIST_FOREACH(eolian_class_implements_list_get(klass), it, impl_desc_)
200 { 200 {
201 Eolian_Implement impl_desc = static_cast<Eolian_Implement>(impl_desc_); 201 Eolian_Implement impl_desc = static_cast<Eolian_Implement>(impl_desc_);
202 Eolian_Class impl_class; 202 Eolian_Class *impl_class;
203 Eolian_Function impl_func; 203 Eolian_Function impl_func;
204 Eolian_Function_Type impl_type; 204 Eolian_Function_Type impl_type;
205 eolian_implement_information_get 205 eolian_implement_information_get
@@ -218,7 +218,7 @@ convert_eolian_implements(efl::eolian::eo_class& cls, Eolian_Class const& klass)
218} 218}
219 219
220void 220void
221convert_eolian_constructors(efl::eolian::eo_class& cls, Eolian_Class const& klass) 221convert_eolian_constructors(efl::eolian::eo_class& cls, Eolian_Class const *& klass)
222{ 222{
223 const Eina_List *it; 223 const Eina_List *it;
224 void *curr; 224 void *curr;
@@ -237,7 +237,7 @@ convert_eolian_constructors(efl::eolian::eo_class& cls, Eolian_Class const& klas
237} 237}
238 238
239void 239void
240convert_eolian_functions(efl::eolian::eo_class& cls, Eolian_Class const& klass) 240convert_eolian_functions(efl::eolian::eo_class& cls, Eolian_Class const *& klass)
241{ 241{
242 const Eina_List *it; 242 const Eina_List *it;
243 void *curr; 243 void *curr;
@@ -260,7 +260,7 @@ convert_eolian_functions(efl::eolian::eo_class& cls, Eolian_Class const& klass)
260} 260}
261 261
262void 262void
263convert_eolian_properties(efl::eolian::eo_class& cls, Eolian_Class const& klass) 263convert_eolian_properties(efl::eolian::eo_class& cls, Eolian_Class const *& klass)
264{ 264{
265 efl::eolian::functions_container_type properties 265 efl::eolian::functions_container_type properties
266 = convert_eolian_property_to_functions(klass); 266 = convert_eolian_property_to_functions(klass);
@@ -269,7 +269,7 @@ convert_eolian_properties(efl::eolian::eo_class& cls, Eolian_Class const& klass)
269} 269}
270 270
271void 271void
272convert_eolian_events(efl::eolian::eo_class& cls, Eolian_Class const& klass) 272convert_eolian_events(efl::eolian::eo_class& cls, Eolian_Class const *& klass)
273{ 273{
274 efl::eolian::events_container_type events = event_list(klass); 274 efl::eolian::events_container_type events = event_list(klass);
275 cls.events.reserve(cls.events.size() + events.size()); 275 cls.events.reserve(cls.events.size() + events.size());
@@ -277,7 +277,7 @@ convert_eolian_events(efl::eolian::eo_class& cls, Eolian_Class const& klass)
277} 277}
278 278
279efl::eolian::eo_class 279efl::eolian::eo_class
280convert_eolian_class_new(Eolian_Class const& klass) 280convert_eolian_class_new(Eolian_Class const *& klass)
281{ 281{
282 efl::eolian::eo_class cls; 282 efl::eolian::eo_class cls;
283 cls.type = class_type(klass); 283 cls.type = class_type(klass);
@@ -289,7 +289,7 @@ convert_eolian_class_new(Eolian_Class const& klass)
289} 289}
290 290
291efl::eolian::eo_class 291efl::eolian::eo_class
292convert_eolian_class(const Eolian_Class klass) 292convert_eolian_class(const Eolian_Class *klass)
293{ 293{
294 assert(klass != NULL); 294 assert(klass != NULL);
295 efl::eolian::eo_class cls(eolian_cxx::convert_eolian_class_new(klass)); 295 efl::eolian::eo_class cls(eolian_cxx::convert_eolian_class_new(klass));
diff --git a/src/bin/eolian_cxx/convert.hh b/src/bin/eolian_cxx/convert.hh
index 1f692b4471..43d746213c 100644
--- a/src/bin/eolian_cxx/convert.hh
+++ b/src/bin/eolian_cxx/convert.hh
@@ -8,11 +8,11 @@ namespace eolian_cxx
8{ 8{
9 9
10/// 10///
11/// @brief Retrieve a efl::eolian::eo_class from an Eolian_Class name. 11/// @brief Retrieve a efl::eolian::eo_class from an Eolian_Class* name.
12/// @param cls The Eolian class. 12/// @param cls The Eolian class.
13/// @return The @p eo_class describing @p classname. 13/// @return The @p eo_class describing @p classname.
14/// 14///
15efl::eolian::eo_class convert_eolian_class(Eolian_Class klass); 15efl::eolian::eo_class convert_eolian_class(const Eolian_Class *klass);
16 16
17} 17}
18 18
diff --git a/src/bin/eolian_cxx/convert_comments.cc b/src/bin/eolian_cxx/convert_comments.cc
index fae7591bc8..6dd0c2ce3e 100644
--- a/src/bin/eolian_cxx/convert_comments.cc
+++ b/src/bin/eolian_cxx/convert_comments.cc
@@ -77,7 +77,7 @@ _comment_return(Eolian_Function function,
77} 77}
78 78
79std::string 79std::string
80convert_comments_class(Eolian_Class const& klass) 80convert_comments_class(Eolian_Class const *& klass)
81{ 81{
82 return safe_str(eolian_class_description_get(klass)); 82 return safe_str(eolian_class_description_get(klass));
83} 83}
diff --git a/src/bin/eolian_cxx/convert_comments.hh b/src/bin/eolian_cxx/convert_comments.hh
index 75d420af58..2adad607c1 100644
--- a/src/bin/eolian_cxx/convert_comments.hh
+++ b/src/bin/eolian_cxx/convert_comments.hh
@@ -11,7 +11,7 @@
11 11
12namespace eolian_cxx { 12namespace eolian_cxx {
13 13
14std::string convert_comments_class(Eolian_Class const& kls); 14std::string convert_comments_class(Eolian_Class const *& kls);
15 15
16std::string convert_comments_function(Eolian_Function const& function, 16std::string convert_comments_function(Eolian_Function const& function,
17 Eolian_Function_Type func_type); 17 Eolian_Function_Type func_type);
diff --git a/src/bin/eolian_cxx/eolian_cxx.cc b/src/bin/eolian_cxx/eolian_cxx.cc
index e10a849c1b..c034ef597f 100644
--- a/src/bin/eolian_cxx/eolian_cxx.cc
+++ b/src/bin/eolian_cxx/eolian_cxx.cc
@@ -88,7 +88,7 @@ opts_check(eolian_cxx::options_type const& opts)
88} 88}
89 89
90efl::eolian::eo_generator_options 90efl::eolian::eo_generator_options
91generator_options(const Eolian_Class klass) 91generator_options(const Eolian_Class *klass)
92{ 92{
93 efl::eolian::eo_generator_options gen_opts; 93 efl::eolian::eo_generator_options gen_opts;
94 gen_opts.c_headers.push_back(class_base_file(klass) + ".h"); 94 gen_opts.c_headers.push_back(class_base_file(klass) + ".h");
@@ -97,7 +97,7 @@ generator_options(const Eolian_Class klass)
97 const Eina_List *itr, *inheritances = eolian_class_inherits_list_get(klass); 97 const Eina_List *itr, *inheritances = eolian_class_inherits_list_get(klass);
98 EINA_LIST_FOREACH(inheritances, itr, cur) 98 EINA_LIST_FOREACH(inheritances, itr, cur)
99 { 99 {
100 Eolian_Class ext = eolian_class_find_by_name(static_cast<const char*>(cur)); 100 const Eolian_Class *ext = eolian_class_find_by_name(static_cast<const char*>(cur));
101 std::string eo_parent_file = class_base_file(ext); 101 std::string eo_parent_file = class_base_file(ext);
102 if (!eo_parent_file.empty()) 102 if (!eo_parent_file.empty())
103 { 103 {
@@ -121,7 +121,7 @@ generator_options(const Eolian_Class klass)
121} 121}
122 122
123static bool 123static bool
124generate(const Eolian_Class klass, eolian_cxx::options_type const& opts) 124generate(const Eolian_Class *klass, eolian_cxx::options_type const& opts)
125{ 125{
126 assert(!!klass); 126 assert(!!klass);
127 efl::eolian::eo_class cls = eolian_cxx::convert_eolian_class(klass); 127 efl::eolian::eo_class cls = eolian_cxx::convert_eolian_class(klass);
@@ -157,7 +157,7 @@ generate(const Eolian_Class klass, eolian_cxx::options_type const& opts)
157static void 157static void
158run(options_type const& opts) 158run(options_type const& opts)
159{ 159{
160 Eolian_Class klass = NULL; 160 const Eolian_Class *klass = NULL;
161 if (!opts.classname.empty()) 161 if (!opts.classname.empty())
162 klass = class_from_name(opts.classname); 162 klass = class_from_name(opts.classname);
163 else if (!opts.in_file.empty()) 163 else if (!opts.in_file.empty())
@@ -170,7 +170,7 @@ run(options_type const& opts)
170 else 170 else
171 { 171 {
172 auto classes = class_list_all(); 172 auto classes = class_list_all();
173 for (const Eolian_Class c : classes) 173 for (const Eolian_Class *c : classes)
174 { 174 {
175 if (!generate(c, opts)) 175 if (!generate(c, opts))
176 { 176 {
diff --git a/src/bin/eolian_cxx/eolian_wrappers.hh b/src/bin/eolian_cxx/eolian_wrappers.hh
index 538f8d8a6a..cb979d0895 100644
--- a/src/bin/eolian_cxx/eolian_wrappers.hh
+++ b/src/bin/eolian_cxx/eolian_wrappers.hh
@@ -27,44 +27,44 @@ method_t const method = {};
27struct ctor_t { static constexpr ::Eolian_Function_Type value = ::EOLIAN_CTOR; }; 27struct ctor_t { static constexpr ::Eolian_Function_Type value = ::EOLIAN_CTOR; };
28ctor_t const ctor = {}; 28ctor_t const ctor = {};
29 29
30inline Eolian_Class 30inline Eolian_Class *
31class_from_file(std::string const& file) 31class_from_file(std::string const& file)
32{ 32{
33 return ::eolian_class_find_by_file(file.c_str()); 33 return ::eolian_class_find_by_file(file.c_str());
34} 34}
35 35
36inline std::string 36inline std::string
37class_file(Eolian_Class const& klass) 37class_file(Eolian_Class const *& klass)
38{ 38{
39 return safe_str(::eolian_class_file_get(klass)); 39 return safe_str(::eolian_class_file_get(klass));
40} 40}
41 41
42inline std::string 42inline std::string
43class_base_file(Eolian_Class const& klass) 43class_base_file(Eolian_Class const *& klass)
44{ 44{
45 return path_base(safe_str(::eolian_class_file_get(klass))); 45 return path_base(safe_str(::eolian_class_file_get(klass)));
46} 46}
47 47
48inline std::string 48inline std::string
49class_name(Eolian_Class const& klass) 49class_name(Eolian_Class const *& klass)
50{ 50{
51 return safe_str(::eolian_class_name_get(klass)); 51 return safe_str(::eolian_class_name_get(klass));
52} 52}
53 53
54inline std::string 54inline std::string
55class_full_name(Eolian_Class const& klass) 55class_full_name(Eolian_Class const *& klass)
56{ 56{
57 return safe_str(::eolian_class_full_name_get(klass)); 57 return safe_str(::eolian_class_full_name_get(klass));
58} 58}
59 59
60inline Eolian_Class 60inline Eolian_Class *
61class_from_name(std::string const& classname) 61class_from_name(std::string const& classname)
62{ 62{
63 return ::eolian_class_find_by_name(classname.c_str()); 63 return ::eolian_class_find_by_name(classname.c_str());
64} 64}
65 65
66inline std::string 66inline std::string
67class_eo_name(Eolian_Class const& klass) 67class_eo_name(Eolian_Class const *& klass)
68{ 68{
69 std::string suffix; 69 std::string suffix;
70 switch (eolian_class_type_get(klass)) 70 switch (eolian_class_type_get(klass))
@@ -105,7 +105,7 @@ class_format_cxx(std::string const& fullname)
105} 105}
106 106
107inline std::string 107inline std::string
108class_prefix(Eolian_Class const& klass) 108class_prefix(Eolian_Class const *& klass)
109{ 109{
110 std::string prefix = safe_lower(::eolian_class_eo_prefix_get(klass)); 110 std::string prefix = safe_lower(::eolian_class_eo_prefix_get(klass));
111 if (prefix.empty()) 111 if (prefix.empty())
@@ -115,7 +115,7 @@ class_prefix(Eolian_Class const& klass)
115} 115}
116 116
117inline efl::eolian::eo_class::eo_class_type 117inline efl::eolian::eo_class::eo_class_type
118class_type(Eolian_Class const& klass) 118class_type(Eolian_Class const *& klass)
119{ 119{
120 assert(klass != NULL); 120 assert(klass != NULL);
121 efl::eolian::eo_class::eo_class_type type; 121 efl::eolian::eo_class::eo_class_type type;
@@ -135,7 +135,7 @@ class_type(Eolian_Class const& klass)
135} 135}
136 136
137inline std::string 137inline std::string
138class_namespace_full(Eolian_Class const& klass) 138class_namespace_full(Eolian_Class const *& klass)
139{ 139{
140 std::string s; 140 std::string s;
141 const Eina_List* list = 141 const Eina_List* list =
@@ -151,10 +151,10 @@ class_namespace_full(Eolian_Class const& klass)
151 return safe_lower(s); 151 return safe_lower(s);
152} 152}
153 153
154inline efl::eina::range_ptr_list<const Eolian_Class> 154inline efl::eina::range_ptr_list<const Eolian_Class *>
155class_list_all() 155class_list_all()
156{ 156{
157 return ::eolian_all_classes_list_get(); 157 return (Eina_List*)::eolian_all_classes_list_get();
158} 158}
159 159
160inline std::string 160inline std::string
@@ -308,7 +308,7 @@ parameter_type(Eolian_Function_Parameter const& parameter, setter_t func_type)
308} 308}
309 309
310inline efl::eolian::eo_event 310inline efl::eolian::eo_event
311event_create(Eolian_Class const& klass, const Eolian_Event event_) 311event_create(Eolian_Class const *& klass, const Eolian_Event event_)
312{ 312{
313 efl::eolian::eo_event event; 313 efl::eolian::eo_event event;
314 const char *name, *type, *comment; 314 const char *name, *type, *comment;
@@ -325,7 +325,7 @@ event_create(Eolian_Class const& klass, const Eolian_Event event_)
325} 325}
326 326
327inline efl::eolian::events_container_type 327inline efl::eolian::events_container_type
328event_list(Eolian_Class const& klass) 328event_list(Eolian_Class const *& klass)
329{ 329{
330 efl::eolian::events_container_type events; 330 efl::eolian::events_container_type events;
331 const Eina_List* list = eolian_class_events_list_get(klass); 331 const Eina_List* list = eolian_class_events_list_get(klass);