src.ctf.fs: remove ctf_fs_component_create
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 26 Jul 2022 21:19:49 +0000 (17:19 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 23 Aug 2022 16:06:16 +0000 (12:06 -0400)
Remove this function, as it's now a simple wrapper around constructing a
ctf_fs_component.

Change-Id: Ifc6c751ff66f43c81c1a0abd6d7b27393b96f4ad
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8307
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/ctf/fs-src/fs.cpp
src/plugins/ctf/fs-src/fs.hpp
src/plugins/ctf/fs-src/query.cpp

index 9a1b08cabdae8e1457211eefa1a2895f1711fe37..52bf33435f070ce6486d171fc99bb80ccb4363e7 100644 (file)
@@ -274,11 +274,6 @@ end:
     }
 }
 
-ctf_fs_component::UP ctf_fs_component_create(const bt2_common::LogCfg& logCfg)
-{
-    return ctf_fs_component::UP {new ctf_fs_component {logCfg}};
-}
-
 void ctf_fs_finalize(bt_self_component_source *component)
 {
     ctf_fs_component::UP {(ctf_fs_component *) bt_self_component_get_data(
@@ -1795,10 +1790,7 @@ static ctf_fs_component::UP ctf_fs_create(const bt_value *params,
     const bt_value *trace_name_value;
     bt_self_component *self_comp = bt_self_component_source_as_self_component(self_comp_src);
 
-    ctf_fs_component::UP ctf_fs = ctf_fs_component_create(logCfg);
-    if (!ctf_fs) {
-        return nullptr;
-    }
+    ctf_fs_component::UP ctf_fs = bt2_common::makeUnique<ctf_fs_component>(logCfg);
 
     if (!read_src_fs_parameters(params, &inputs_value, &trace_name_value, ctf_fs.get())) {
         return nullptr;
index dd5a91cd181353b7370337c4f6ed3f8a756645db..e4c3119a9be5e15efce6770493733fc7c3955bd2 100644 (file)
@@ -153,11 +153,6 @@ BT_HIDDEN
 bt_message_iterator_class_seek_beginning_method_status
 ctf_fs_iterator_seek_beginning(bt_self_message_iterator *message_iterator);
 
-/* Create and initialize a new, empty ctf_fs_component. */
-
-BT_HIDDEN
-ctf_fs_component::UP ctf_fs_component_create(const bt2_common::LogCfg& logCfg);
-
 /*
  * Create one `struct ctf_fs_trace` from one trace, or multiple traces sharing
  * the same UUID.
index 28ece6b323f67a03ffbe21d2da83878e87e1ab2b..e8e84b2e05f31a6fabb43282f89fbe446da8bfc2 100644 (file)
@@ -28,6 +28,7 @@
 #include "cpp-common/cfg-logging-error-reporting-throw.hpp"
 #include "cpp-common/libc-up.hpp"
 #include "cpp-common/exc.hpp"
+#include "cpp-common/make-unique.hpp"
 
 #define METADATA_TEXT_SIG "/* CTF 1.8"
 
@@ -168,10 +169,7 @@ static void populate_trace_info(const struct ctf_fs_trace *trace, bt2::MapValue
 BT_HIDDEN
 bt2::Value::Shared trace_infos_query(bt2::ConstMapValue params, const bt2_common::LogCfg& logCfg)
 {
-    ctf_fs_component::UP ctf_fs = ctf_fs_component_create(logCfg);
-    if (!ctf_fs) {
-        BT_CLOGE_APPEND_CAUSE_AND_THROW(bt2_common::Error, "Cannot create ctf_fs_component");
-    }
+    ctf_fs_component::UP ctf_fs = bt2_common::makeUnique<ctf_fs_component>(logCfg);
 
     const bt_value *inputs_value = NULL;
     const bt_value *trace_name_value;
This page took 0.025527 seconds and 5 git commands to generate.