tclap 1.4.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 (const T &min, const T &max)
 Constructor.
 
std::string description () const
 Returns a description of the Constraint.
 
std::string shortID () const
 Returns the short ID for the Constraint.
 
bool check (const T &value) const
 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 ()
 Destructor.
 

Additional Inherited Members

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

Detailed Description

template<class T>
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.

T must support <= and ostream insertion. Bounds are copied and owned. Short IDs are cached; descriptions are formatted on request. Reversed or unordered bounds accept no values; omitted optional defaults are unchecked.

Definition at line 42 of file RangeConstraint.h.

Constructor & Destructor Documentation

◆ RangeConstraint()

template<class T >
TCLAP::RangeConstraint< T >::RangeConstraint ( const T &  min,
const T &  max 
)
inline

Constructor.

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

Definition at line 49 of file RangeConstraint.h.

Member Function Documentation

◆ check()

template<class T >
bool TCLAP::RangeConstraint< T >::check ( const T &  value) const
inlinevirtual

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

◆ description()

template<class T >
std::string TCLAP::RangeConstraint< T >::description ( ) const
inlinevirtual

Returns a description of the Constraint.

Implements TCLAP::Constraint< T >.

Definition at line 56 of file RangeConstraint.h.

◆ shortID()

template<class T >
std::string TCLAP::RangeConstraint< T >::shortID ( ) const
inlinevirtual

Returns the short ID for the Constraint.

Implements TCLAP::Constraint< T >.

Definition at line 63 of file RangeConstraint.h.


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