A Constraint that constrains the Arg to only those values specified in the constraint. More...
#include <ValuesConstraint.h>
Public Member Functions | |
ValuesConstraint (std::vector< T > &allowed) | |
Constructor. | |
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. | |
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. |
A Constraint that constrains the Arg to only those values specified in the constraint.
Definition at line 51 of file ValuesConstraint.h.
TCLAP::ValuesConstraint< T >::ValuesConstraint | ( | std::vector< T > & | allowed | ) | [inline] |
Constructor.
allowed | - vector of allowed values. |
Definition at line 99 of file ValuesConstraint.h.
References TCLAP::ValuesConstraint< T >::_allowed, and TCLAP::ValuesConstraint< T >::_typeDesc.
virtual TCLAP::ValuesConstraint< T >::~ValuesConstraint | ( | ) | [inline, virtual] |
Virtual destructor.
Definition at line 65 of file ValuesConstraint.h.
bool TCLAP::ValuesConstraint< T >::check | ( | const T & | value | ) | const [inline, virtual] |
The method used to verify that the value parsed from the command line meets the constraint.
value | - The value that will be checked. |
Implements TCLAP::Constraint< T >.
Definition at line 125 of file ValuesConstraint.h.
References TCLAP::ValuesConstraint< T >::_allowed.
std::string TCLAP::ValuesConstraint< T >::description | ( | ) | const [inline, virtual] |
Returns a description of the Constraint.
Implements TCLAP::Constraint< T >.
Definition at line 140 of file ValuesConstraint.h.
References TCLAP::ValuesConstraint< T >::_typeDesc.
std::string TCLAP::ValuesConstraint< T >::shortID | ( | ) | const [inline, virtual] |
Returns the short ID for the Constraint.
Implements TCLAP::Constraint< T >.
Definition at line 134 of file ValuesConstraint.h.
References TCLAP::ValuesConstraint< T >::_typeDesc.
std::vector<T> TCLAP::ValuesConstraint< T >::_allowed [protected] |
The list of valid values.
Definition at line 89 of file ValuesConstraint.h.
Referenced by TCLAP::ValuesConstraint< T >::check(), and TCLAP::ValuesConstraint< T >::ValuesConstraint().
std::string TCLAP::ValuesConstraint< T >::_typeDesc [protected] |
The string used to describe the allowed values of this constraint.
Definition at line 94 of file ValuesConstraint.h.
Referenced by TCLAP::ValuesConstraint< T >::description(), TCLAP::ValuesConstraint< T >::shortID(), and TCLAP::ValuesConstraint< T >::ValuesConstraint().