summaryrefslogtreecommitdiff
path: root/src/tests/eo/suite/eo_test_class_simple.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-05-04 10:08:00 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-05-04 10:43:55 +0200
commitc66695bedb2f4986a21b7c10087b26b78d036e85 (patch)
tree67a23b3e3852d63b6d1ae31a82a9995eb3d986df /src/tests/eo/suite/eo_test_class_simple.c
parent1ee72bbf04eb2297f47e888c66b107d9ad27d013 (diff)
eo: replace loop_get with object_find
Summary: object_find is more generic, so other mechanisms can also reuse the code. The object itself has to support the function, so there is no need for eo_isa which would have a negative performance impact. The base class implementation calls interface_get on the parent, so a override of the function can just call the super function to continue in the recursion. Test Plan: just run the eo test suite Reviewers: raster, tasn, jpeg Reviewed By: tasn, jpeg Subscribers: felipealmeida, netstar, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3909
Diffstat (limited to 'src/tests/eo/suite/eo_test_class_simple.c')
-rw-r--r--src/tests/eo/suite/eo_test_class_simple.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/tests/eo/suite/eo_test_class_simple.c b/src/tests/eo/suite/eo_test_class_simple.c
index 8566ed9929..dcc3991553 100644
--- a/src/tests/eo/suite/eo_test_class_simple.c
+++ b/src/tests/eo/suite/eo_test_class_simple.c
@@ -137,3 +137,28 @@ static const Eo_Class_Description class_desc2 = {
137}; 137};
138 138
139EO_DEFINE_CLASS(simple2_class_get, &class_desc2, EO_CLASS, NULL) 139EO_DEFINE_CLASS(simple2_class_get, &class_desc2, EO_CLASS, NULL)
140
141static Eo_Base*
142_interface_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const Eo_Base *klass)
143{
144 if (klass == SEARCHABLE_CLASS) return obj;
145
146 return eo_provider_find(eo_super(obj, SEARCHABLE_CLASS), klass);
147}
148
149static Eo_Op_Description op_descs_searchable[] = {
150 EO_OP_FUNC_OVERRIDE(eo_provider_find, _interface_get)
151};
152
153static const Eo_Class_Description class_desc_searchable = {
154 EO_VERSION,
155 "Searchable",
156 EO_CLASS_TYPE_REGULAR,
157 EO_CLASS_DESCRIPTION_OPS(op_descs_searchable),
158 NULL,
159 0,
160 NULL,
161 NULL
162};
163
164EO_DEFINE_CLASS(searchable_class_get, &class_desc_searchable, EO_CLASS, NULL) \ No newline at end of file