53 TR_classNewv(TR_class_ptr
class, va_list * params)
55 void *
object =
TR_calloc(1, class->object_size +
sizeof(
void*));
58 * (TR_class_ptr *)
object =
class;
59 object +=
sizeof(
void*);
61 TR_RETCALL(
object, TR_Class, ctor, ret, params);
64 TR_classDelete(&
object);
75 TR_classNew(TR_class_ptr
class, ...)
80 va_start(params,
class);
81 object = TR_classNewv(
class, ¶ms);
92 TR_classDelete(
void **
object)
94 if (NULL != *
object) {
97 TR_CALL(*
object, TR_Class, dtor);
99 mem = *
object -
sizeof(
void*);
110 TR_classClone(
void * _object)
112 TR_class_ptr
class = TR_GET_CLASS(_object);
113 void *
object =
TR_calloc(1, class->object_size +
sizeof(
void*));
115 * (TR_class_ptr *)
object =
class;
116 object +=
sizeof(
void*);
119 TR_CALL(
object, TR_Class, clone, _object);
132 TR_objectInit(
void *
object, ...)
137 va_start(params,
object);
138 TR_CALL(
object, TR_Class, dtor);
139 TR_RETCALL(
object, TR_Class, ctor, ret, ¶ms);
#define TR_CALL(object, _iface, method,...)
#define TR_RETCALL(object, _iface, method, ret,...)
void * TR_calloc(size_t, size_t)
TR_CREATE_INTERFACE(TR_Class, 3)