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

Provides set of operations with sequences for the parser.

#include <QtxEvalExpr.h>

Inheritance diagram for QtxEvalSetSets:
Inheritance graph

Public Types

typedef QList< QVariant > ValueSet
 

Public Member Functions

 QtxEvalSetSets ()
 Constructor. More...
 
virtual ~QtxEvalSetSets ()
 Destructor. More...
 
virtual void bracketsList (QStringList &, bool open) const
 Get list of brackets. More...
 
virtual int priority (const QString &, bool isBin) const
 Get the operation priority. More...
 
virtual QtxEvalExpr::Error isValid (const QString &, const QVariant::Type, const QVariant::Type) const
 Check operation validity. More...
 
virtual QtxEvalExpr::Error calculate (const QString &, QVariant &, QVariant &) const
 Calculate the operation. More...
 
virtual QString name () const
 Get operations set name. More...
 
- Public Member Functions inherited from QtxEvalSetBase
 QtxEvalSetBase ()
 Constructor. More...
 
virtual ~QtxEvalSetBase ()
 Destructor. More...
 
virtual void operationList (QStringList &) const
 Get the list of possible operations. More...
 
- Public Member Functions inherited from QtxEvalSet
 QtxEvalSet ()
 Constructor. More...
 
virtual ~QtxEvalSet ()
 Destructor. More...
 
virtual bool createValue (const QString &, QVariant &) const
 Create value from its string representation. More...
 

Static Public Member Functions

static void add (ValueSet &, const QVariant &)
 Add new value v to the sequence set. More...
 
static void add (ValueSet &, const ValueSet &)
 Add all values from sequence s2 to the sequence s1. More...
 
static void remove (ValueSet &, const QVariant &)
 Remove value v from sequence set. More...
 
static void remove (ValueSet &, const ValueSet &)
 Remove all values listed in the sequence s2 from the sequence s1. More...
 
static QString Name ()
 Get operations set name. More...
 

Additional Inherited Members

- Protected Types inherited from QtxEvalSetBase
typedef QList< QVariant::Type > ListOfTypes
 
- Protected Member Functions inherited from QtxEvalSetBase
void addTypes (const ListOfTypes &)
 Add operand types. More...
 
void addOperations (const QStringList &)
 Add operation names to the internal list of operations. More...
 

Member Typedef Documentation

typedef QList<QVariant> QtxEvalSetSets::ValueSet

Constructor & Destructor Documentation

QtxEvalSetSets::QtxEvalSetSets ( )
QtxEvalSetSets::~QtxEvalSetSets ( )
virtual

Member Function Documentation

void QtxEvalSetSets::add ( ValueSet set,
const QVariant &  v 
)
static
Parameters
setsequence
vvalue to be added
void QtxEvalSetSets::add ( ValueSet s1,
const ValueSet s2 
)
static
Parameters
s1destination sequence
s2source sequence

References add().

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

Reimplemented from QtxEvalSetBase.

References QtxEvalSetBase::bracketsList().

QtxEvalExpr::Error QtxEvalSetSets::calculate ( const QString &  op,
QVariant &  v1,
QVariant &  v2 
) const
virtual

Process binary operation with values v1 and v2. For unary operation the is invalid. The result of the operation is returned in the parameter v1.

Parameters
opoperation name
v1first argument (not valid for unary prefix operations)
v2second argument (not valid for unary postfix operations)
Returns
error code (QtxEvalExpr::Error)

Implements QtxEvalSet.

References add(), and QtxEvalExpr::OK.

QtxEvalExpr::Error QtxEvalSetSets::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)

Reimplemented from QtxEvalSetBase.

References QtxEvalSetBase::isValid(), QtxEvalExpr::OK, and QtxEvalExpr::OperandsNotMatch.

QString QtxEvalSetSets::Name ( )
static
Returns
operations set name
QString QtxEvalSetSets::name ( ) const
virtual
Returns
operations set name

Implements QtxEvalSet.

References Name().

int QtxEvalSetSets::priority ( const QString &  op,
bool  isBin 
) const
virtual

Operation priority counts from 1. If the operation is impossible, this function returns value <= 0.

Parameters
opoperation
isBintrue if the operation is binary and false if it is unary
Returns
operation priority

Implements QtxEvalSet.

void QtxEvalSetSets::remove ( ValueSet set,
const QVariant &  v 
)
static
Parameters
setsequence
vvalue to be removed
void QtxEvalSetSets::remove ( ValueSet s1,
const ValueSet s2 
)
static
Parameters
s1sequence from which items are removed
s2sequence which items are removed

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