#include <Function.h>
Inheritance diagram for Argument:
Public Member Functions | |
Argument (string name_="", bool does_test=true, bool does_error=true) | |
Argument (const Argument *arg) | |
virtual | ~Argument () |
virtual void | set (const Argument *arg) |
virtual Argument * | copy () const |
virtual string | print () const |
string | printlong () const |
bool | test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const |
virtual MathStructure | parse (const string &str, const ParseOptions &po=default_parse_options) const |
virtual void | parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const |
string | name () const |
void | setName (string name_) |
void | setCustomCondition (string condition) |
string | getCustomCondition () const |
bool | tests () const |
void | setTests (bool does_error) |
bool | alerts () const |
void | setAlerts (bool does_error) |
bool | zeroForbidden () const |
void | setZeroForbidden (bool forbid_zero) |
bool | matrixAllowed () const |
void | setMatrixAllowed (bool allow_matrix) |
bool | rationalPolynomial () const |
void | setRationalPolynomial (bool rational_polynomial) |
virtual bool | suggestsQuotes () const |
virtual int | type () const |
Protected Member Functions | |
virtual bool | subtest (MathStructure &value, const EvaluationOptions &eo) const |
virtual string | subprintlong () const |
Protected Attributes | |
string | sname |
string | scondition |
bool | b_zero |
bool | b_test |
bool | b_matrix |
bool | b_text |
bool | b_error |
bool | b_rational |
Free arguments accepts any value.
|
Creates a new argument definition.
|
|
Creates a copy of an argument definition.
|
|
Destructor |
|
If an error message will be presented to the user if the value for the argument is not allowed.
|
|
Returns a copy of the argument definition.
Reimplemented in DataPropertyArgument, DataObjectArgument, NumberArgument, IntegerArgument, SymbolicArgument, TextArgument, DateArgument, VectorArgument, MatrixArgument, ExpressionItemArgument, FunctionArgument, BooleanArgument, and ArgumentSet. |
|
Returns the custom condition expression set for argument values.
|
|
Returns the name/title of the argument definition.
|
|
Parses an expression for an argument value. The default behavior is to use Calculator::parse() directly.
|
|
Parses an expression for an argument value. The default behavior is to use Calculator::parse() directly.
|
|
Resturns a short description of the argument definition. Ex. "number" for NumberArgument.
Reimplemented in DataPropertyArgument, DataObjectArgument, NumberArgument, IntegerArgument, SymbolicArgument, TextArgument, DateArgument, VectorArgument, MatrixArgument, ExpressionItemArgument, FunctionArgument, BooleanArgument, and ArgumentSet. |
|
Resturns a long description of the argument definition. Ex. "A real number > 2".
|
|
If only rational polynomials are allowed as argument value.
|
|
Sets the argument to a copy of an argument definition.
Reimplemented in NumberArgument, and IntegerArgument. |
|
Sets a custom condition for argument values. '' is replaced by the argument value in the expression.
|
|
Sets the name/title of the argument definition.
|
|
Sets if a value of zero is forbidden for the argument value.
|
|
This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".
Reimplemented in DataPropertyArgument, DataObjectArgument, NumberArgument, IntegerArgument, SymbolicArgument, TextArgument, DateArgument, VectorArgument, MatrixArgument, ExpressionItemArgument, FunctionArgument, BooleanArgument, and ArgumentSet. |
|
This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.
Reimplemented in DataPropertyArgument, DataObjectArgument, NumberArgument, IntegerArgument, SymbolicArgument, TextArgument, DateArgument, VectorArgument, MatrixArgument, ExpressionItemArgument, FunctionArgument, BooleanArgument, and ArgumentSet. |
|
Tests if a value fulfils the requirements of the argument definition. The value might change if it has not been fully evaluated.
|
|
If the value for the argument will be tested. If not, the argument only works as an suggestion and any value is allowed.
|
|
Returns the type of the argument, corresponding to which subclass the object belongs to.
Reimplemented in DataPropertyArgument, DataObjectArgument, NumberArgument, IntegerArgument, SymbolicArgument, TextArgument, DateArgument, VectorArgument, MatrixArgument, ExpressionItemArgument, FunctionArgument, BooleanArgument, and ArgumentSet. |
|
If an argument value of zero is forbidden.
|