From 2c8e2496bc742c1cb3a936d8f2ef186085b695ae Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 31 May 2024 16:08:00 -0400 Subject: [PATCH] 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 --- src/cpp-common/bt2/component-class.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 { -- 2.34.1