notification: add trigger accessor to lttng_notification
[lttng-tools.git] / include / lttng / notification / notification.h
... / ...
CommitLineData
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
12extern "C" {
13#endif
14
15struct lttng_condition;
16struct lttng_evaluation;
17struct 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 */
31extern 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 */
46extern 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 */
58const 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 */
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.03418 seconds and 4 git commands to generate.