From: Simon Marchi Date: Fri, 31 May 2024 20:08:00 +0000 (-0400) Subject: cpp-common/bt2: add shared() methods on component classes X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=2c8e2496bc742c1cb3a936d8f2ef186085b695ae;p=babeltrace.git cpp-common/bt2: add shared() methods on component classes Change-Id: I5d2e264904bb54b65a41fb0dfe653fb7eb3e54b2 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/12838 Reviewed-by: Philippe Proulx Tested-by: jenkins --- diff --git a/src/cpp-common/bt2/component-class.hpp b/src/cpp-common/bt2/component-class.hpp index 2933d74f..bd761461 100644 --- a/src/cpp-common/bt2/component-class.hpp +++ b/src/cpp-common/bt2/component-class.hpp @@ -205,6 +205,11 @@ public: return this->_constComponentClass().help(); } + Shared shared() const noexcept + { + return Shared::createWithRef(*this); + } + private: ConstComponentClass _constComponentClass() const noexcept { @@ -316,6 +321,11 @@ public: return this->_constComponentClass().help(); } + Shared shared() const noexcept + { + return Shared::createWithRef(*this); + } + private: ConstComponentClass _constComponentClass() const noexcept { @@ -427,6 +437,11 @@ public: return this->_constComponentClass().help(); } + Shared shared() const noexcept + { + return Shared::createWithRef(*this); + } + private: ConstComponentClass _constComponentClass() const noexcept {