Template Class ValuesConstraint

Inheritance Relationships

Base Type

Class Documentation

template<class T>
class ValuesConstraint : public ecl::Constraint<T>

A Constraint that constrains the Arg to only those values specified in the constraint.

Public Functions

ValuesConstraint(std::vector<T> &allowed)

Constructor.

Parameters:

allowed – - vector of allowed values.

inline virtual ~ValuesConstraint()

Virtual destructor.

virtual std::string description() const

Returns a description of the Constraint.

virtual std::string shortID() const

Returns the short ID for the Constraint.

virtual bool check(const T &value) const

The method used to verify that the value parsed from the command line meets the constraint.

Parameters:

value – - The value that will be checked.

Protected Attributes

std::vector<T> _allowed

The list of valid values.

std::string _typeDesc

The string used to describe the allowed values of this constraint.