cpp-common/bt2: make setters return `*this`
Change setters (and other methods currently returning `void`) to return
`*this`.
This allows writing more compact code and avoid intermediate variables,
like:
return graph->addComponent(
*dummySinkCompCls, "the-sink",
bt2::MapValue::create()->insert("key1", "val1").insert("key2", "val2"));
It doesn't always produce super readable code, but it's nice to have the
option.
In sub-classes of `BorrowedObject`, the methods return by value.
`ConstMessageArray::append` returns by reference.
Change-Id: I5af80c96b4c947dc217f4dff4b0bcb31885005e8
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11951
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
13 files changed:
This page took 0.028736 seconds and 4 git commands to generate.