* Copyright 2019 Philippe Proulx <pproulx@efficios.com>
*/
-#ifndef BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_H
-#define BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_H
+#ifndef BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_HPP
+#define BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_HPP
#include <glib.h>
-#include <stdbool.h>
#include <babeltrace2/babeltrace.h>
-#include "common/macros.h"
+#include "cpp-common/bt2c/logging.hpp"
struct fs_sink_comp
{
- bt_logging_level log_level;
- bt_self_component *self_comp;
+ explicit fs_sink_comp(const bt2::SelfSinkComponent selfSinkComp) :
+ logger {selfSinkComp, "PLUGIN/SINK.CTF.FS/COMP"}
+ {
+ }
+
+ bt2c::Logger logger;
/* Owned by this */
- bt_message_iterator *upstream_iter;
+ bt_message_iterator *upstream_iter = nullptr;
/* Base output directory path */
- GString *output_dir_path;
+ GString *output_dir_path = nullptr;
/*
* True if the component assumes that it will only write a
* streams). This makes the component write the stream files
* directly in the output directory (`output_dir_path` above).
*/
- bool assume_single_trace;
+ bool assume_single_trace = false;
/* True to completely ignore discarded events messages */
- bool ignore_discarded_events;
+ bool ignore_discarded_events = false;
/* True to completely ignore discarded packets messages */
- bool ignore_discarded_packets;
+ bool ignore_discarded_packets = false;
/*
* True to make the component quiet (nothing printed to the
* standard output).
*/
- bool quiet;
+ bool quiet = false;
/*
* Hash table of `const bt_trace *` (weak) to
* `struct fs_sink_trace *` (owned by hash table).
*/
- GHashTable *traces;
+ GHashTable *traces = nullptr;
};
bt_component_class_initialize_method_status
void ctf_fs_sink_finalize(bt_self_component_sink *component);
-#endif /* BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_H */
+#endif /* BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_HPP */