|
tclap 1.6.0
|
Adapts an owned function or const function object to Constraint<T>. More...
#include <PredicateConstraint.h>


Public Types | |
| using | Predicate = Function |
Public Member Functions | |
| template<class F > requires std::constructible_from<Function, F &&> && std::constructible_from<Text, std::string, std::string> | |
| PredicateConstraint (std::string description, std::string shortId, F &&function) | |
| Owns the callable and separate presentation strings. | |
| template<class F > requires std::constructible_from<Function, F &&> | |
| PredicateConstraint (F &&function, Text text) | |
| Advanced form used by the rule factory to share validation/text state. | |
| PredicateConstraint (const PredicateConstraint &)=default | |
| PredicateConstraint (PredicateConstraint &&)=default | |
| PredicateConstraint & | operator= (const PredicateConstraint &)=default |
| PredicateConstraint & | operator= (PredicateConstraint &&)=default |
| ~PredicateConstraint () override=default | |
| bool | check (const T &value) const override |
| The method used to verify that the value parsed from the command line meets the constraint. | |
| std::string | description () const override |
| Returns a description of the Constraint. | |
| std::string | shortID () const override |
| Returns the short ID for 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) |
Adapts an owned function or const function object to Constraint<T>.
Function must accept const T& and return a value convertible to bool. The adapter copies lvalues and moves rvalues; explicitly borrowed state inside it must remain alive. Args borrow the constraint itself: declare it before the arguments using it and do not move it after binding its address. Null function/member pointers and empty std::function objects are rejected with std::invalid_argument. Exceptions from the callable or text policy propagate unchanged from these methods.
MakeConstraint() deduces Function. MakeRuleConstraint() also obtains description()/shortID() from the same stored callable. Ordinary callers supply separate description and short-ID strings and need no text policy.
Definition at line 124 of file PredicateConstraint.h.
| using TCLAP::PredicateConstraint< T, Function, Text >::Predicate = Function |
Definition at line 126 of file PredicateConstraint.h.
|
inline |
Owns the callable and separate presentation strings.
Definition at line 132 of file PredicateConstraint.h.
References TCLAP::internal::ValidateConstraintPredicate().

|
inline |
Advanced form used by the rule factory to share validation/text state.
Definition at line 143 of file PredicateConstraint.h.
References TCLAP::internal::ValidateConstraintPredicate().

|
default |
|
default |
|
overridedefault |
|
inlineoverridevirtual |
The method used to verify that the value parsed from the command line meets the constraint.
| value | - The value that will be checked. |
Implements TCLAP::Constraint< T >.
Definition at line 154 of file PredicateConstraint.h.
|
inlineoverridevirtual |
Returns a description of the Constraint.
Implements TCLAP::Constraint< T >.
Definition at line 157 of file PredicateConstraint.h.
|
default |
|
default |
|
inlineoverridevirtual |
Returns the short ID for the Constraint.
Implements TCLAP::Constraint< T >.
Definition at line 160 of file PredicateConstraint.h.