Eolian: Remove useless functions.

Default ctor/dtor are considered as implemented functions and no more as
special functions.
This commit is contained in:
Daniel Zaoui 2014-04-23 16:26:15 +03:00
parent 7355f67c1f
commit f36fac8ec6
3 changed files with 1 additions and 74 deletions

View File

@ -618,19 +618,6 @@ eo_source_end_generate(const char *classname, Eina_Strbuf *buf)
eina_strbuf_reset(tmpbuf);
// default constructor
Eolian_Function ctor_fn = eolian_class_default_constructor_get(classname);
if (ctor_fn)
{
eo_bind_func_generate(classname, ctor_fn, EOLIAN_UNRESOLVED, str_bodyf, NULL);
}
// default destructor
Eolian_Function dtor_fn = eolian_class_default_destructor_get(classname);
if (dtor_fn)
{
eo_bind_func_generate(classname, dtor_fn, EOLIAN_UNRESOLVED, str_bodyf, NULL);
}
//Implements - TODO one generate func def for all
Eolian_Implement impl_desc;
EINA_LIST_FOREACH(eolian_class_implements_list_get(classname), itr, impl_desc)

View File

@ -95,9 +95,7 @@ typedef enum
EOLIAN_PROP_GET,
EOLIAN_METHOD,
EOLIAN_CTOR,
EOLIAN_DTOR,
EOLIAN_DFLT_CTOR,
EOLIAN_DFLT_DTOR
EOLIAN_DTOR
} Eolian_Function_Type;
typedef enum
@ -263,26 +261,6 @@ EAPI const Eina_List *eolian_class_inherits_list_get(const char *class_name);
*/
EAPI const Eina_List *eolian_class_functions_list_get(const char *class_name, Eolian_Function_Type func_type);
/*
* @brief Returns the Function Id for the default constructor.
*
* @param[in] class_name name of the class
* @return a Function Id
*
* @ingroup Eolian
*/
EAPI Eolian_Function eolian_class_default_constructor_get(const char *class_name);
/*
* @brief Returns the Function Id for the default destructor.
*
* @param[in] class_name name of the class
* @return a Function Id
*
* @ingroup Eolian
*/
EAPI Eolian_Function eolian_class_default_destructor_get(const char *class_name);
/*
* @brief Returns the type of a function
*

View File

@ -25,8 +25,6 @@ typedef struct
Eina_Stringshare *legacy_prefix;
Eina_Stringshare *eo_prefix;
Eina_Stringshare *data_type;
Eolian_Function dflt_ctor;
Eolian_Function dflt_dtor;
Eina_List *inherits; /* List Eina_Stringshare * */
Eina_List *properties; /* List prop_name -> _Function_Id */
Eina_List *methods; /* List meth_name -> _Function_Id */
@ -160,8 +158,6 @@ _class_del(Class_desc *class)
EINA_LIST_FREE(class->methods, fid) _fid_del(fid);
EINA_LIST_FREE(class->properties, fid) _fid_del(fid);
EINA_LIST_FREE(class->events, ev) database_event_free(ev);
_fid_del((_Function_Id *)class->dflt_ctor);
_fid_del((_Function_Id *)class->dflt_dtor);
eina_stringshare_del(class->name);
eina_stringshare_del(class->file);
@ -452,15 +448,9 @@ Eina_Bool database_class_function_add(const char *class_name, Eolian_Function fo
case EOLIAN_CTOR:
desc->constructors = eina_list_append(desc->constructors, foo_id);
break;
case EOLIAN_DFLT_CTOR:
desc->dflt_ctor = foo_id;
break;
case EOLIAN_DTOR:
desc->destructors = eina_list_append(desc->destructors, foo_id);
break;
case EOLIAN_DFLT_DTOR:
desc->dflt_dtor = foo_id;
break;
default:
ERR("Bad function type %d.", fid->type);
return EINA_FALSE;
@ -644,22 +634,6 @@ eolian_class_functions_list_get(const char *class_name, Eolian_Function_Type foo
}
}
EAPI Eolian_Function
eolian_class_default_constructor_get(const char *class_name)
{
Class_desc *desc = _class_get(class_name);
EINA_SAFETY_ON_NULL_RETURN_VAL(desc, NULL);
return desc->dflt_ctor;
}
EAPI Eolian_Function
eolian_class_default_destructor_get(const char *class_name)
{
Class_desc *desc = _class_get(class_name);
EINA_SAFETY_ON_NULL_RETURN_VAL(desc, NULL);
return desc->dflt_dtor;
}
EAPI Eolian_Function_Type
eolian_function_type_get(Eolian_Function function_id)
{
@ -1332,18 +1306,6 @@ static Eina_Bool _class_print(const Eina_Hash *hash EINA_UNUSED, const void *key
printf(" Data type: <%s>\n", desc->data_type);
}
// Default constructor
if (desc->dflt_ctor)
{
printf(" default constructor: present - description <%s>\n", eolian_function_description_get(desc->dflt_ctor, "comment"));
}
// Default destructor
if (desc->dflt_dtor)
{
printf(" default destructor: present - description <%s>\n", eolian_function_description_get(desc->dflt_dtor, "comment"));
}
// Constructors
printf(" constructors:\n");
EINA_LIST_FOREACH(desc->constructors, itr, function)