2012-04-10 02:12:46 -07:00
|
|
|
#include "Eobj.h"
|
2012-04-05 08:31:15 -07:00
|
|
|
#include "simple.h"
|
|
|
|
#include "simple_protected.h"
|
|
|
|
|
|
|
|
#include "inherit.h"
|
|
|
|
|
2012-04-12 06:52:13 -07:00
|
|
|
#include "config.h"
|
|
|
|
|
2012-04-05 08:31:15 -07:00
|
|
|
EAPI Eobj_Op INHERIT_BASE_ID = 0;
|
|
|
|
|
2012-04-17 03:27:25 -07:00
|
|
|
static const Eobj_Class *_my_class = NULL;
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
static void
|
2012-04-19 04:30:17 -07:00
|
|
|
_prot_print(Eobj *obj, void *class_data EINA_UNUSED, va_list *list)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
|
|
|
Simple_Protected_Data *pd = eobj_data_get(obj, SIMPLE_CLASS);
|
|
|
|
(void) list;
|
|
|
|
printf("%s %d\n", __func__, pd->protected_x1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_class_constructor(Eobj_Class *klass)
|
|
|
|
{
|
|
|
|
const Eobj_Op_Func_Description func_desc[] = {
|
2012-04-16 05:36:34 -07:00
|
|
|
EOBJ_OP_FUNC(INHERIT_ID(INHERIT_SUB_ID_PROT_PRINT), _prot_print),
|
|
|
|
EOBJ_OP_FUNC_SENTINEL
|
2012-04-05 08:31:15 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
eobj_class_funcs_set(klass, func_desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
const Eobj_Class *
|
|
|
|
inherit_class_get(void)
|
|
|
|
{
|
|
|
|
if (_my_class) return _my_class;
|
|
|
|
|
|
|
|
static const Eobj_Op_Description op_desc[] = {
|
|
|
|
EOBJ_OP_DESCRIPTION(INHERIT_SUB_ID_PROT_PRINT, "", "Print protected var x1."),
|
|
|
|
EOBJ_OP_DESCRIPTION_SENTINEL
|
|
|
|
};
|
|
|
|
|
|
|
|
static const Eobj_Class_Description class_desc = {
|
|
|
|
"Inherit",
|
|
|
|
EOBJ_CLASS_TYPE_REGULAR,
|
|
|
|
EOBJ_CLASS_DESCRIPTION_OPS(&INHERIT_BASE_ID, op_desc, INHERIT_SUB_ID_LAST),
|
|
|
|
NULL,
|
|
|
|
0,
|
2012-04-11 00:05:10 -07:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-04-05 08:31:15 -07:00
|
|
|
_class_constructor,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
return _my_class = eobj_class_new(&class_desc, SIMPLE_CLASS, NULL);
|
|
|
|
}
|