2 * Copyright (c) 2023 Philippe Proulx <pproulx@efficios.com>
4 * SPDX-License-Identifier: MIT
7 #ifndef BABELTRACE_CPP_COMMON_BT2_SELF_COMPONENT_CLASS_HPP
8 #define BABELTRACE_CPP_COMMON_BT2_SELF_COMPONENT_CLASS_HPP
10 #include <babeltrace2/babeltrace.h>
12 #include "borrowed-object.hpp"
16 class SelfComponentClass final : public BorrowedObject<bt_self_component_class>
19 explicit SelfComponentClass(const _LibObjPtr libObjPtr) noexcept :
20 _ThisBorrowedObject {libObjPtr}
24 explicit SelfComponentClass(bt_self_component_class_source * const libObjPtr) noexcept :
25 _ThisBorrowedObject {bt_self_component_class_source_as_self_component_class(libObjPtr)}
29 explicit SelfComponentClass(bt_self_component_class_filter * const libObjPtr) noexcept :
30 _ThisBorrowedObject {bt_self_component_class_filter_as_self_component_class(libObjPtr)}
34 explicit SelfComponentClass(bt_self_component_class_sink * const libObjPtr) noexcept :
35 _ThisBorrowedObject {bt_self_component_class_sink_as_self_component_class(libObjPtr)}
39 const char *name() const noexcept
41 return bt_component_class_get_name(this->_libCompClsPtr());
44 const char *description() const noexcept
46 return bt_component_class_get_description(this->_libCompClsPtr());
49 const char *help() const noexcept
51 return bt_component_class_get_help(this->_libCompClsPtr());
55 const bt_component_class *_libCompClsPtr() const noexcept
57 return bt_self_component_class_as_component_class(this->libObjPtr());
63 #endif /* BABELTRACE_CPP_COMMON_BT2_SELF_COMPONENT_CLASS_HPP */