*
*/
-#include <lttng/notification/notification-internal.h>
-#include <lttng/condition/condition-internal.h>
-#include <lttng/condition/evaluation-internal.h>
+#include <lttng/notification/notification-internal.hpp>
+#include <lttng/condition/condition-internal.hpp>
+#include <lttng/condition/evaluation-internal.hpp>
#include <lttng/condition/condition.h>
#include <lttng/condition/evaluation.h>
-#include <lttng/trigger/trigger-internal.h>
-#include <common/payload.h>
-#include <common/payload-view.h>
+#include <lttng/trigger/trigger-internal.hpp>
+#include <common/payload.hpp>
+#include <common/payload-view.hpp>
struct lttng_notification *lttng_notification_create(
struct lttng_trigger *trigger,
goto end;
}
- notification = (lttng_notification *) zmalloc(sizeof(struct lttng_notification));
+ notification = zmalloc<lttng_notification>();
if (!notification) {
goto end;
}
{
int ret;
size_t header_offset, size_before_payload;
- struct lttng_notification_comm notification_comm = { 0 };
+ struct lttng_notification_comm notification_comm;
struct lttng_notification_comm *header;
+ notification_comm.length = 0;
+
header_offset = payload->buffer.size;
ret = lttng_dynamic_buffer_append(&payload->buffer, ¬ification_comm,
sizeof(notification_comm));
return notification ? notification->evaluation : NULL;
}
+const struct lttng_condition *lttng_notification_get_const_condition(
+ const struct lttng_notification *notification)
+{
+ return notification ? lttng_trigger_get_const_condition(notification->trigger) : NULL;
+}
+
+const struct lttng_evaluation *lttng_notification_get_const_evaluation(
+ const struct lttng_notification *notification)
+{
+ return notification ? notification->evaluation : NULL;
+}
+
+const struct lttng_trigger *lttng_notification_get_const_trigger(
+ const struct lttng_notification *notification)
+{
+ return notification ? notification->trigger : NULL;
+}
+
const struct lttng_trigger *lttng_notification_get_trigger(
struct lttng_notification *notification)
{