Qt 4.8
|
Delegates an AtomicMathematician and switches its operands. More...
#include <qatomicmathematicians_p.h>
Public Functions | |
virtual Item | calculate (const Item &o1, const Operator op, const Item &o2, const QExplicitlySharedDataPointer< DynamicContext > &context) const |
OperandSwitcherMathematician (const AtomicMathematician::Ptr &mathematician) | |
Public Functions inherited from QPatternist::AtomicMathematician | |
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... | |
Properties | |
const AtomicMathematician::Ptr | m_mather |
Additional Inherited Members | |
Public Types inherited from QPatternist::AtomicMathematician | |
enum | Operator { Div = 1, IDiv = 2, Substract = 4, Mod = 8, Multiply = 16, Add = 32 } |
typedef QFlags< Operator > | Operators |
typedef QExplicitlySharedDataPointer< AtomicMathematician > | Ptr |
Public Types inherited from QPatternist::AtomicTypeVisitorResult | |
typedef QExplicitlySharedDataPointer< AtomicTypeVisitorResult > | Ptr |
Static Public Functions inherited from QPatternist::AtomicMathematician | |
static QString | displayName (const AtomicMathematician::Operator op) |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Delegates an AtomicMathematician and switches its operands.
Switches the operands of the call to a call to the calculate() on an AtomicMathematician such that the left operand becomes the right, and vice versa.
Its constructor takes an AtomicMathematician instance which this OperandSwitcherMathematician should act as as a middle-man for, having the role of switching the two operands. Thus, OperandSwitcherMathematician can be described as a proxy or delegator class.
This class is used for implementing operator combinations such as numeric * xs:yearMonthDuration
and xs:yearMonthDuration * numeric
.
Definition at line 180 of file qatomicmathematicians_p.h.
OperandSwitcherMathematician::OperandSwitcherMathematician | ( | const AtomicMathematician::Ptr & | mathematician | ) |
Creates an OperandSwitcherMathematician.
mathematician | the AtomicMathematician this OperandSwitcherMathematician should switch the operands for. Must be a non null , valid pointer. |
Definition at line 292 of file qatomicmathematicians.cpp.
Referenced by QPatternist::DurationDurationMathematician::calculate().
|
virtual |
Switch o1
and o2
, and returns the value from the AtomicMathematician this OperandSwitcherMathematician represents.
Implements QPatternist::AtomicMathematician.
Definition at line 297 of file qatomicmathematicians.cpp.
|
private |
Definition at line 200 of file qatomicmathematicians_p.h.
Referenced by calculate().