Ilwis-Objects
1.0
GIS and Remote Sensing framework for data access and processing
|
#include <operationExpression.h>
Public Member Functions | |
OperationExpression () | |
OperationExpression (const QString &expr, const SymbolTable &symtab=SymbolTable()) | |
Parameter | parm (int index, bool in=true) const |
Parameter | parm (const QString key, bool toLower=true, bool in=true) const |
QString | name (bool toLower=true) const |
int | parameterCount (bool in=true) const |
bool | isValid () const |
QUrl | metaUrl (bool simple=true) const |
void | setExpression (const QString &e, const SymbolTable &symtab) |
bool | matchesParameterCount (const QString &match, bool in=true) const |
QString | toString () const |
The OperationExpression class a parser for fully defined expressions. This class will parse expressions of the type function and command and split it into its parts. The assumption is that the expression is already parsed to a level that all parts can not be parsed further. more complex expressions need first go to the calculator to be reduced to this level. Note that functions have a fixed order of parameters v = func(a,b) is different from b fun(b,a)
OperationExpression::OperationExpression | ( | ) |
OperationExpression empty expression
OperationExpression::OperationExpression | ( | const QString & | expr, |
const SymbolTable & | symtab = SymbolTable() |
||
) |
Constructs an expression object of an textual expression.
Expressions have either the form of a function which takes the form of output={id}(paramteres*) or a command with the form {id} (paramters)*. The class will splt this in *ids, input parametrs and return parameters
expr | textual form of the expression |
type | enum marking the type of the expression, function or command. |
bool OperationExpression::isValid | ( | ) | const |
isValid minimum condition for an expression to be valid, it must have a name
An expression might have no return types and no parameters but it always must have a name
QString OperationExpression::name | ( | bool | toLower = true | ) | const |
name returns the name of the command or function
toLower | toLower name will be in lowercase (or not) |
int OperationExpression::parameterCount | ( | bool | in = true | ) | const |
parameterCount returns the number of input or outparameters
in | input or output |
Parameter OperationExpression::parm | ( | int | index, |
bool | in = true |
||
) | const |
returns the parameter at a defined placed in either the input or the output
index | rank order number of the parameters to be returned |
in | input parameter or output parameter |
Parameter OperationExpression::parm | ( | const QString | key, |
bool | toLower = true , |
||
bool | in = true |
||
) | const |
returns the parameter at a defined name in either the input or the output
key | name of the parameters to be returned |
toLower | name will be in lowercase (or not) |
in | input parameter or output parameter |