Qt 4.8
|
Base class for all numeric values. More...
#include <qschemanumeric_p.h>
Public Types | |
typedef QExplicitlySharedDataPointer< Numeric > | Ptr |
Public Types inherited from QPatternist::AtomicValue | |
typedef QList< AtomicValue::Ptr > | List |
typedef QExplicitlySharedDataPointer< AtomicValue > | Ptr |
Public Functions | |
virtual Numeric::Ptr | abs () const =0 |
virtual Numeric::Ptr | ceiling () const =0 |
virtual Numeric::Ptr | floor () const =0 |
virtual bool | isInf () const =0 |
virtual bool | isNaN () const =0 |
virtual bool | isSigned () const =0 |
Returns true if this value is signed. If false is returned, the value is unsigned. More... | |
virtual Numeric::Ptr | round () const =0 |
virtual Numeric::Ptr | roundHalfToEven (const xsInteger scale) const =0 |
virtual xsFloat | toDecimal () const =0 |
virtual xsDouble | toDouble () const =0 |
virtual xsFloat | toFloat () const =0 |
virtual xsInteger | toInteger () const =0 |
virtual Item | toNegated () const =0 |
virtual qulonglong | toUnsignedInteger () const =0 |
Public Functions inherited from QPatternist::AtomicValue | |
virtual bool | evaluateEBV (const QExplicitlySharedDataPointer< DynamicContext > &context) const |
virtual bool | hasError () const |
virtual QString | stringValue () const =0 |
virtual ItemType::Ptr | type () const =0 |
virtual | ~AtomicValue () |
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... | |
Public Functions inherited from QPatternist::CppCastingHelper< AtomicValue > | |
const TCastTarget * | as () const |
TCastTarget * | as () |
Static Public Functions | |
static AtomicValue::Ptr | fromLexical (const QString &number) |
Static Public Functions inherited from QPatternist::AtomicValue | |
static ItemType::Ptr | qtToXDMType (const QXmlItem &item) |
static QVariant | toQt (const AtomicValue *const value) |
static QVariant | toQt (const AtomicValue::Ptr &value) |
static Item | toXDM (const QVariant &value) |
Static Protected Functions | |
static xsDouble | roundFloat (const xsDouble val) |
Implements fn:round() for types implemented with floating point. More... | |
Additional Inherited Members | |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Protected Functions inherited from QPatternist::AtomicValue | |
AtomicValue () | |
Protected Functions inherited from QPatternist::CppCastingHelper< AtomicValue > | |
CppCastingHelper () | |
Base class for all numeric values.
Definition at line 90 of file qschemanumeric_p.h.
Definition at line 94 of file qschemanumeric_p.h.
|
pure virtual |
Performs the algorithm specified for the function fn:abs on this Numeric, and whose result is returned.
Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::AbstractFloat< isDouble >, QPatternist::Decimal, and QPatternist::Integer.
Referenced by QPatternist::AbsFN::evaluateSingleton().
|
pure virtual |
Performs the algorithm specified for the function fn:ceiling on this Numeric, and whose result is returned.
Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::AbstractFloat< isDouble >, QPatternist::Decimal, and QPatternist::Integer.
Referenced by QPatternist::CeilingFN::evaluateSingleton().
|
pure virtual |
Performs the algorithm specified for the function fn:floor on this Numeric, and whose result is returned.
Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::AbstractFloat< isDouble >, QPatternist::Decimal, and QPatternist::Integer.
Referenced by QPatternist::FloorFN::evaluateSingleton().
|
static |
Creates a Numeric sub-class that is appropriate for number
.
Currently used in the parser to create appropriate expressions.
Definition at line 62 of file qschemanumeric.cpp.
|
pure virtual |
Determines whether this Numeric is an infinite number. Signedness is irrelevant, -INF as well as INF is considered infinity.
For numeric types that cannot represent infinity, such as xs:integer , this function should return false
.
true
if this Numeric is an infinite number Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::Decimal, QPatternist::AbstractFloat< isDouble >, and QPatternist::Integer.
Referenced by QPatternist::AbstractFloatMathematician< isDouble >::calculate().
|
pure virtual |
Determines whether this Numeric is not-a-number, NaN
. For numeric types that cannot represent NaN
, this function should return false
.
true
if this Numeric is NaN
Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::AbstractFloat< isDouble >, QPatternist::Decimal, and QPatternist::Integer.
Referenced by QPatternist::AbstractFloatMathematician< isDouble >::calculate(), and qLess< Item::List >::isNaN().
|
pure virtual |
Returns true
if this value is signed. If false
is returned, the value is unsigned.
For float and decimal values, xs:double
, xs:float
and xs:decimal
, the code asserts and behavior is undefined.
Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::Decimal, QPatternist::AbstractFloat< isDouble >, and QPatternist::Integer.
Referenced by QPatternist::IntegerComparator::compare().
|
pure virtual |
Performs the algorithm specified for the function fn:round on this Numeric, and whose result is returned.
Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::AbstractFloat< isDouble >, QPatternist::Decimal, and QPatternist::Integer.
Referenced by QPatternist::RoundFN::evaluateSingleton().
Implements fn:round()
for types implemented with floating point.
MS Windows and at least IRIX does not have C99's nearbyint() function(see the man page), so we reinvent it.
Definition at line 75 of file qschemanumeric.cpp.
Referenced by QPatternist::Decimal::round(), and QPatternist::AbstractFloat< isDouble >::round().
|
pure virtual |
Performs rounding as defined for the fn:round-half-to-even on this Numeric, and whose result is returned.
Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::AbstractFloat< isDouble >, QPatternist::Decimal, and QPatternist::Integer.
Referenced by QPatternist::RoundHalfToEvenFN::evaluateSingleton().
|
pure virtual |
Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::AbstractFloat< isDouble >, QPatternist::Decimal, and QPatternist::Integer.
Referenced by QPatternist::ComparingAggregator< oper, result >::applyNumericPromotion(), QPatternist::DecimalMathematician::calculate(), QPatternist::IntegerMathematician::calculate(), and QPatternist::DecimalComparator::equals().
|
pure virtual |
Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::AbstractFloat< isDouble >, QPatternist::Decimal, and QPatternist::Integer.
Referenced by QPatternist::ComparingAggregator< oper, result >::applyNumericPromotion(), QPatternist::AbstractFloatMathematician< isDouble >::calculate(), QPatternist::XsdTypeChecker::checkConstrainingFacets(), QPatternist::AbstractFloatComparator::equals(), QPatternist::SubstringFN::evaluateSingleton(), QPatternist::GenericPredicate::mapToItem(), and QPatternist::AtomicValue::toQt().
|
pure virtual |
Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::AbstractFloat< isDouble >, QPatternist::Decimal, and QPatternist::Integer.
|
pure virtual |
Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::AbstractFloat< isDouble >, QPatternist::Decimal, and QPatternist::Integer.
Referenced by QPatternist::DecimalMathematician::calculate(), QPatternist::IntegerMathematician::calculate(), QPatternist::XsdTypeChecker::checkConstrainingFacets(), QPatternist::SubsequenceFN::compress(), QPatternist::SubsequenceFN::evaluateSequence(), QPatternist::SubsequenceFN::staticType(), and QPatternist::AtomicValue::toQt().
|
pure virtual |
Unary minus.
Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::Decimal, QPatternist::AbstractFloat< isDouble >, and QPatternist::Integer.
|
pure virtual |
Implemented in QPatternist::DerivedInteger< DerivedType >, QPatternist::AbstractFloat< isDouble >, QPatternist::Decimal, and QPatternist::Integer.
Referenced by QPatternist::XsdTypeChecker::checkConstrainingFacets().