cpp-common/bt2: add component class creation methods
[babeltrace.git] / src / cpp-common / bt2 / component-class.hpp
index 51f7f470b736245c373b34d5e8e5e49f43a94481..efee3f43cfec81c5544089a4c3a010d70ed79047 100644 (file)
@@ -12,6 +12,7 @@
 #include "cpp-common/bt2c/c-string-view.hpp"
 
 #include "borrowed-object.hpp"
+#include "component-class-dev.hpp"
 #include "shared-object.hpp"
 
 namespace bt2 {
@@ -175,6 +176,13 @@ public:
         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();
@@ -279,6 +287,13 @@ public:
         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();
@@ -383,6 +398,13 @@ public:
         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();
This page took 0.024569 seconds and 4 git commands to generate.