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

A SequenceType instance represents the type of a sequence of Item instances. More...

#include <qsequencetype_p.h>

Inheritance diagram for QPatternist::SequenceType:
QSharedData QPatternist::EBVType QPatternist::EmptySequenceType QPatternist::GenericSequenceType QPatternist::NoneType

Public Types

typedef QList< SequenceType::PtrList
 
typedef QExplicitlySharedDataPointer< const SequenceTypePtr
 

Public Functions

virtual Cardinality cardinality () const =0
 
virtual QString displayName (const NamePool::Ptr &np) const =0
 
bool is (const SequenceType::Ptr &other) const
 
virtual ItemType::Ptr itemType () const =0
 
bool matches (const SequenceType::Ptr other) const
 
 SequenceType ()
 
virtual ~SequenceType ()
 
- 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...
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

A SequenceType instance represents the type of a sequence of Item instances.

It carries a Cardinality and ItemType, and is hence conceptually identical to the SequenceType EBNF construct.

Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com
See also
XML Path Language (XPath) 2.0, 2.5.3 SequenceType Syntax

Definition at line 82 of file qsequencetype_p.h.

Typedefs

◆ List

A list of SequenceType instances, each wrapped in a smart pointer.

Definition at line 97 of file qsequencetype_p.h.

◆ Ptr

A smart pointer wrapping SequenceType instances.

Definition at line 92 of file qsequencetype_p.h.

Constructors and Destructors

◆ SequenceType()

QPatternist::SequenceType::SequenceType ( )
inline

Definition at line 85 of file qsequencetype_p.h.

86  {
87  }

◆ ~SequenceType()

SequenceType::~SequenceType ( )
virtual

Definition at line 48 of file qsequencetype.cpp.

49 {
50 }

Functions

◆ cardinality()

virtual Cardinality QPatternist::SequenceType::cardinality ( ) const
pure virtual

Implemented in QPatternist::EBVType, QPatternist::NoneType, QPatternist::EmptySequenceType, and QPatternist::GenericSequenceType.

Referenced by QPatternist::TypeChecker::applyFunctionConversion(), QPatternist::CastableAs::CastableAs(), QPatternist::CastAs::CastAs(), QPatternist::NodeSortExpression::compress(), QPatternist::InstanceOf::compress(), QPatternist::CastableAs::compress(), QPatternist::NodeComparison::compress(), QPatternist::CardinalityVerifier::compress(), QPatternist::CountFN::compress(), QPatternist::StringJoinFN::compress(), QPatternist::ForClause::compress(), QPatternist::OrderBy::compress(), QPatternist::InstanceOf::evaluateEBV(), QPatternist::CastableAs::evaluateEBV(), QPatternist::NodeSortExpression::evaluateSequence(), QPatternist::CastAs::evaluateSingleton(), QPatternist::CastAs::expectedOperandTypes(), QPatternist::BySequenceTypeIdentifier::matches(), matches(), QPatternist::FunctionCall::staticType(), QPatternist::TextNodeConstructor::staticType(), QPatternist::ItemVerifier::staticType(), QPatternist::SimpleContentConstructor::staticType(), QPatternist::ForClause::staticType(), QPatternist::UntypedAtomicConverter::staticType(), QPatternist::ValueComparison::staticType(), QPatternist::NodeComparison::staticType(), QPatternist::CastAs::staticType(), QPatternist::Path::staticType(), QPatternist::RootFN::staticType(), QPatternist::CastableAs::typeCheck(), QPatternist::GeneralComparison::typeCheck(), QPatternist::ForClause::typeCheck(), QPatternist::ExpressionSequence::typeCheck(), QPatternist::AddingAggregate::typeCheck(), QPatternist::CastAs::typeCheck(), QPatternist::AvgFN::typeCheck(), QPatternist::DistinctValuesFN::typeCheck(), QPatternist::ReverseFN::typeCheck(), and QPatternist::CardinalityVerifier::verifyCardinality().

◆ displayName()

virtual QString QPatternist::SequenceType::displayName ( const NamePool::Ptr np) const
pure virtual

