| 1 | /* |
| 2 | * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
| 3 | * |
| 4 | * SPDX-License-Identifier: LGPL-2.1-only |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef LTTNG_NOTIFICATION_H |
| 9 | #define LTTNG_NOTIFICATION_H |
| 10 | |
| 11 | #ifdef __cplusplus |
| 12 | extern "C" { |
| 13 | #endif |
| 14 | |
| 15 | struct lttng_condition; |
| 16 | struct lttng_evaluation; |
| 17 | struct lttng_notification; |
| 18 | |
| 19 | /* |
| 20 | * Get a notification's condition. |
| 21 | * |
| 22 | * The notification retains the ownership of both the condition and evaluation |
| 23 | * objects. Hence, it is not valid to access those objects after the destruction |
| 24 | * of their associated notification. |
| 25 | * |
| 26 | * The caller should check the condition's type in order to use the appropriate |
| 27 | * specialized functions to access the condition's properties. |
| 28 | * |
| 29 | * Returns an lttng_condition object on success, NULL on error. |
| 30 | */ |
| 31 | extern const struct lttng_condition *lttng_notification_get_condition( |
| 32 | struct lttng_notification *notification); |
| 33 | |
| 34 | /* |
| 35 | * Get a notification's condition's evaluation. |
| 36 | * |
| 37 | * The notification retains the ownership of the evaluation object. Hence, it is |
| 38 | * not valid to access that object after the destruction of its associated |
| 39 | * notification. |
| 40 | * |
| 41 | * The caller should check the evaluation's type in order to use the appropriate |
| 42 | * specialized functions to access the evaluation's properties. |
| 43 | * |
| 44 | * Returns an lttng_evaluation object on success, NULL on error. |
| 45 | */ |
| 46 | extern const struct lttng_evaluation *lttng_notification_get_evaluation( |
| 47 | struct lttng_notification *notification); |
| 48 | |
| 49 | /* |
| 50 | * Get a notification's origin trigger. |
| 51 | * |
| 52 | * The notification retains the ownership of the trigger object. Hence, it is |
| 53 | * not valid to access that object after the destruction of its associated |
| 54 | * notification. |
| 55 | * |
| 56 | * Returns an lttng_trigger object on success, NULL on error. |
| 57 | */ |
| 58 | const struct lttng_trigger *lttng_notification_get_trigger( |
| 59 | struct lttng_notification *notification); |
| 60 | |
| 61 | /* |
| 62 | * Destroys (frees) a notification. The notification's condition and evaluation |
| 63 | * are destroyed as a side-effect. |
| 64 | */ |
| 65 | extern void lttng_notification_destroy(struct lttng_notification *notification); |
| 66 | |
| 67 | #ifdef __cplusplus |
| 68 | } |
| 69 | #endif |
| 70 | |
| 71 | #endif /* LTTNG_NOTIFICATION_H */ |