Build fix: missing initializer for member 'payload'
[lttng-tools.git] / src / common / notification.cpp
index 989c20ade5e1f126ffcf2609e7f0eea21e2f4028..51e5693cd464fb2bb4ebd96c0c60862da6b5ca3d 100644 (file)
@@ -5,14 +5,14 @@
  *
  */
 
-#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,
@@ -24,7 +24,7 @@ struct lttng_notification *lttng_notification_create(
                goto end;
        }
 
-       notification = (lttng_notification *) zmalloc(sizeof(struct lttng_notification));
+       notification = zmalloc<lttng_notification>();
        if (!notification) {
                goto end;
        }
@@ -40,9 +40,11 @@ int lttng_notification_serialize(const struct lttng_notification *notification,
 {
        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, &notification_comm,
                        sizeof(notification_comm));
@@ -175,6 +177,24 @@ const struct lttng_evaluation *lttng_notification_get_evaluation(
        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)
 {
This page took 0.027277 seconds and 4 git commands to generate.