Classes | Typedefs | Functions

ELAM Namespace Reference

Classes

class  BinaryOperator
 Wraps a particular binary operator. More...
class  BoolEngine
 A boolean and logic math enabled engine. More...
class  CharacterClassSettings
 This class holds the character classes used by an Engine. More...
class  Engine
 The calculation engine of . More...
class  Token
 Represents a single token in a parsed expression. More...
class  Expression
 Represents an expression in the context of its engine. More...
class  FloatEngine
 an engine that has floating point (double) numbers implemented More...
class  IntFloatEngine
 an engine with integer and float math pre-installed, see IntEngine and FloatEngine More...
class  IntEngine
 integer math enabled engine More...
class  StringEngine
 integer math enabled engine More...
class  UnaryOperator
 Wraps a particular unary operator. More...
class  Position
 A character position inside a text/string that is being evaluated. More...
class  Exception
 Objects of this class represent an exception in the evaluation of an ELAM expression. More...
class  AnyType
 this type is not actually used, its ID is used as a fallback to tell operators, functions and engines that any supported type can be used More...

Typedefs

typedef std::function
< QVariant(const QVariant &op1,
const QVariant &op2, Engine
&engine)> 
BinaryOperatorCall
 pointer to a function wrapping a binary operator
typedef QVariant(* BinaryOperatorCall_FP )(const QVariant &op1, const QVariant &op2, Engine &engine)
 Helper type to select the correct overload from several variants.
typedef std::function
< QVariant(const QList
< QVariant > &args, Engine
&engine)> 
Function
 pointer to a function wrapping a mathematical function
typedef QVariant(* Function_FP )(const QList< QVariant > &args, Engine &engine)
 Helper type to select the correct overload from several variants.
typedef std::function< QPair
< QString, QVariant >const
QString &expr, Engine &engine,
int start)> 
LiteralParser
 wraps the parser routine for a literal
typedef QPair< QString,
QVariant >(* 
LiteralParser_FP )(const QString &expr, Engine &engine, int start)
 Helper type to select the correct overload from several variants.
typedef std::function
< QVariant(const QVariant
&orig, const Engine &engine)> 
TypeCast
 Wraps a cast function to convert various types into another type.
typedef QVariant(* TypeCast_FP )(const QVariant &orig, const Engine &engine)
 Helper type to select the correct overload from several variants.
typedef std::function
< QVariant(const QVariant &op,
Engine &engine)> 
UnaryOperatorCall
 pointer to a function wrapping an unary operator
typedef QVariant(* UnaryOperatorCall_FP )(const QVariant &op, Engine &engine)
 Helper type to select the correct overload from several variants.

Functions

QString versionInfo ()
 returns version information about ELAM
QDebug & operator<< (QDebug, const Token &)
 makes tokens accessable to qDebug()
QDebug & operator<< (QDebug, const QList< Token > &)
 makes tokens accessable to qDebug()
QDebug & operator<< (QDebug, const Expression &)
 makes expressions accessable to qDebug()
QDebug & operator<< (QDebug, const Position &)
QDebug & operator<< (QDebug, const Exception &)
QDebug & operator<< (QDebug, const AnyType &)

Typedef Documentation

typedef std::function<QVariant(const QVariant&op1,const QVariant&op2,Engine&engine)> ELAM::BinaryOperatorCall

pointer to a function wrapping a binary operator

Parameters:
op1 the left operand
op2 the right operand
engine the engine calling the operator
Returns:
the result of the operation
typedef QVariant(* ELAM::BinaryOperatorCall_FP)(const QVariant &op1, const QVariant &op2, Engine &engine)

Helper type to select the correct overload from several variants.

If your compiler complains that it cannot resolve an overloaded pointer when calling BinaryOperator::setCallback then cast to this type to help the compiler:

myBinaryOp.setCallback(BinaryOperatorCall_FP(myFunction),type1,type2);
typedef std::function<QVariant(const QList<QVariant>&args,Engine&engine)> ELAM::Function

pointer to a function wrapping a mathematical function

Parameters:
args the list of arguments
Returns:
the result of the function or ELAM::Exception in case or errors

Functions must check their arguments for validity before they start calculating. On error a function should returns an ELAM::Exception.

Parameters:
args the list of arguments that was given to the function, the implementation must check for length and type of the arguments
engine the engine calling the function
typedef QVariant(* ELAM::Function_FP)(const QList< QVariant > &args, Engine &engine)

Helper type to select the correct overload from several variants.

If your compiler complains that it cannot resolve an overloaded pointer when calling Engine::setFunction then cast to this type to help the compiler:

myEngine.setFunction("hellofunc",Function_FP(myFunction));
typedef std::function<QPair<QString,QVariant>const QString&expr,Engine&engine,int start)> ELAM::LiteralParser

wraps the parser routine for a literal

Parameters:
expr the original expression string
engine the engine that is calling this parser
start the character (index of expr) at which the literal starts
Returns:
the parsed literal (first=string representation, second=value represented by it

The string representation of the literal must be verbatim from expr, so that the calling engine can determine where to continue parsing in expr.

If the parser does not find a valid literal according to its rules it must return an empty string.

typedef QPair<QString,QVariant>(* ELAM::LiteralParser_FP)(const QString &expr, Engine &engine, int start)

Helper type to select the correct overload from several variants.

If your compiler complains that it cannot resolve an overloaded pointer when calling Engine::setLiteralParser then cast to this type to help the compiler:

myEngine.setLiteralParser(Function_FP(myDecimal),"123456789");
typedef std::function<QVariant(const QVariant&orig,const Engine&engine)> ELAM::TypeCast

Wraps a cast function to convert various types into another type.

Parameters:
orig the original value of any type
engine the engine calling the cast
Returns:
the converted value that conforms to the expected type
typedef QVariant(* ELAM::TypeCast_FP)(const QVariant &orig, const Engine &engine)

Helper type to select the correct overload from several variants.

If your compiler complains that it cannot resolve an overloaded pointer when calling Engine::setAutoCast then cast to this type to help the compiler:

myEngine.setAutoCast(targetType,QList<int>()<<origintype,TypeCast_FP(myCast));
typedef std::function<QVariant(const QVariant&op,Engine&engine)> ELAM::UnaryOperatorCall

pointer to a function wrapping an unary operator

Parameters:
op the operand to be worked on
engine the engine calling the operator
Returns:
the result of the operation
typedef QVariant(* ELAM::UnaryOperatorCall_FP)(const QVariant &op, Engine &engine)

Helper type to select the correct overload from several variants.

If your compiler complains that it cannot resolve an overloaded pointer when calling UnaryOperator::setCallback then cast to this type to help the compiler:

myUnaryOp.setCallback(UnaryOperatorCall_FP(myFunction),type);

Function Documentation

QDebug& ELAM::operator<< ( QDebug  ,
const Token &   
)

makes tokens accessable to qDebug()

QDebug& ELAM::operator<< ( QDebug  ,
const AnyType &   
)
QDebug& ELAM::operator<< ( QDebug  ,
const Exception &   
)
QDebug& ELAM::operator<< ( QDebug  ,
const Position &   
)
QDebug& ELAM::operator<< ( QDebug  ,
const Expression &   
)

makes expressions accessable to qDebug()

QDebug& ELAM::operator<< ( QDebug  ,
const QList< Token > &   
)

makes tokens accessable to qDebug()

QString ELAM::versionInfo (  )  [inline]

returns version information about ELAM

 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Friends