cpp-common/bt2: add C++ bindings around `bt_error *`
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 12 Mar 2024 22:17:42 +0000 (18:17 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 26 Mar 2024 18:56:36 +0000 (14:56 -0400)
commita65c7bf4e060c4d48b86145a95ab4ae964c2dc47
tree73cc278092858ae28ecd7f825a6306b9bb3ccdb7
parent5996c10ea5bf46238011fd34500141a0029047b8
cpp-common/bt2: add C++ bindings around `bt_error *`

Add C++ bindings to access the error on the current thread.

 - Take the current thread error with takeCurrentThreadError(),
   returning a `UniqueConstError`.
 - Move the current thread error back with moveErrorToCurrentThread().
 - Access the error cause by iterating or subscripting
   `UniqueConstError`, which yields objects of type `ConstErrorCause` (a
   borrowed object type).
 - Access the common error cause information using methods of
   `ConstErrorCause`, including the error cause actor type.
 - Obtain a more specific error cause object with
   `ConstErrorCause::as*()`.

Change-Id: Ie18e22ef8901bc9c8d7c85432d515ca763b484c2
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12006
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/Makefile.am
src/cpp-common/bt2/component-class.hpp
src/cpp-common/bt2/error.hpp [new file with mode: 0644]
src/cpp-common/bt2/wrap.hpp
This page took 0.028407 seconds and 4 git commands to generate.