plugins/common/muxing: C++ify
Change the code to be more idiomatic C++. I tried to keep the overall
logic identical.
The pattern where we look for the presence of both objects to compare
(when we compare things that are optional) comes back often, so factor
this out in a `_compareOptional` function.
Similarly, comparing strings that can be null comes back often, factor
this out in a `_compareStrings` function.
The existing code isn't consistent about how to order things, when
comparing one empty/null and one non-empty/non-null object. Sometimes,
the empty object goes first, sometimes the non-empty object goes first.
By factoring out these two functions, the message ordering changes
slightly in some cases. I found two test cases that needed to be updated:
- flt.utils.muxer/succeed/diff-stream-class-no-name.expect
- flt.utils.muxer/succeed/diff-stream-no-name.expect
It happens often that we want to compare and order scalar value. Factor
this out in a `_compareLt` templated function. The starship operator
from C++20 could probably replace this, in a distant future.
Otherwise the rest should be pretty straightforward it's the same logic
as before.
Change-Id: If372de51ff5584d17705a0aed5597cea750597fa
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12565
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.025178 seconds and 4 git commands to generate.