Qt 4.8
Public Types | Public Functions | Static Public Functions | List of all members
QPatternist::AtomicMathematician Class Referenceabstract

Base class for classes that performs arithmetic operations between atomic values. More...

#include <qatomicmathematician_p.h>

Inheritance diagram for QPatternist::AtomicMathematician:
QPatternist::AtomicTypeVisitorResult QSharedData QPatternist::AbstractDateTimeMathematician QPatternist::AbstractFloatMathematician< isDouble > QPatternist::DateTimeDurationMathematician QPatternist::DecimalMathematician QPatternist::DurationDurationDivisor QPatternist::DurationDurationMathematician QPatternist::DurationNumericMathematician QPatternist::IntegerMathematician QPatternist::OperandSwitcherMathematician

Public Types

enum  Operator {
  Div = 1, IDiv = 2, Substract = 4, Mod = 8,
  Multiply = 16, Add = 32
}
 
typedef QFlags< OperatorOperators
 
typedef QExplicitlySharedDataPointer< AtomicMathematicianPtr
 
- Public Types inherited from QPatternist::AtomicTypeVisitorResult
typedef QExplicitlySharedDataPointer< AtomicTypeVisitorResultPtr
 

Public Functions

virtual Item calculate (const Item &operand1, const Operator op, const Item &operand2, const QExplicitlySharedDataPointer< DynamicContext > &context) const =0
 
virtual ~AtomicMathematician ()
 
- Public Functions inherited from QPatternist::AtomicTypeVisitorResult
 AtomicTypeVisitorResult ()
 
virtual ~AtomicTypeVisitorResult ()
 
- Public Functions inherited from QSharedData
 QSharedData ()
 Constructs a QSharedData object with a reference count of 0. More...
 
 QSharedData (const QSharedData &)
 Constructs a QSharedData object with reference count 0. More...
 

Static Public Functions

static QString displayName (const AtomicMathematician::Operator op)
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Base class for classes that performs arithmetic operations between atomic values.

Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 73 of file qatomicmathematician_p.h.

Typedefs

◆ Operators

Definition at line 119 of file qatomicmathematician_p.h.

◆ Ptr

Definition at line 78 of file qatomicmathematician_p.h.

Enumerations

◆ Operator

Constructors and Destructors

◆ ~AtomicMathematician()

AtomicMathematician::~AtomicMathematician ( )
virtual

Definition at line 48 of file qatomicmathematician.cpp.

49 {
50 }

Functions

◆ calculate()

virtual Item QPatternist::AtomicMathematician::calculate ( const Item operand1,
const Operator  op,
const Item operand2,
const QExplicitlySharedDataPointer< DynamicContext > &  context 
) const
pure virtual

◆ displayName()

QString AtomicMathematician::displayName ( const AtomicMathematician::Operator  op)
static

Definition at line 52 of file qatomicmathematician.cpp.

Referenced by QPatternist::ArithmeticExpression::fetchMathematician().

53 {
54  switch(op)
55  {
57  return QLatin1String("div");
59  return QLatin1String("idiv");
61  return QLatin1String("-");
63  return QLatin1String("mod");
65  return QLatin1String("*");
67  return QLatin1String("+");
68  }
69 
70  return QString(); /* Silence GCC warning. */
71 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83

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