90 explicit operator bool()
const {
99 virtual unsigned int count()
const = 0;
134 virtual std::string
usage()
const = 0;
141 virtual std::unique_ptr<BaseArgument>
clone() const & = 0;
virtual void find_all_arguments(std::vector< const Argument * > &collector) const =0
Collect all Argument instances contained in this argument into the given vector.
virtual unsigned int count() const =0
Return the actual count of occurrences.
Base argument class, used both by actual Argument classes and constraints (ArgumentConstraint).
Definition: BaseArgument.hpp:40
BaseArgument & operator=(const BaseArgument &)=default
BaseArgument assignment operator.
bool required() const
Returns whether the argument is required.
Definition: BaseArgument.hpp:119
bool m_required
True if the argument has to be set.
Definition: BaseArgument.hpp:43
virtual void check_valid() const =0
Check if the argument constraints are satisfied.
virtual std::string usage() const =0
Returns a string representing how the argument may be used on the command line.
virtual std::unique_ptr< BaseArgument > clone() const &=0
Make a clone of the BaseArgument.
BaseArgument()
Base constructor.
Definition: BaseArgument.hpp:49
BaseArgument & set_required(bool required=true)
Mark the argument as required or not.
Definition: BaseArgument.hpp:110
virtual ~BaseArgument()
BaseArgument destructor.
Definition: BaseArgument.hpp:65