diff options
author | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2017-01-11 18:18:48 +0100 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2017-01-11 19:26:21 +0100 |
commit | 289287f497df2d521dc5e1c66e31c83ceeed3a47 (patch) | |
tree | 9a1156e71cc35804228ab6768f24928670628cd4 /src | |
parent | 6d51e0b1f3cb84e6796790a8183a21ba7d3dc190 (diff) |
eolian: remove function_is_implemented
Its design does not match current Eolian and will be replaced later.
There isn't any generator using it right now, so it's safe to remove.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/eolian/Eolian.h | 13 | ||||
-rw-r--r-- | src/lib/eolian/database_function_api.c | 63 | ||||
-rw-r--r-- | src/tests/eolian/eolian_parsing.c | 12 |
3 files changed, 0 insertions, 88 deletions
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index 4275e90377..820bcb547f 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h | |||
@@ -1022,19 +1022,6 @@ EAPI Eina_Bool eolian_function_object_is_const(const Eolian_Function *function_i | |||
1022 | EAPI const Eolian_Class *eolian_function_class_get(const Eolian_Function *function_id); | 1022 | EAPI const Eolian_Class *eolian_function_class_get(const Eolian_Function *function_id); |
1023 | 1023 | ||
1024 | /* | 1024 | /* |
1025 | * @brief Determine if a function is implemented in the inheritance of the given class | ||
1026 | * | ||
1027 | * @param[in] function_id id of the function | ||
1028 | * @param[in] func_type type requested | ||
1029 | * @param[in] klass the top class to begin with | ||
1030 | * @return EINA_TRUE if found, EINA_FALSE otherwise | ||
1031 | * | ||
1032 | * @ingroup Eolian | ||
1033 | */ | ||
1034 | EAPI Eina_Bool eolian_function_is_implemented(const Eolian_Function *function_id, | ||
1035 | Eolian_Function_Type func_type, const Eolian_Class *klass); | ||
1036 | |||
1037 | /* | ||
1038 | * @brief Get full string of an overriding function (implement). | 1025 | * @brief Get full string of an overriding function (implement). |
1039 | * | 1026 | * |
1040 | * @param[in] impl the handle of the implement | 1027 | * @param[in] impl the handle of the implement |
diff --git a/src/lib/eolian/database_function_api.c b/src/lib/eolian/database_function_api.c index 7ae544b5cb..fd12325890 100644 --- a/src/lib/eolian/database_function_api.c +++ b/src/lib/eolian/database_function_api.c | |||
@@ -358,66 +358,3 @@ eolian_function_is_beta(const Eolian_Function *fid) | |||
358 | EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); | 358 | EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); |
359 | return fid->is_beta; | 359 | return fid->is_beta; |
360 | } | 360 | } |
361 | |||
362 | EAPI Eina_Bool eolian_function_is_implemented( | ||
363 | const Eolian_Function *function_id, Eolian_Function_Type func_type, | ||
364 | const Eolian_Class *klass) | ||
365 | { | ||
366 | Eina_Iterator *impl_itr = NULL; | ||
367 | Eolian_Function_Type found_type = EOLIAN_UNRESOLVED; | ||
368 | Eina_Bool found = EINA_TRUE; | ||
369 | if (!function_id || !klass) return EINA_FALSE; | ||
370 | Eina_List *list = eina_list_append(NULL, klass), *list2, *itr; | ||
371 | EINA_LIST_FOREACH(list, itr, klass) | ||
372 | { | ||
373 | const char *inherit_name; | ||
374 | const Eolian_Implement *impl; | ||
375 | if (eolian_class_type_get(klass) == EOLIAN_CLASS_INTERFACE) continue; | ||
376 | impl_itr = eolian_class_implements_get(klass); | ||
377 | EINA_ITERATOR_FOREACH(impl_itr, impl) | ||
378 | { | ||
379 | if (eolian_implement_is_virtual(impl)) continue; | ||
380 | Eolian_Function_Type impl_type = EOLIAN_UNRESOLVED; | ||
381 | const Eolian_Function *impl_func = eolian_implement_function_get(impl, &impl_type); | ||
382 | if (impl_func == function_id) | ||
383 | { | ||
384 | /* The type matches the requested or is not important for the caller */ | ||
385 | if (func_type == EOLIAN_UNRESOLVED || impl_type == func_type) goto end; | ||
386 | if (impl_type == EOLIAN_METHOD) continue; | ||
387 | /* In case we search for a property type */ | ||
388 | if (impl_type == EOLIAN_PROPERTY && | ||
389 | (func_type == EOLIAN_PROP_GET || func_type == EOLIAN_PROP_SET)) | ||
390 | goto end; | ||
391 | /* Property may be splitted on multiple implements */ | ||
392 | if (func_type == EOLIAN_PROPERTY) | ||
393 | { | ||
394 | if (found_type == EOLIAN_UNRESOLVED) found_type = impl_type; | ||
395 | if ((found_type == EOLIAN_PROP_SET && impl_type == EOLIAN_PROP_GET) || | ||
396 | (found_type == EOLIAN_PROP_GET && impl_type == EOLIAN_PROP_SET)) | ||
397 | goto end; | ||
398 | } | ||
399 | } | ||
400 | } | ||
401 | eina_iterator_free(impl_itr); | ||
402 | impl_itr = NULL; | ||
403 | |||
404 | Eina_Iterator *inherits_itr = eolian_class_inherits_get(klass); | ||
405 | EINA_ITERATOR_FOREACH(inherits_itr, inherit_name) | ||
406 | { | ||
407 | const Eolian_Class *inherit = eolian_class_get_by_name(inherit_name); | ||
408 | /* Avoid duplicates. */ | ||
409 | if (!eina_list_data_find(list, inherit)) | ||
410 | { | ||
411 | list2 = eina_list_append(list, inherit); | ||
412 | } | ||
413 | } | ||
414 | eina_iterator_free(inherits_itr); | ||
415 | } | ||
416 | (void) list2; | ||
417 | found = EINA_FALSE; | ||
418 | end: | ||
419 | if (impl_itr) eina_iterator_free(impl_itr); | ||
420 | eina_list_free(list); | ||
421 | return found; | ||
422 | } | ||
423 | |||
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c index b7146aeb09..7185ab29d8 100644 --- a/src/tests/eolian/eolian_parsing.c +++ b/src/tests/eolian/eolian_parsing.c | |||
@@ -188,27 +188,15 @@ START_TEST(eolian_override) | |||
188 | /* Base ctor */ | 188 | /* Base ctor */ |
189 | fail_if(!(fid = eolian_class_function_get_by_name(base, "constructor", EOLIAN_UNRESOLVED))); | 189 | fail_if(!(fid = eolian_class_function_get_by_name(base, "constructor", EOLIAN_UNRESOLVED))); |
190 | fail_if(!eolian_function_is_virtual_pure(fid, EOLIAN_UNRESOLVED)); | 190 | fail_if(!eolian_function_is_virtual_pure(fid, EOLIAN_UNRESOLVED)); |
191 | fail_if(!eolian_function_is_implemented(fid, EOLIAN_UNRESOLVED, class)); | ||
192 | fail_if(!eolian_function_is_implemented(fid, EOLIAN_METHOD, class)); | ||
193 | fail_if(eolian_function_is_implemented(fid, EOLIAN_PROP_GET, class)); | ||
194 | 191 | ||
195 | /* Property */ | 192 | /* Property */ |
196 | fail_if(!(fid = eolian_class_function_get_by_name(class, "a", EOLIAN_PROPERTY))); | 193 | fail_if(!(fid = eolian_class_function_get_by_name(class, "a", EOLIAN_PROPERTY))); |
197 | fail_if(!eolian_function_is_virtual_pure(fid, EOLIAN_PROP_SET)); | 194 | fail_if(!eolian_function_is_virtual_pure(fid, EOLIAN_PROP_SET)); |
198 | fail_if(eolian_function_is_virtual_pure(fid, EOLIAN_PROP_GET)); | 195 | fail_if(eolian_function_is_virtual_pure(fid, EOLIAN_PROP_GET)); |
199 | fail_if(eolian_function_is_implemented(fid, EOLIAN_PROP_SET, class)); | ||
200 | fail_if(!eolian_function_is_implemented(fid, EOLIAN_PROP_GET, class)); | ||
201 | fail_if(eolian_function_is_implemented(fid, EOLIAN_PROPERTY, class)); | ||
202 | 196 | ||
203 | /* Method */ | 197 | /* Method */ |
204 | fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD))); | 198 | fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD))); |
205 | fail_if(!eolian_function_is_virtual_pure(fid, EOLIAN_METHOD)); | 199 | fail_if(!eolian_function_is_virtual_pure(fid, EOLIAN_METHOD)); |
206 | fail_if(eolian_function_is_implemented(fid, EOLIAN_UNRESOLVED, class)); | ||
207 | fail_if(eolian_function_is_implemented(fid, EOLIAN_UNRESOLVED, base)); | ||
208 | |||
209 | fail_if(!(fid = eolian_class_function_get_by_name(base, "z", EOLIAN_PROPERTY))); | ||
210 | fail_if(!eolian_function_is_implemented(fid, EOLIAN_PROPERTY, class)); | ||
211 | fail_if(!eolian_function_is_implemented(fid, EOLIAN_PROP_SET, class)); | ||
212 | 200 | ||
213 | /* Implements */ | 201 | /* Implements */ |
214 | fail_if(!(iter = eolian_class_implements_get(class))); | 202 | fail_if(!(iter = eolian_class_implements_get(class))); |