src.ctf.fs: make ctf_fs_ds_index_create return a unique_ptr
[babeltrace.git] / src / plugins / ctf / fs-src / data-stream-file.hpp
index 139281794ab20fa7ce537e55f99cd1c9475e1cc8..a87877caf319e1d08bf7007cdf6730e310c5c181 100644 (file)
@@ -106,8 +106,15 @@ struct ctf_fs_ds_index_entry
     uint64_t packet_seq_num = 0;
 };
 
+struct ctf_fs_ds_index_deleter
+{
+    void operator()(struct ctf_fs_ds_index *index) noexcept;
+};
+
 struct ctf_fs_ds_index
 {
+    using UP = std::unique_ptr<ctf_fs_ds_index, ctf_fs_ds_index_deleter>;
+
     /* Array of pointer to struct ctf_fs_ds_index_entry. */
     GPtrArray *entries = nullptr;
 };
@@ -153,11 +160,11 @@ struct ctf_fs_ds_file *ctf_fs_ds_file_create(struct ctf_fs_trace *ctf_fs_trace,
 
 void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *stream);
 
-struct ctf_fs_ds_index *ctf_fs_ds_file_build_index(struct ctf_fs_ds_file *ds_file,
-                                                   struct ctf_fs_ds_file_info *ds_file_info,
-                                                   struct ctf_msg_iter *msg_iter);
+ctf_fs_ds_index::UP ctf_fs_ds_file_build_index(struct ctf_fs_ds_file *ds_file,
+                                               struct ctf_fs_ds_file_info *ds_file_info,
+                                               struct ctf_msg_iter *msg_iter);
 
-struct ctf_fs_ds_index *ctf_fs_ds_index_create(const bt2c::Logger& logger);
+ctf_fs_ds_index::UP ctf_fs_ds_index_create(const bt2c::Logger& logger);
 
 void ctf_fs_ds_index_destroy(struct ctf_fs_ds_index *index);
 
This page took 0.037352 seconds and 4 git commands to generate.