24 #ifndef ARM_COMPUTE_UTILS_SIMPLEOPTION 25 #define ARM_COMPUTE_UTILS_SIMPLEOPTION 63 std::string
help()
const override;
69 const T &
value()
const;
77 :
Option{ std::move(name),
false,
true }, _value{ std::move(default_value) }
86 std::stringstream stream{ std::move(value) };
88 _is_set = !stream.fail();
91 catch(
const std::invalid_argument &)
100 _value = std::move(value);
105 template <
typename T>
108 return "--" +
name() +
"=VALUE - " + _help;
111 template <
typename T>
Abstract base class for a command line option.
bool parse(std::string value) override
Parses the given string.
SimpleOption(std::string name, T default_value)
Construct the option with the given default value.
Copyright (c) 2017-2021 Arm Limited.
std::string help() const override
Help message for the option.
std::string name() const
Name of the option.
const T & value() const
Get the option value.
Option(std::string name)
Constructor.
Implementation of an option that accepts a single value.