Commit e20a52c8adfac1a481b88d77088441a3f3dc9a04

Authored by Georg Hopp
1 parent b7d95b1a

add a macro to make a retcall on the parent class

Showing 1 changed file with 16 additions and 0 deletions
@@ -262,6 +262,22 @@ @@ -262,6 +262,22 @@
262 iface->method(object, ##__VA_ARGS__); \ 262 iface->method(object, ##__VA_ARGS__); \
263 } while(0) 263 } while(0)
264 264
  265 +/*
  266 + * Like retcall but this calls the implementation of the direct parent
  267 + * class of this object.
  268 + *
  269 + * \see TR_RETCALL
  270 + */
  271 +#define TR_PARENTRETCALL(object,_iface,method,ret,...) \
  272 + do { \
  273 + struct i_##_iface * iface; \
  274 + TR_class_ptr pc_class = TR_GET_CLASS((object)); \
  275 + assert(TR_HAS_PARENT(pc_class)); \
  276 + _TR_CALL(pc_class->parent, _iface, method, ##__VA_ARGS__); \
  277 + ret = iface->method(object, ##__VA_ARGS__); \
  278 + } while(0)
  279 +
  280 +
265 /** 281 /**
266 * Definition of the metadata structures and symbols used to 282 * Definition of the metadata structures and symbols used to
267 * manage classe. 283 * manage classe.
Please register or login to post a comment