src.ctf.lttng-live: introduce live_viewer_connection::UP and use it
[babeltrace.git] / src / plugins / ctf / lttng-live / lttng-live.hpp
index e2b037cb1d4da9259703264b8d4dd8e42da97533..a4cc7cc58ad5cadf9e1b8788bb44885c50ffde25 100644 (file)
@@ -208,11 +208,15 @@ struct lttng_live_trace
 
 struct lttng_live_session
 {
+    using UP = std::unique_ptr<lttng_live_session>;
+
     explicit lttng_live_session(const bt2c::Logger& parentLogger) :
         logger {parentLogger, "PLUGIN/SRC.CTF.LTTNG-LIVE/SESSION"}
     {
     }
 
+    ~lttng_live_session();
+
     bt2c::Logger logger;
 
     bt_self_component *self_comp = nullptr;
@@ -220,11 +224,9 @@ struct lttng_live_session
     /* Weak reference. */
     struct lttng_live_msg_iter *lttng_live_msg_iter = nullptr;
 
-    /* Owned by this. */
-    GString *hostname = nullptr;
+    std::string hostname;
 
-    /* Owned by this. */
-    GString *session_name = nullptr;
+    std::string session_name;
 
     uint64_t id = 0;
 
@@ -292,11 +294,9 @@ struct lttng_live_msg_iter
     /* Weak reference. */
     bt_self_message_iterator *self_msg_iter = nullptr;
 
-    /* Owned by this. */
-    struct live_viewer_connection *viewer_connection = nullptr;
+    live_viewer_connection::UP viewer_connection;
 
-    /* Array of pointers to struct lttng_live_session. */
-    GPtrArray *sessions = nullptr;
+    std::vector<lttng_live_session::UP> sessions;
 
     /* Number of live stream iterator this message iterator has.*/
     uint64_t active_stream_iter = 0;
This page took 0.023751 seconds and 4 git commands to generate.