#include "cpp-common/bt2c/c-string-view.hpp"
#include "borrowed-object.hpp"
+#include "component-class-dev.hpp"
#include "shared-object.hpp"
namespace bt2 {
using typename _ThisBorrowedObject::LibObjPtr;
using Shared = SharedObject<CommonComponentClass, LibObjT, internal::ComponentClassRefFuncs>;
+ enum class Type
+ {
+ SOURCE = BT_COMPONENT_CLASS_TYPE_SOURCE,
+ FILTER = BT_COMPONENT_CLASS_TYPE_FILTER,
+ SINK = BT_COMPONENT_CLASS_TYPE_SINK,
+ };
+
explicit CommonComponentClass(const LibObjPtr libObjPtr) noexcept :
_ThisBorrowedObject {libObjPtr}
{
return *this;
}
+ template <typename UserComponentT>
+ static CommonSourceComponentClass<LibObjT>::Shared create()
+ {
+ return CommonSourceComponentClass::Shared::createWithoutRef(
+ internal::createSourceCompCls<UserComponentT>());
+ }
+
bt2c::CStringView name() const noexcept
{
return this->_constComponentClass().name();
return *this;
}
+ template <typename UserComponentT>
+ static CommonFilterComponentClass<LibObjT>::Shared create()
+ {
+ return CommonFilterComponentClass::Shared::createWithoutRef(
+ internal::createFilterCompCls<UserComponentT>());
+ }
+
bt2c::CStringView name() const noexcept
{
return this->_constComponentClass().name();
return *this;
}
+ template <typename UserComponentT>
+ static CommonSinkComponentClass<LibObjT>::Shared create()
+ {
+ return CommonSinkComponentClass::Shared::createWithoutRef(
+ internal::createSinkCompCls<UserComponentT>());
+ }
+
bt2c::CStringView name() const noexcept
{
return this->_constComponentClass().name();