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


Public Types | |
| typedef Function | Predicate |
Public Member Functions | |
| PredicateConstraint (const std::string &description, const std::string &shortId, const Function &function) | |
| Copies the callable and the two independently supplied strings. | |
| PredicateConstraint (const Function &function, const Text &text) | |
| Advanced form used by the rule factory to share validation/text state. | |
| virtual | ~PredicateConstraint () |
| bool | check (const T &value) const |
| The method used to verify that the value parsed from the command line meets the constraint. | |
| std::string | description () const |
| Returns a description of the Constraint. | |
| std::string | shortID () const |
| Returns the short ID for 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) |
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 the supplied callable; 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 pointers 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.
| typedef Function TCLAP::PredicateConstraint< T, Function, Text >::Predicate |
Definition at line 126 of file PredicateConstraint.h.
|
inline |
Copies the callable and the two independently supplied strings.
Definition at line 129 of file PredicateConstraint.h.
References TCLAP::internal::ValidateConstraintPredicate< Function >::check().

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

|
inlinevirtual |
Definition at line 142 of file PredicateConstraint.h.
|
inlinevirtual |
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 144 of file PredicateConstraint.h.
|
inlinevirtual |
Returns a description of the Constraint.
Implements TCLAP::Constraint< T >.
Definition at line 145 of file PredicateConstraint.h.
|
inlinevirtual |
Returns the short ID for the Constraint.
Implements TCLAP::Constraint< T >.
Definition at line 146 of file PredicateConstraint.h.