doc/api/libbabeltrace2/DoxygenLayout.xml: use `topics` tab
[babeltrace.git] / src / plugins / ctf / fs-src / data-stream-file.hpp
index d99760bbd1fad426e1dec604f6bf5089158ff5dd..05a6db13538049d4ab194dd0695e03fa9a3f852e 100644 (file)
@@ -78,15 +78,15 @@ struct ctf_fs_ds_file
 
 struct ctf_fs_ds_index_entry
 {
-    explicit ctf_fs_ds_index_entry(const bt2c::DataLen offsetParam,
-                                   const bt2c::DataLen packetSizeParam) noexcept :
-        offset(offsetParam),
-        packetSize(packetSizeParam)
+    ctf_fs_ds_index_entry(const bt2c::CStringView pathParam, const bt2c::DataLen offsetParam,
+                          const bt2c::DataLen packetSizeParam) noexcept :
+        path {pathParam},
+        offset {offsetParam}, packetSize {packetSizeParam}
     {
     }
 
     /* Weak, belongs to ctf_fs_ds_file_info. */
-    const char *path = nullptr;
+    const char *path;
 
     /* Position of the packet from the beginning of the file. */
     bt2c::DataLen offset;
@@ -114,8 +114,6 @@ struct ctf_fs_ds_index_entry
 
 struct ctf_fs_ds_index
 {
-    using UP = std::unique_ptr<ctf_fs_ds_index>;
-
     std::vector<ctf_fs_ds_index_entry> entries;
 };
 
@@ -123,6 +121,22 @@ struct ctf_fs_ds_file_group
 {
     using UP = std::unique_ptr<ctf_fs_ds_file_group>;
 
+    explicit ctf_fs_ds_file_group(struct ctf_fs_trace * const trace,
+                                  ctf_stream_class * const scParam, const uint64_t streamInstanceId,
+                                  ctf_fs_ds_index indexParam) noexcept :
+
+        sc {scParam},
+        stream_id(streamInstanceId), ctf_fs_trace {trace}, index {std::move(indexParam)}
+
+    {
+    }
+
+    /*
+     * Insert ds_file_info in the list of ds_file_infos at the right
+     * place to keep it sorted.
+     */
+    void insert_ds_file_info_sorted(ctf_fs_ds_file_info::UP ds_file_info);
+
     /*
      * This is an _ordered_ array of data stream file infos which
      * belong to this group (a single stream instance).
@@ -143,23 +157,18 @@ 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);
+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);
-
 /*
  * Medium operations to iterate on a single ctf_fs_ds_file.
  *
This page took 0.031504 seconds and 4 git commands to generate.