}
}
-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(
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;
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.
#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"
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;