ctf: use unique_ptr to manage ctf_metadata_decoder lifetime
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 11 Dec 2023 17:21:12 +0000 (12:21 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 17 Apr 2024 17:57:53 +0000 (13:57 -0400)
commit1fa280c9d54077c5b810780c335ba6226207e82a
treee9c873904855535367e4ed4bd83b46a55fca0899
parent8d049eb244e5efaac1b19e67bd331fb4cf71f1e8
ctf: use unique_ptr to manage ctf_metadata_decoder lifetime

Introduce the ctf_metadata_decoder_up type, a unique_ptr with a deleter
that calls ctf_metadata_decoder_destroy.  Change
ctf_metadata_decoder_create to return a ctf_metadata_decoder_up, and
adjust callers / callees accordingly.

Note that this is temporary, ctf_metadata_decoder is going to be deleted
in a future refactor.  But in the mean time, it helps make the callers
use RAII and become more exception-safe.

Change-Id: Ia0e24b425c47b90dc71b10d1c7fd0a3000c89180
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8167
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12270
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/ctf/common/src/metadata/tsdl/decoder.cpp
src/plugins/ctf/common/src/metadata/tsdl/decoder.hpp
src/plugins/ctf/fs-src/fs.hpp
src/plugins/ctf/fs-src/metadata.cpp
src/plugins/ctf/fs-src/query.cpp
src/plugins/ctf/lttng-live/data-stream.cpp
src/plugins/ctf/lttng-live/lttng-live.hpp
src/plugins/ctf/lttng-live/metadata.cpp
This page took 0.024463 seconds and 4 git commands to generate.