Browse Source

add a macro to make a retcall on the parent class

1.0.2
Georg Hopp 12 years ago
parent
commit
e20a52c8ad
  1. 16
      include/tr/class.h

16
include/tr/class.h

@ -262,6 +262,22 @@
iface->method(object, ##__VA_ARGS__); \
} while(0)
/*
* Like retcall but this calls the implementation of the direct parent
* class of this object.
*
* \see TR_RETCALL
*/
#define TR_PARENTRETCALL(object,_iface,method,ret,...) \
do { \
struct i_##_iface * iface; \
TR_class_ptr pc_class = TR_GET_CLASS((object)); \
assert(TR_HAS_PARENT(pc_class)); \
_TR_CALL(pc_class->parent, _iface, method, ##__VA_ARGS__); \
ret = iface->method(object, ##__VA_ARGS__); \
} while(0)
/**
* Definition of the metadata structures and symbols used to
* manage classe.

Loading…
Cancel
Save