tclap 1.6.0
Public Member Functions | List of all members
TCLAP::RangeConstraint< T > Class Template Reference

A Constraint that requires a value to fall within a closed [min, max] range, for the common "between X and Y" case that otherwise requires writing a full Constraint<T> subclass by hand. More...

#include <RangeConstraint.h>

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

Public Member Functions

 RangeConstraint (T min, T max)
 Constructor.
 
std::string description () const override
 Returns a description of the Constraint.
 
std::string shortID () const override
 Returns the short ID for the Constraint.
 
bool check (const T &value) const override
 The method used to verify that the value parsed from the command line meets the constraint.
 
- Public Member Functions inherited from TCLAP::Constraint< T >
virtual ~Constraint ()=default
 Destructor.
 

Additional Inherited Members

- Static Public Member Functions inherited from TCLAP::Constraint< T >
static std::string shortID (const Constraint< T > *constraint)
 

Detailed Description

template<typename T>
requires std::totally_ordered<T> && requires(std::ostream &out, const T &value) { out << value; }
class TCLAP::RangeConstraint< T >

A Constraint that requires a value to fall within a closed [min, max] range, for the common "between X and Y" case that otherwise requires writing a full Constraint<T> subclass by hand.

Definition at line 44 of file RangeConstraint.h.

Constructor & Destructor Documentation

◆ RangeConstraint()

template<typename T >
TCLAP::RangeConstraint< T >::RangeConstraint ( T  min,
T  max 
)
inline

Constructor.

Parameters
min- The smallest value that satisfies the constraint.
max- The largest value that satisfies the constraint.

Definition at line 51 of file RangeConstraint.h.

Member Function Documentation

◆ check()

template<typename T >
bool TCLAP::RangeConstraint< T >::check ( const T &  value) const
inlineoverridevirtual

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 67 of file RangeConstraint.h.

◆ description()

template<typename T >
std::string TCLAP::RangeConstraint< T >::description ( ) const
inlineoverridevirtual

Returns a description of the Constraint.

Implements TCLAP::Constraint< T >.

Definition at line 58 of file RangeConstraint.h.

◆ shortID()

template<typename T >
std::string TCLAP::RangeConstraint< T >::shortID ( ) const
inlineoverridevirtual

Returns the short ID for the Constraint.

Implements TCLAP::Constraint< T >.

Definition at line 65 of file RangeConstraint.h.


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