tclap  1.2.0
Public Member Functions | Protected Attributes
TCLAP::ValuesConstraint Class Reference

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

#include <ValuesConstraint.h>

Inheritance diagram for TCLAP::ValuesConstraint:
Inheritance graph
[legend]
Collaboration diagram for TCLAP::ValuesConstraint:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

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


Constructor & Destructor Documentation

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

Constructor.

Parameters:
allowed- vector of allowed values.

Definition at line 99 of file ValuesConstraint.h.

References _allowed, and _typeDesc.

virtual TCLAP::ValuesConstraint::~ValuesConstraint ( ) [inline, virtual]

Virtual destructor.

Definition at line 65 of file ValuesConstraint.h.


Member Function Documentation

bool TCLAP::ValuesConstraint::check ( const T &  value) const [virtual]

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

Parameters:
value- The value that will be checked.

Implements TCLAP::Constraint< T >.

Definition at line 124 of file ValuesConstraint.h.

std::string TCLAP::ValuesConstraint::description ( ) const [virtual]

Returns a description of the Constraint.

Implements TCLAP::Constraint< T >.

Definition at line 139 of file ValuesConstraint.h.

std::string TCLAP::ValuesConstraint::shortID ( ) const [virtual]

Returns the short ID for the Constraint.

Implements TCLAP::Constraint< T >.

Definition at line 133 of file ValuesConstraint.h.


Member Data Documentation

std::vector<T> TCLAP::ValuesConstraint::_allowed [protected]

The list of valid values.

Definition at line 89 of file ValuesConstraint.h.

Referenced by ValuesConstraint().

std::string TCLAP::ValuesConstraint::_typeDesc [protected]

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

Definition at line 94 of file ValuesConstraint.h.

Referenced by ValuesConstraint().


The documentation for this class was generated from the following file: