Generic class. Provides functionality for standard operations sets.
#include <QtxEvalExpr.h>

Public Member Functions | |
| QtxEvalSetBase () | |
| Constructor. More... | |
| virtual | ~QtxEvalSetBase () |
| Destructor. More... | |
| virtual void | operationList (QStringList &) const |
| Get the list of possible operations. More... | |
| virtual void | bracketsList (QStringList &, bool open) const |
| Get list of brackets. More... | |
| virtual QtxEvalExpr::Error | isValid (const QString &, const QVariant::Type, const QVariant::Type) const |
| Check operation validity. More... | |
Public Member Functions inherited from QtxEvalSet | |
| QtxEvalSet () | |
| Constructor. More... | |
| virtual | ~QtxEvalSet () |
| Destructor. More... | |
| virtual QString | name () const =0 |
| Get unique operations set name. More... | |
| virtual bool | createValue (const QString &, QVariant &) const |
| Create value from its string representation. More... | |
| virtual int | priority (const QString &, bool isBin) const =0 |
| Get the operation priority. More... | |
| virtual QtxEvalExpr::Error | calculate (const QString &, QVariant &, QVariant &) const =0 |
| Calculate the operation. More... | |
Protected Types | |
| typedef QList< QVariant::Type > | ListOfTypes |
Protected Member Functions | |
| void | addTypes (const ListOfTypes &) |
| Add operand types. More... | |
| void | addOperations (const QStringList &) |
| Add operation names to the internal list of operations. More... | |
Private Attributes | |
| QStringList | myOpers |
| ListOfTypes | myTypes |
|
protected |
| QtxEvalSetBase::QtxEvalSetBase | ( | ) |
|
virtual |
|
protected |
| list | operations to be added |
References myOpers.
|
protected |
| list | operand types to be added |
References myTypes.
|
virtual |
| list | returning list of brackets |
| open | if true, collect opening brackets, or closing brackets otherwise |
Implements QtxEvalSet.
Reimplemented in QtxEvalSetSets.
|
virtual |
If the operation is valid, QtxEvalExpr::OK is returned. If types of operands are invalid, the function returns QtxEvalExpr::OperandsNotMatch or QtxEvalExpr::InvalidOperation.
| op | operation |
| t1 | first operand type |
| t2 | second operand type |
Implements QtxEvalSet.
Reimplemented in QtxEvalSetSets.
References QtxEvalExpr::InvalidOperation, myTypes, QtxEvalExpr::OK, QtxEvalExpr::OperandsNotMatch, and QtxEvalSet::priority().
|
virtual |
| list | returning list of operations supported by the class |
Implements QtxEvalSet.
References myOpers.
|
private |
|
private |