src.ctf.fs: remove ctf_fs_ds_index::UP
[babeltrace.git] / src / plugins / ctf / fs-src / data-stream-file.hpp
index b9e37198074c1c81a2527bbe75da528e1ad62208..6abca11b438693dedadb6522ffc7b54250ca6222 100644 (file)
@@ -78,8 +78,6 @@ struct ctf_fs_ds_file
 
 struct ctf_fs_ds_index_entry
 {
-    using UP = std::unique_ptr<ctf_fs_ds_index_entry>;
-
     explicit ctf_fs_ds_index_entry(const bt2c::DataLen offsetParam,
                                    const bt2c::DataLen packetSizeParam) noexcept :
         offset(offsetParam),
@@ -111,14 +109,12 @@ struct ctf_fs_ds_index_entry
     /*
      * Packet sequence number, or UINT64_MAX if not present in the index.
      */
-    uint64_t packet_seq_num = 0;
+    uint64_t packet_seq_num = UINT64_MAX;
 };
 
 struct ctf_fs_ds_index
 {
-    using UP = std::unique_ptr<ctf_fs_ds_index>;
-
-    std::vector<ctf_fs_ds_index_entry::UP> entries;
+    std::vector<ctf_fs_ds_index_entry> entries;
 };
 
 struct ctf_fs_ds_file_group
@@ -145,24 +141,22 @@ struct ctf_fs_ds_file_group
     /* Weak, belongs to component */
     struct ctf_fs_trace *ctf_fs_trace = nullptr;
 
-    ctf_fs_ds_index::UP index;
+    ctf_fs_ds_index index;
 };
 
 ctf_fs_ds_file::UP ctf_fs_ds_file_create(ctf_fs_trace *ctf_fs_trace, bt2::Stream::Shared stream,
                                          const char *path, const bt2c::Logger& logger);
 
-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);
-
-ctf_fs_ds_index::UP ctf_fs_ds_index_create();
+bt2s::optional<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_file_info::UP ctf_fs_ds_file_info_create(const char *path, int64_t begin_ns);
 
 ctf_fs_ds_file_group::UP ctf_fs_ds_file_group_create(struct ctf_fs_trace *ctf_fs_trace,
                                                      struct ctf_stream_class *sc,
                                                      uint64_t stream_instance_id,
-                                                     ctf_fs_ds_index::UP index);
+                                                     ctf_fs_ds_index index);
 
 /*
  * Medium operations to iterate on a single ctf_fs_ds_file.
This page took 0.023935 seconds and 4 git commands to generate.