Add bt2::Common{Field,FieldClass,Value,Message}<>::as<>()
[babeltrace.git] / src / cpp-common / bt2 / message.hpp
index cc0f20ead672c26937020fa4e17b091bf5869b32..bc83c4b2181cbe9645bf5e9d1d9ab41ea2bfea08 100644 (file)
@@ -157,6 +157,12 @@ public:
         return Shared::createWithRef(*this);
     }
 
+    template <typename MessageT>
+    MessageT as() const noexcept
+    {
+        return MessageT {this->libObjPtr()};
+    }
+
     CommonStreamBeginningMessage<LibObjT> asStreamBeginning() const noexcept;
     CommonStreamEndMessage<LibObjT> asStreamEnd() const noexcept;
     CommonEventMessage<LibObjT> asEvent() const noexcept;
This page took 0.025949 seconds and 4 git commands to generate.