X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Futils.hpp;h=262775d1d6bf0513e75f83c1ff0a939c68266b7d;hb=42a11b8f4c8d98b33fa1eadcdcda96253e651f0b;hp=990bad57517bf33031c059fe667be5075318e19d;hpb=b978006283473456b0e545d1c21de60d3e298dc5;p=lttng-tools.git diff --git a/src/bin/lttng/utils.hpp b/src/bin/lttng/utils.hpp index 990bad575..262775d1d 100644 --- a/src/bin/lttng/utils.hpp +++ b/src/bin/lttng/utils.hpp @@ -26,13 +26,19 @@ extern pid_t sessiond_pid; struct cmd_struct; struct session_spec { - enum type { + enum class type { NAME, GLOB_PATTERN, ALL, }; - type type; + explicit session_spec(type spec_type, const char *name_or_pattern = nullptr) noexcept : + type_(spec_type), value(name_or_pattern) + { + } + + /* Disambiguate type enum from the member for buggy g++ versions. */ + type type_; const char *value; };