#include <babeltrace2/babeltrace.h>
+#include "cpp-common/bt2c/data-len.hpp"
+#include "cpp-common/bt2c/glib-up.hpp"
#include "cpp-common/bt2c/logging.hpp"
#include "metadata.hpp"
+#include "plugins/ctf/common/src/metadata/tsdl/decoder.hpp"
extern bool ctf_fs_debug;
struct ctf_fs_metadata
{
/* Owned by this */
- struct ctf_metadata_decoder *decoder = nullptr;
+ ctf_metadata_decoder_up decoder;
/* Owned by this */
bt_trace_class *trace_class = nullptr;
int bo = 0;
};
+struct ctf_fs_component_deleter
+{
+ void operator()(struct ctf_fs_component *);
+};
+
struct ctf_fs_component
{
+ using UP = std::unique_ptr<ctf_fs_component, ctf_fs_component_deleter>;
+
explicit ctf_fs_component(const bt2c::Logger& parentLogger) :
logger {parentLogger, "PLUGIN/SRC.CTF.FS/COMP"}
{
/* Owned by this */
struct ctf_fs_trace *trace = nullptr;
- struct ctf_fs_metadata_config metadata_config;
+ ctf::src::ClkClsCfg clkClsCfg;
};
struct ctf_fs_trace
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)
+ {
+ }
+
/* Weak, belongs to ctf_fs_ds_file_info. */
const char *path = nullptr;
- /* Position, in bytes, of the packet from the beginning of the file. */
- uint64_t offset = 0;
+ /* Position of the packet from the beginning of the file. */
+ bt2c::DataLen offset;
- /* Size of the packet, in bytes. */
- uint64_t packet_size = 0;
+ /* Size of the packet. */
+ bt2c::DataLen packetSize;
/*
* Extracted from the packet context, relative to the respective fields'
/* Create and initialize a new, empty ctf_fs_component. */
-ctf_fs_component *ctf_fs_component_create(const bt2c::Logger& parentLogger);
+ctf_fs_component::UP ctf_fs_component_create(const bt2c::Logger& parentLogger);
/*
* Create one `struct ctf_fs_trace` from one trace, or multiple traces sharing
/*
* Generate the port name to be used for a given data stream file group.
- *
- * The result must be freed using g_free by the caller.
*/
-gchar *ctf_fs_make_port_name(struct ctf_fs_ds_file_group *ds_file_group);
+bt2c::GCharUP ctf_fs_make_port_name(struct ctf_fs_ds_file_group *ds_file_group);
#endif /* BABELTRACE_PLUGIN_CTF_FS_H */