Qt 4.8
Public Functions | Protected Functions | Friends | List of all members
QPatternist::NumericType Class Reference

Represents the internal and abstract type fs:numeric. More...

#include <qnumerictype_p.h>

Inheritance diagram for QPatternist::NumericType:
QPatternist::AtomicType QPatternist::ItemType QPatternist::AnySimpleType QSharedData QPatternist::AnyType QPatternist::SchemaType QPatternist::SchemaComponent QSharedData

Public Functions

virtual AtomicTypeVisitorResult::Ptr accept (const AtomicTypeVisitor::Ptr &visitor, const SourceLocationReflection *const) const
 
virtual AtomicTypeVisitorResult::Ptr accept (const ParameterizedAtomicTypeVisitor::Ptr &visitor, const qint16 op, const SourceLocationReflection *const) const
 
virtual ItemType::Ptr atomizedType () const
 
virtual AtomicCasterLocator::Ptr casterLocator () const
 
virtual AtomicComparatorLocator::Ptr comparatorLocator () const
 
virtual QString displayName (const NamePool::Ptr &np) const
 
virtual bool isAbstract () const
 
virtual bool isAtomicType () const
 
virtual bool isNodeType () const
 
virtual bool itemMatches (const Item &item) const
 
virtual AtomicMathematicianLocator::Ptr mathematicianLocator () const
 
virtual SchemaType::Ptr wxsSuperType () const
 
virtual ItemType::Ptr xdtSuperType () const
 
virtual bool xdtTypeMatches (const ItemType::Ptr &other) const
 
virtual ~NumericType ()
 
- Public Functions inherited from QPatternist::AtomicType
virtual AtomicTypeVisitorResult::Ptr accept (const QExplicitlySharedDataPointer< AtomicTypeVisitor > &visitor, const SourceLocationReflection *const) const =0
 
virtual TypeCategory category () const
 
virtual DerivationMethod derivationMethod () const
 
virtual ~AtomicType ()
 
- Public Functions inherited from QPatternist::ItemType
virtual InstanceOf instanceOf () const
 
 ItemType ()
 
virtual Category itemTypeCategory () const
 
bool operator!= (const ItemType &other) const
 
virtual bool operator== (const ItemType &other) const
 
virtual const ItemTypeoperator| (const ItemType &other) const
 
virtual ~ItemType ()
 
- 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::AnySimpleType
virtual bool isComplexType () const
 
virtual bool isSimpleType () const
 
virtual QXmlName name (const NamePool::Ptr &np) const
 Returns the name of the type. More...
 
virtual ~AnySimpleType ()
 
- Public Functions inherited from QPatternist::AnyType
virtual DerivationConstraints derivationConstraints () const
 
virtual bool wxsTypeMatches (const SchemaType::Ptr &other) const
 
virtual ~AnyType ()
 
- Public Functions inherited from QPatternist::SchemaType
virtual bool isDefinedBySchema () const
 
 SchemaType ()
 
virtual ~SchemaType ()
 
- Public Functions inherited from QPatternist::SchemaComponent
 SchemaComponent ()
 
virtual ~SchemaComponent ()
 

Protected Functions

 NumericType ()
 
- Protected Functions inherited from QPatternist::AtomicType
 AtomicType ()
 
- Protected Functions inherited from QPatternist::AnySimpleType
 AnySimpleType ()
 
- Protected Functions inherited from QPatternist::AnyType
 AnyType ()
 This constructor is protected, because this class must be sub-classed. More...
 

Friends

class BuiltinTypes
 

Additional Inherited Members

- Public Types inherited from QPatternist::AtomicType
typedef QExplicitlySharedDataPointer< AtomicTypePtr
 
- Public Types inherited from QPatternist::ItemType
enum  Category { NodeNameTest = 1, Other = 2 }
 
enum  InstanceOf { ClassLocalNameTest, ClassNamespaceNameTest, ClassQNameTest, ClassOther }
 
typedef QList< ItemType::PtrList
 
typedef QExplicitlySharedDataPointer< ItemTypePtr
 
- Public Types inherited from QPatternist::AnySimpleType
typedef QList< AnySimpleType::PtrList
 
typedef QExplicitlySharedDataPointer< AnySimpleTypePtr
 
- Public Types inherited from QPatternist::AnyType
typedef QExplicitlySharedDataPointer< AnyTypePtr
 
- Public Types inherited from QPatternist::SchemaType
enum  DerivationConstraint { RestrictionConstraint = 1, ExtensionConstraint = 2, ListConstraint = 4, UnionConstraint = 8 }
 
enum  DerivationMethod {
  DerivationRestriction = 1, DerivationExtension = 2, DerivationUnion = 4, DerivationList = 8,
  NoDerivation = 16
}
 
typedef QHash< QXmlName, SchemaType::PtrHash
 
typedef QList< SchemaType::PtrList
 
typedef QExplicitlySharedDataPointer< SchemaTypePtr
 
enum  TypeCategory {
  None = 0, SimpleTypeAtomic, SimpleTypeList, SimpleTypeUnion,
  ComplexType
}
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Represents the internal and abstract type fs:numeric.

See also
XQuery 1.0 and XPath 2.0 Formal Semantics, Definition: fs:numeric
Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 71 of file qnumerictype_p.h.

Constructors and Destructors

◆ ~NumericType()

NumericType::~NumericType ( )
virtual

Definition at line 57 of file qnumerictype.cpp.

58 {
59 }

◆ NumericType()

NumericType::NumericType ( )
protected

Definition at line 53 of file qnumerictype.cpp.

54 {
55 }

Functions

◆ accept() [1/2]

AtomicTypeVisitorResult::Ptr NumericType::accept ( const AtomicTypeVisitor::Ptr visitor,
const SourceLocationReflection * const   
) const
virtual

NumericType cannot be visited. This function is only implemented to satisfy the abstract super class's interface.

Returns
always a null pointer

Definition at line 114 of file qnumerictype.cpp.

116 {
118 }
QExplicitlySharedDataPointer< AtomicTypeVisitorResult > Ptr

◆ accept() [2/2]

AtomicTypeVisitorResult::Ptr NumericType::accept ( const ParameterizedAtomicTypeVisitor::Ptr visitor,
const qint16  op,
const SourceLocationReflection * const   
) const
virtual

NumericType cannot be visited. This function is only implemented to satisfy the abstract super class's interface.

Returns
always a null pointer

Implements QPatternist::AtomicType.

Definition at line 120 of file qnumerictype.cpp.

123 {
125 }
QExplicitlySharedDataPointer< AtomicTypeVisitorResult > Ptr

◆ atomizedType()

ItemType::Ptr NumericType::atomizedType ( ) const
virtual
Returns
null. It makes no sense to atomize the abstract type fs:numeric.

Reimplemented from QPatternist::AtomicType.

Definition at line 109 of file qnumerictype.cpp.

110 {
111  return AtomicType::Ptr();
112 }
QExplicitlySharedDataPointer< AtomicType > Ptr
Definition: qatomictype_p.h:85

◆ casterLocator()

AtomicCasterLocator::Ptr NumericType::casterLocator ( ) const
virtual

The type fs:numeric is an abstract type which therefore cannot be involved in casting. Hence, this function returns null. This function is only implemented to satisfy the abstract super class's interface.

Returns
always a null pointer

Implements QPatternist::AtomicType.

Definition at line 137 of file qnumerictype.cpp.

138 {
139  return AtomicCasterLocator::Ptr();
140 }
QExplicitlySharedDataPointer< AtomicCasterLocator > Ptr

◆ comparatorLocator()

AtomicComparatorLocator::Ptr NumericType::comparatorLocator ( ) const
virtual

The type fs:numeric is an abstract type which therefore cannot be involved in comparisons. Hence, this function returns null. This function is only implemented to satisfy the abstract super class's interface.

Returns
always a null pointer

Implements QPatternist::AtomicType.

Definition at line 127 of file qnumerictype.cpp.

128 {
130 }
QExplicitlySharedDataPointer< AtomicComparatorLocator > Ptr

◆ displayName()

QString NumericType::displayName ( const NamePool::Ptr np) const
virtual
Returns
always "numeric". That is, no namespace prefix

Reimplemented from QPatternist::AtomicType.

Definition at line 79 of file qnumerictype.cpp.

80 {
81  return QLatin1String("numeric");
82 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString

◆ isAbstract()

bool NumericType::isAbstract ( ) const
virtual
Returns
always true

Reimplemented from QPatternist::AnyType.

Definition at line 94 of file qnumerictype.cpp.

95 {
96  return true;
97 }

◆ isAtomicType()

bool NumericType::isAtomicType ( ) const
virtual
Returns
always true

Reimplemented from QPatternist::AtomicType.

Definition at line 104 of file qnumerictype.cpp.

105 {
106  return true;
107 }

◆ isNodeType()

bool NumericType::isNodeType ( ) const
virtual
Returns
always false

Reimplemented from QPatternist::AtomicType.

Definition at line 99 of file qnumerictype.cpp.

100 {
101  return false;
102 }

◆ itemMatches()

bool NumericType::itemMatches ( const Item item) const
virtual

Implements a generic algorithm which relies on wxsTypeMatches().

Returns
true depending on if item is an atomic type, and that AtomicValue::itemType()'s SequenceType::itemType() matches this type.

Reimplemented from QPatternist::AtomicType.

Definition at line 61 of file qnumerictype.cpp.

62 {
63  if(item.isNode())
64  return false;
65 
66  return BuiltinTypes::xsDouble->itemMatches(item) ||
67  BuiltinTypes::xsDecimal->itemMatches(item) ||
68  BuiltinTypes::xsFloat->itemMatches(item);
69 }
bool isNode() const
Determines whether this item is an atomic value, or a node.
Definition: qitem_p.h:349
static const AtomicType::Ptr xsDouble
static const AtomicType::Ptr xsFloat
static const AtomicType::Ptr xsDecimal

◆ mathematicianLocator()

AtomicMathematicianLocator::Ptr NumericType::mathematicianLocator ( ) const
virtual

The type fs:numeric is an abstract type which therefore cannot be involved in arithmetics. Hence, this function returns null. This function is only implemented to satisfy the abstract super class's interface.

Returns
always a null pointer

Implements QPatternist::AtomicType.

Definition at line 132 of file qnumerictype.cpp.

133 {
135 }
QExplicitlySharedDataPointer< AtomicMathematicianLocator > Ptr

◆ wxsSuperType()

SchemaType::Ptr NumericType::wxsSuperType ( ) const
virtual
Returns
always xs:anyAtomicType

Reimplemented from QPatternist::AnySimpleType.

Definition at line 84 of file qnumerictype.cpp.

85 {
87 }
static const AtomicType::Ptr xsAnyAtomicType

◆ xdtSuperType()

ItemType::Ptr NumericType::xdtSuperType ( ) const
virtual
Returns
always xs:anyAtomicType

Implements QPatternist::ItemType.

Definition at line 89 of file qnumerictype.cpp.

90 {
92 }
static const AtomicType::Ptr xsAnyAtomicType

◆ xdtTypeMatches()

bool NumericType::xdtTypeMatches ( const ItemType::Ptr other) const
virtual

Determines whether other is equal to this type, or is a sub-type of this type.

The implementation is generic, relying on operator==() and xdtSuperType().

Reimplemented from QPatternist::AtomicType.

Definition at line 71 of file qnumerictype.cpp.

72 {
73  return BuiltinTypes::xsDouble->xdtTypeMatches(t) ||
74  BuiltinTypes::xsDecimal->xdtTypeMatches(t) ||
75  BuiltinTypes::xsFloat->xdtTypeMatches(t) ||
76  *t == *this; /* If it's NumericType */
77 }
static const AtomicType::Ptr xsDouble
static const AtomicType::Ptr xsFloat
static const AtomicType::Ptr xsDecimal

Friends and Related Functions

◆ BuiltinTypes

friend class BuiltinTypes
friend

Definition at line 165 of file qnumerictype_p.h.


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