cpp-common/bt2/shared-object.hpp \
cpp-common/bt2/raw-value-proxy.hpp \
cpp-common/bt2/private-query-executor.hpp \
+ cpp-common/bt2/self-component-class.hpp \
cpp-common/bt2/self-component-port.hpp \
cpp-common/bt2/self-message-iterator-configuration.hpp \
cpp-common/bt2/self-message-iterator.hpp \
--- /dev/null
+/*
+ * Copyright (c) 2023 Philippe Proulx <pproulx@efficios.com>
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#ifndef BABELTRACE_CPP_COMMON_BT2_SELF_COMPONENT_CLASS_HPP
+#define BABELTRACE_CPP_COMMON_BT2_SELF_COMPONENT_CLASS_HPP
+
+#include <babeltrace2/babeltrace.h>
+
+#include "borrowed-object.hpp"
+
+namespace bt2 {
+
+class SelfComponentClass final : public BorrowedObject<bt_self_component_class>
+{
+public:
+ explicit SelfComponentClass(const _LibObjPtr libObjPtr) noexcept :
+ _ThisBorrowedObject {libObjPtr}
+ {
+ }
+
+ explicit SelfComponentClass(bt_self_component_class_source * const libObjPtr) noexcept :
+ _ThisBorrowedObject {bt_self_component_class_source_as_self_component_class(libObjPtr)}
+ {
+ }
+
+ explicit SelfComponentClass(bt_self_component_class_filter * const libObjPtr) noexcept :
+ _ThisBorrowedObject {bt_self_component_class_filter_as_self_component_class(libObjPtr)}
+ {
+ }
+
+ explicit SelfComponentClass(bt_self_component_class_sink * const libObjPtr) noexcept :
+ _ThisBorrowedObject {bt_self_component_class_sink_as_self_component_class(libObjPtr)}
+ {
+ }
+
+ const char *name() const noexcept
+ {
+ return bt_component_class_get_name(this->_libCompClsPtr());
+ }
+
+ const char *description() const noexcept
+ {
+ return bt_component_class_get_description(this->_libCompClsPtr());
+ }
+
+ const char *help() const noexcept
+ {
+ return bt_component_class_get_help(this->_libCompClsPtr());
+ }
+
+private:
+ const bt_component_class *_libCompClsPtr() const noexcept
+ {
+ return bt_self_component_class_as_component_class(this->libObjPtr());
+ }
+};
+
+} /* namespace bt2 */
+
+#endif /* BABELTRACE_CPP_COMMON_BT2_SELF_COMPONENT_CLASS_HPP */