Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QtxEvalSetBase Class Reference

Generic class. Provides functionality for standard operations sets.

#include <QtxEvalExpr.h>

Inheritance diagram for QtxEvalSetBase:
Inheritance graph

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
 

Member Typedef Documentation

typedef QList<QVariant::Type> QtxEvalSetBase::ListOfTypes
protected

Constructor & Destructor Documentation

QtxEvalSetBase::QtxEvalSetBase ( )
QtxEvalSetBase::~QtxEvalSetBase ( )
virtual

Member Function Documentation

void QtxEvalSetBase::addOperations ( const QStringList &  list)
protected
Parameters
listoperations to be added

References myOpers.

void QtxEvalSetBase::addTypes ( const ListOfTypes list)
protected
Parameters
listoperand types to be added

References myTypes.

void QtxEvalSetBase::bracketsList ( QStringList &  list,
bool  open 
) const
virtual
Parameters
listreturning list of brackets
openif true, collect opening brackets, or closing brackets otherwise

Implements QtxEvalSet.

Reimplemented in QtxEvalSetSets.

QtxEvalExpr::Error QtxEvalSetBase::isValid ( const QString &  op,
const QVariant::Type  t1,
const QVariant::Type  t2 
) const
virtual

If the operation is valid, QtxEvalExpr::OK is returned. If types of operands are invalid, the function returns QtxEvalExpr::OperandsNotMatch or QtxEvalExpr::InvalidOperation.

Parameters
opoperation
t1first operand type
t2second operand type
Returns
error code (QtxEvalExpr::Error)

Implements QtxEvalSet.

Reimplemented in QtxEvalSetSets.

References QtxEvalExpr::InvalidOperation, myTypes, QtxEvalExpr::OK, QtxEvalExpr::OperandsNotMatch, and QtxEvalSet::priority().

void QtxEvalSetBase::operationList ( QStringList &  list) const
virtual
Parameters
listreturning list of operations supported by the class

Implements QtxEvalSet.

References myOpers.

Member Data Documentation

QStringList QtxEvalSetBase::myOpers
private
ListOfTypes QtxEvalSetBase::myTypes
private

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