notification: add trigger accessor to lttng_notification
[lttng-tools.git] / include / lttng / notification / notification.h
CommitLineData
a58c490f 1/*
ab5be9fa 2 * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
a58c490f 3 *
ab5be9fa 4 * SPDX-License-Identifier: LGPL-2.1-only
a58c490f 5 *
a58c490f
JG
6 */
7
8#ifndef LTTNG_NOTIFICATION_H
9#define LTTNG_NOTIFICATION_H
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15struct lttng_condition;
16struct lttng_evaluation;
17struct lttng_notification;
18
19/*
e83f3215
JG
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.
a58c490f
JG
30 */
31extern const struct lttng_condition *lttng_notification_get_condition(
32 struct lttng_notification *notification);
33
e83f3215
JG
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 */
a58c490f
JG
46extern const struct lttng_evaluation *lttng_notification_get_evaluation(
47 struct lttng_notification *notification);
48
6bec8cb2
JG
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 */
58const struct lttng_trigger *lttng_notification_get_trigger(
59 struct lttng_notification *notification);
60
e83f3215
JG
61/*
62 * Destroys (frees) a notification. The notification's condition and evaluation
63 * are destroyed as a side-effect.
64 */
a58c490f
JG
65extern void lttng_notification_destroy(struct lttng_notification *notification);
66
67#ifdef __cplusplus
68}
69#endif
70
71#endif /* LTTNG_NOTIFICATION_H */
This page took 0.031617 seconds and 4 git commands to generate.