| 310 */ |
310 */ |
| 311 #define cx_invoke_destructor(c, e) \ |
311 #define cx_invoke_destructor(c, e) \ |
| 312 if ((c)->collection.simple_destructor) cx_invoke_simple_destructor(c,e); \ |
312 if ((c)->collection.simple_destructor) cx_invoke_simple_destructor(c,e); \ |
| 313 if ((c)->collection.advanced_destructor) cx_invoke_advanced_destructor(c,e) |
313 if ((c)->collection.advanced_destructor) cx_invoke_advanced_destructor(c,e) |
| 314 |
314 |
| |
315 /** |
| |
316 * Invokes all available destructor functions for a specific element. |
| |
317 * |
| |
318 * Usually only used by collection implementations. There should be no need |
| |
319 * to invoke this macro manually. |
| |
320 * |
| |
321 * In contrast to cx_invoke_destructor(), this macro does not automatically |
| |
322 * dereference pointers to the elements when cxCollectionStoresPointers() |
| |
323 * returns true. |
| |
324 * |
| |
325 * @param c a pointer to a struct that contains #CX_COLLECTION_BASE |
| |
326 * @param e pointer to the element |
| |
327 */ |
| |
328 #define cx_invoke_destructor_raw(c, e) \ |
| |
329 if ((c)->collection.simple_destructor) (c)->collection.simple_destructor(e); \ |
| |
330 if ((c)->collection.advanced_destructor) (c)->collection.advanced_destructor((c)->collection.destructor_data, e) |
| |
331 |
| |
332 |
| 315 #endif // UCX_COLLECTION_H |
333 #endif // UCX_COLLECTION_H |