tclap: TCLAP::ValuesConstraint< T > Class Template Reference

tclap 1.2.5

Public Member Functions | Protected Attributes | List of all members
TCLAP::ValuesConstraint< T > Class Template Reference

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

`#include <ValuesConstraint.h>`

Inheritance diagram for TCLAP::ValuesConstraint< T >:
[legend]
Collaboration diagram for TCLAP::ValuesConstraint< T >:
[legend]

## Public Member Functions
| ValuesConstraint (std::vector< T >const &allowed)
| Constructor. More...
virtual | ~ValuesConstraint ()
| Virtual destructor. More...
virtual std::string | description () const
| Returns a description of the Constraint. More...
virtual std::string | shortID () const
| Returns the short ID for the Constraint. More...
virtual bool | check (const T &value) const
| The method used to verify that the value parsed from the command line meets the constraint. More...
Public Member Functions inherited from TCLAP::Constraint< T >
virtual | ~Constraint ()
| Destructor. More...

## Protected Attributes
std::vector< T > | _allowed
| The list of valid values. More...
std::string | _typeDesc
| The string used to describe the allowed values of this constraint. More...

## Additional Inherited Members
Static Public Member Functions inherited from TCLAP::Constraint< T >
static std::string | shortID (Constraint< T > *constraint)

## Detailed Description

### template<class T>
class TCLAP::ValuesConstraint< T >

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

Definition at line 45 of file ValuesConstraint.h.

## Constructor & Destructor Documentation

## ◆ ValuesConstraint()

template<class T >

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

Constructor.

Parameters

  allowed | - vector of allowed values.

Definition at line 93 of file ValuesConstraint.h.

References TCLAP::ValuesConstraint< T >::_allowed, and TCLAP::ValuesConstraint< T >::_typeDesc.

## ◆ ~ValuesConstraint()

template<class T >

virtual TCLAP::ValuesConstraint< T >::~ValuesConstraint | ( |  | ) |
| inlinevirtual

Virtual destructor.

Definition at line 59 of file ValuesConstraint.h.

## Member Function Documentation

## ◆ check()

template<class T >

bool TCLAP::ValuesConstraint< T >::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 111 of file ValuesConstraint.h.

## ◆ description()

template<class T >

std::string TCLAP::ValuesConstraint< T >::description
| virtual

Returns a description of the Constraint.

Implements TCLAP::Constraint< T >.

Definition at line 126 of file ValuesConstraint.h.

## ◆ shortID()

template<class T >

std::string TCLAP::ValuesConstraint< T >::shortID
| virtual

Returns the short ID for the Constraint.

Implements TCLAP::Constraint< T >.

Definition at line 120 of file ValuesConstraint.h.

## Member Data Documentation

## ◆ _allowed

template<class T >

std::vector<T> TCLAP::ValuesConstraint< T >::_allowed
| protected

The list of valid values.

Definition at line 83 of file ValuesConstraint.h.

Referenced by TCLAP::ValuesConstraint< T >::ValuesConstraint().

## ◆ _typeDesc

template<class T >

std::string TCLAP::ValuesConstraint< T >::_typeDesc
| protected

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

Definition at line 88 of file ValuesConstraint.h.

Referenced by TCLAP::ValuesConstraint< T >::ValuesConstraint().

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

- ValuesConstraint.h