#define _LGPL_SOURCE
#include <algorithm>
-#include <common/common.h>
-#include <common/defaults.h>
-#include <common/fs-handle.h>
-#include <common/sessiond-comm/relayd.h>
-#include <common/utils.h>
+#include <common/common.hpp>
+#include <common/defaults.hpp>
+#include <common/fs-handle.hpp>
+#include <common/sessiond-comm/relayd.hpp>
+#include <common/utils.hpp>
#include <sys/stat.h>
#include <urcu/rculist.h>
-#include "lttng-relayd.h"
-#include "index.h"
-#include "stream.h"
-#include "viewer-stream.h"
+#include "lttng-relayd.hpp"
+#include "index.hpp"
+#include "stream.hpp"
+#include "viewer-stream.hpp"
#include <sys/types.h>
#include <fcntl.h>
DBG("Relay stream %" PRIu64 " not found", stream_id);
goto end;
}
- stream = caa_container_of(node, struct relay_stream, node);
+ stream = lttng::utils::container_of(node, &relay_stream::node);
if (!stream_get(stream)) {
stream = NULL;
}
bool acquired_reference = false;
struct lttng_trace_chunk *current_trace_chunk;
- stream = (relay_stream *) zmalloc(sizeof(struct relay_stream));
+ stream = zmalloc<relay_stream>();
if (stream == NULL) {
PERROR("relay stream zmalloc");
goto error_no_alloc;
static void stream_destroy_rcu(struct rcu_head *rcu_head)
{
struct relay_stream *stream =
- caa_container_of(rcu_head, struct relay_stream, rcu_node);
+ lttng::utils::container_of(rcu_head, &relay_stream::rcu_node);
stream_destroy(stream);
}
static void stream_release(struct urcu_ref *ref)
{
struct relay_stream *stream =
- caa_container_of(ref, struct relay_stream, ref);
+ lttng::utils::container_of(ref, &relay_stream::ref);
struct relay_session *session;
session = stream->trace->session;