cpp-common/bt2: add and use `bt2::internal::Dep*` type alias templates
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 3 Nov 2023 18:48:52 +0000 (14:48 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 14 Dec 2023 15:57:04 +0000 (10:57 -0500)
commit8047a1755063eb23e5a07b3b96441e50c366ea87
tree213f3ec9f4115f8029ffd785e38fd583f2406586
parent5c895f64223b174af848b766d3b76058fb0f542e
cpp-common/bt2: add and use `bt2::internal::Dep*` type alias templates

Those new templates take care of using `std::conditional` instead of
having to use it at each site. The template parameters of
`bt2::internal::DepType` are:

1. What to check for constness.
2. The effective type if `LibObjT` is NOT `const`.
3. The effective type if `LibObjT` is `const`.

Other `bt2::internal::Dep*` reuse `DepType` with specific types for
parameters 2 and 3 for common uses.

For example:

    using UserAttributes =
        typename std::conditional<std::is_const<LibObjT>::value,
                                  ConstMapValue,
                                  MapValue>::type;

gets replaced by:

    using UserAttributes = internal::DepUserAttrs<LibObjT>;

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I434b9ae82d170c6fe8359488e78c0e3e34a064cd
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11234
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/cpp-common/bt2/clock-class.hpp
src/cpp-common/bt2/field-class.hpp
src/cpp-common/bt2/field.hpp
src/cpp-common/bt2/internal/utils.hpp
src/cpp-common/bt2/message.hpp
src/cpp-common/bt2/trace-ir.hpp
This page took 0.02459 seconds and 4 git commands to generate.