Ilwis-Objects  1.0
GIS and Remote Sensing framework for data access and processing
 All Classes Functions Enumerations Pages
Public Member Functions | List of all members
Ilwis::OperationExpression Class Reference

#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
 

Detailed Description

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)

Constructor & Destructor Documentation

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

Parameters
exprtextual form of the expression
typeenum marking the type of the expression, function or command.

Member Function Documentation

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

Returns
true if there is a name
QString OperationExpression::name ( bool  toLower = true) const

name returns the name of the command or function

Parameters
toLowertoLower name will be in lowercase (or not)
Returns
the function/command id
int OperationExpression::parameterCount ( bool  in = true) const

parameterCount returns the number of input or outparameters

Parameters
ininput or output
Returns
count
Parameter OperationExpression::parm ( int  index,
bool  in = true 
) const

returns the parameter at a defined placed in either the input or the output

Parameters
indexrank order number of the parameters to be returned
ininput parameter or output parameter
Returns
a 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

Parameters
keyname of the parameters to be returned
toLowername will be in lowercase (or not)
ininput parameter or output parameter
Returns
a parameter

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