On Tue, Dec 12, 2017 at 10:23 AM, Gustavo Sverzut Barbieri
<[email protected]> wrote:
>> efl_future_Eina_FutureXXX_then(data, f);
>
> now must rename these efl_future_Eina_FutureXXX_then() helpers to
> efl_future_then().
>
> Worth remembering: efl_future_then() is the one that links/binds an
> object to the future, if the object dies, then the futures are
> cancelled.
>
> After that we need to ping q66 to change future<Type> to the new Eina_Future:
>
> - if <Type>, then provide a type to be checked by efl_future_then_easy()
>
> - all properties/methods generated by eolian should apply
> efl_future_then() (or variant) to their result. This enforces the
> object is linked with the future. Maybe make this explicit (ie:
> @bound(future<Type>)) or explicitly disable (@unbond(future<Type>), my
> preference since it's less common).
>
> then you can remove those from code, I tried to mark all of them, see:
> https://git.enlightenment.org/core/efl.git/tree/src/lib/ecore/ecore_main.c#n3217
>
> In a next-usability step, we should have Eolian to generate
> Eina_Value_Struct_Desc for Type. This is required for validators AND
> for users of the struct, which could use the "mem" field with a cast
> OR use eina_value_struct_... method.
>
> and I just noticed that eina_future_then_easy() (and efl_... variant)
> will not check for the struct desc, just type comparison (which is
> "struct", but not "which struct"), so likely extend
> Eina_Future_Cb_Easy_Desc with:
>
> union {
> const Eina_Value_Struct_Desc *struct_desc;
> const Eina_Value_Type *subtype; // array, list, hash
> };
hum... maybe this can be converted to Eina_Value_Type callback
(bumping Eina_Value API), such as "eina_value_is(type, mem,
extra_data)". With "extra_data" being struct_desc/subtype... for those
stuff, but that would allow Eo to implement an extra type check, ie:
EAPI Eina_Bool
eina_value_is(const Eina_Value *value, const Eina_Value_Type
*desired_type, const void *extra_data)
{
if (!eina_value_type_check(desired_type)) return EINA_FALSE; // checks ABI
if (eina_value_type_get(value) != desired_type) return EINA_FALSE;
if (!desired_type->is) return EINA_TRUE;
return desired_type->is(desired_type, eina_value_mem_get(value), extra_data);
}
eina_value_type_eo_is(type, mem, extra_data) {
if (!extra_data) return EINA_TRUE; // no class, just checks if an object
return efl_class_get(mem) == extra_data;
}
this way, extra_data could be given an Efl_Class...
Sorry about the noise, but currently these types were not annotated by
.eo and type checking is done manually in code, so this "didn't show"
before :-(
--
Gustavo Sverzut Barbieri
--------------------------------------
Mobile: +55 (16) 99354-9890
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel