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

Represents the special none type. More...

#include <qnonetype_p.h>

Inheritance diagram for QPatternist::NoneType:
QPatternist::ItemType QPatternist::SequenceType QSharedData QSharedData

Public Types

typedef QExplicitlySharedDataPointer< NoneTypePtr
 
- 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::SequenceType
typedef QList< SequenceType::PtrList
 
typedef QExplicitlySharedDataPointer< const SequenceTypePtr
 

Public Functions

virtual ItemType::Ptr atomizedType () const
 
virtual Cardinality cardinality () const
 
virtual QString displayName (const NamePool::Ptr &np) const
 
virtual bool isAtomicType () const
 
virtual bool isNodeType () const
 
virtual bool itemMatches (const Item &item) const
 
virtual ItemType::Ptr itemType () const
 
virtual const ItemTypeoperator| (const ItemType &other) const
 
virtual ItemType::Ptr xdtSuperType () const
 
virtual bool xdtTypeMatches (const ItemType::Ptr &other) const
 Returns true if other matches this type. That is, if other is equal to this type or a subtype of this type. More...
 
- 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 ~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::SequenceType
bool is (const SequenceType::Ptr &other) const
 
bool matches (const SequenceType::Ptr other) const
 
 SequenceType ()
 
virtual ~SequenceType ()
 

Protected Functions

 NoneType ()
 

Friends

class CommonSequenceTypes
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Represents the special none type.

See also
XQuery 1.0 and XPath 2.0 Formal Semantics, 2.4.3 Content models
XQuery 1.0 and XPath 2.0 Formal Semantics, 7.2.9 The fn:error function
Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 75 of file qnonetype_p.h.

Typedefs

◆ Ptr

Definition at line 79 of file qnonetype_p.h.

Constructors and Destructors

◆ NoneType()

NoneType::NoneType ( )
protected

Definition at line 50 of file qnonetype.cpp.

51 {
52 }

Functions

◆ atomizedType()

ItemType::Ptr NoneType::atomizedType ( ) const
virtual

This can be thought to be a weird function for this type(none). There is no atomized type for none, perhaps the best from a conceptual perspective would be to return null.

This function returns BuiltinTypes::xsAnyAtomicType because the generic type checking code inserts an Atomizer in the AST when an error() function(or other node which has type none) is part of an operator expression(value/general comparison, arithmetics). The Atomizer returns the atomizedType() of its child, and by here returning xsAnyAtomicType, static operator lookup is postponed to runtime. Subsequently, expressions like error() works properly with other XPath expressions.

Implements QPatternist::ItemType.

Definition at line 94 of file qnonetype.cpp.

95 {
97 }
static const AtomicType::Ptr xsAnyAtomicType

◆ cardinality()

Cardinality NoneType::cardinality ( ) const
virtual
Note
The semantical meaning of this type's cardinality can surely be discussed. The function is provided due to it being mandated by the SequenceType base class.
Returns
always Cardinality::zeroOrMore()

Implements QPatternist::SequenceType.

Definition at line 74 of file qnonetype.cpp.

75 {
76  return Cardinality::zeroOrMore();
77 }
static Cardinality zeroOrMore()

◆ displayName()

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

Implements QPatternist::ItemType.

Definition at line 69 of file qnonetype.cpp.

70 {
71  return QLatin1String("none");
72 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString

◆ isAtomicType()

bool NoneType::isAtomicType ( ) const
virtual
Returns
always false

Implements QPatternist::ItemType.

Definition at line 84 of file qnonetype.cpp.

85 {
86  return false;
87 }

◆ isNodeType()

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

Implements QPatternist::ItemType.

Definition at line 89 of file qnonetype.cpp.

90 {
91  return false;
92 }

◆ itemMatches()

bool NoneType::itemMatches ( const Item item) const
virtual
Parameters
itemthe item that is to be matched. This is guaranteed by the caller to never be null.

Implements QPatternist::ItemType.

Definition at line 54 of file qnonetype.cpp.

55 {
56  return false;
57 }

◆ itemType()

ItemType::Ptr NoneType::itemType ( ) const
virtual
Note
The semantical meaning of this type's item type can surely be discussed. The function is provided due to it being mandated by the SequenceType base class.
Returns
always 'this' since NoneType is also an ItemType

Implements QPatternist::SequenceType.

Definition at line 79 of file qnonetype.cpp.

80 {
81  return ItemType::Ptr(const_cast<NoneType *>(this));
82 }
QExplicitlySharedDataPointer< ItemType > Ptr
Definition: qitemtype_p.h:88

◆ operator|()

const ItemType & NoneType::operator| ( const ItemType other) const
virtual
Returns
always other. The none type can be thought as disappearing when attempting to find the union of it and another type.

Reimplemented from QPatternist::ItemType.

Definition at line 64 of file qnonetype.cpp.

65 {
66  return other;
67 }

◆ xdtSuperType()

ItemType::Ptr NoneType::xdtSuperType ( ) const
virtual
Returns
always item()

Implements QPatternist::ItemType.

Definition at line 99 of file qnonetype.cpp.

100 {
101  return BuiltinTypes::item;
102 }
static const ItemType::Ptr item

◆ xdtTypeMatches()

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

Returns true if other matches this type. That is, if other is equal to this type or a subtype of this type.

For instance this statements evaluates to true:

but this evaluates to false:

Parameters
otherthe other ItemType that is to be matched. This is guaranteed by the caller to never be null.

Implements QPatternist::ItemType.

Definition at line 59 of file qnonetype.cpp.

60 {
61  return *this == *t;
62 }

Friends and Related Functions

◆ CommonSequenceTypes

friend class CommonSequenceTypes
friend

Definition at line 146 of file qnonetype_p.h.


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