Generates a name for the sequence type for display purposes. The prefix used for the QName identifying the schema type is conventional. An example of a display name for a SequenceType is "xs:integer?".

Implemented in QPatternist::EmptySequenceType, QPatternist::EBVType, QPatternist::NoneType, and QPatternist::GenericSequenceType.

Referenced by QPatternist::FunctionSignature::displayName().

◆ is()

bool SequenceType::is ( const SequenceType::Ptr other) const

Definition at line 60 of file qsequencetype.cpp.

61 {
62  return matches(other) && other->matches(Ptr(this));
63 }
bool matches(const SequenceType::Ptr other) const
QExplicitlySharedDataPointer< const SequenceType > Ptr

◆ itemType()

virtual ItemType::Ptr QPatternist::SequenceType::itemType ( ) const
pure virtual

Implemented in QPatternist::EmptySequenceType, QPatternist::EBVType, QPatternist::NoneType, and QPatternist::GenericSequenceType.

Referenced by QPatternist::CastableAs::CastableAs(), QPatternist::CastAs::CastAs(), QPatternist::InstanceOf::compress(), QPatternist::CastableAs::compress(), QPatternist::CopyOf::compress(), QPatternist::CastAs::compress(), QPatternist::Path::compress(), QPatternist::GenericPredicate::create(), QPatternist::InstanceOf::evaluateEBV(), QPatternist::GeneralComparison::fetchGeneralComparator(), QPatternist::ArithmeticExpression::fetchMathematician(), QPatternist::BySequenceTypeIdentifier::matches(), matches(), QPatternist::Path::newFocusType(), QPatternist::GenericPredicate::newFocusType(), QPatternist::OrderBy::OrderSpec::prepare(), QPatternist::RangeVariableReference::staticType(), QPatternist::CardinalityVerifier::staticType(), QPatternist::CastAs::staticType(), QPatternist::SumFN::staticType(), QPatternist::DeepEqualFN::typeCheck(), QPatternist::FunctionCall::typeCheck(), QPatternist::NCNameConstructor::typeCheck(), QPatternist::ValueComparison::typeCheck(), QPatternist::CastableAs::typeCheck(), QPatternist::GeneralComparison::typeCheck(), QPatternist::ArithmeticExpression::typeCheck(), QPatternist::CountFN::typeCheck(), QPatternist::Atomizer::typeCheck(), QPatternist::UntypedAtomicConverter::typeCheck(), QPatternist::StringFN::typeCheck(), QPatternist::ExpressionSequence::typeCheck(), QPatternist::AddingAggregate::typeCheck(), QPatternist::IndexOfFN::typeCheck(), QPatternist::CastAs::typeCheck(), QPatternist::AvgFN::typeCheck(), QPatternist::NumberFN::typeCheck(), QPatternist::SumFN::typeCheck(), QPatternist::DistinctValuesFN::typeCheck(), QPatternist::GeneralComparison::updateType(), and QPatternist::TypeChecker::verifyType().

◆ matches()

bool SequenceType::matches ( const SequenceType::Ptr  other) const

Determines whether other is identical to, or a sub-type of this SequenceType. For example, if this SequenceType is xs:anyAtomicType, false is returned if other is element(), but true if other is xs:string.

The return values of cardinality() and itemType() used with ItemType::xdtTypeMatches and Cardinality::isWithinScope() is used for achieving this.

See also
XQuery 1.0: An XML Query Language, 2.5.4 SequenceType Matching

Definition at line 52 of file qsequencetype.cpp.

Referenced by is().

53 {
54  Q_ASSERT(other);
55 
56  return itemType()->xdtTypeMatches(other->itemType()) &&
57  cardinality().isMatch(other->cardinality());
58 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
virtual Cardinality cardinality() const =0
virtual bool xdtTypeMatches(const ItemType::Ptr &other) const =0
Returns true if other matches this type. That is, if other is equal to this type or a subtype of this...
virtual ItemType::Ptr itemType() const =0
bool isMatch(const Cardinality &other) const

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