Go to the documentation of this file.
31 #ifndef TCLAP_VALUESCONSTRAINT_H
32 #define TCLAP_VALUESCONSTRAINT_H
44 #if defined(HAVE_SSTREAM)
46 #elif defined(HAVE_STRSTREAM)
49 #error "Need a stringstream (sstream or strstream) to compile!"
83 virtual std::string
shortID()
const;
90 virtual bool check(
const T& value)
const;
110 for (
unsigned int i = 0; i <
_allowed.size(); i++ )
113 #if defined(HAVE_SSTREAM)
114 std::ostringstream os;
115 #elif defined(HAVE_STRSTREAM)
118 #error "Need a stringstream (sstream or strstream) to compile!"
123 std::string temp( os.str() );
134 if ( std::find(_allowed.begin(),_allowed.end(),val) == _allowed.end() )
virtual std::string description() const
Returns a description of the Constraint.
The interface that defines the interaction between the Arg and Constraint.
A Constraint that constrains the Arg to only those values specified in the constraint.
virtual std::string shortID() const
Returns the short ID for the Constraint.
std::string _typeDesc
The string used to describe the allowed values of this constraint.
std::vector< T > _allowed
The list of valid values.
ValuesConstraint(std::vector< T > &allowed)
Constructor.
virtual bool check(const T &value) const
The method used to verify that the value parsed from the command line meets the constraint.
virtual ~ValuesConstraint()
Virtual destructor.
Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020 | | |