Qt 4.8
Public Functions | Properties | List of all members
QPatternist::BySequenceTypeIdentifier Class Reference

Identifies Expression instances based on their static type. More...

#include <qoptimizerblocks_p.h>

Inheritance diagram for QPatternist::BySequenceTypeIdentifier:
QPatternist::ExpressionIdentifier QSharedData

Public Functions

 BySequenceTypeIdentifier (const SequenceType::Ptr &seqType)
 
virtual bool matches (const Expression::Ptr &expr) const
 
- Public Functions inherited from QPatternist::ExpressionIdentifier
 ExpressionIdentifier ()
 
virtual ~ExpressionIdentifier ()
 
- 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 SequenceType::Ptr m_seqType
 

Additional Inherited Members

- Public Types inherited from QPatternist::ExpressionIdentifier
typedef QList< ExpressionIdentifier::PtrList
 
typedef QExplicitlySharedDataPointer< ExpressionIdentifierPtr
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Identifies Expression instances based on their static type.

BySequenceTypeIdentifier identifies Expression instances if their Expression::staticType() matches the requested one, regardless of whether the Expression is a particular one, such as AndExpression.

For example, constructing a BySequenceTypeIdentifier while passing CommonSequenceTypes::EBV in its constructor will create a ExpressionIdentifier that returns true for a static type with item type xs:string, but returns false for a static type involving xs:date.

Author
Frans englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 97 of file qoptimizerblocks_p.h.

Constructors and Destructors

◆ BySequenceTypeIdentifier()

BySequenceTypeIdentifier::BySequenceTypeIdentifier ( const SequenceType::Ptr seqType)

Definition at line 94 of file qoptimizerblocks.cpp.

94  : m_seqType(seqType)
95 {
96  Q_ASSERT(seqType);
97 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

Functions

◆ matches()

bool BySequenceTypeIdentifier::matches ( const Expression::Ptr expr) const
virtual
Returns
true, if the static type of expr is matches the SequenceType passed in the BySequenceTypeIdentifier() constructor, otherwise false.

Implements QPatternist::ExpressionIdentifier.

Definition at line 99 of file qoptimizerblocks.cpp.

100 {
101  const SequenceType::Ptr t(expr->staticType());
102 
103  return m_seqType->itemType()->xdtTypeMatches(t->itemType())
104  &&
105  m_seqType->cardinality().isMatch(t->cardinality());
106 }
virtual Cardinality cardinality() const =0
virtual SequenceType::Ptr staticType() 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

Properties

◆ m_seqType

const SequenceType::Ptr QPatternist::BySequenceTypeIdentifier::m_seqType
private

Definition at line 110 of file qoptimizerblocks_p.h.

Referenced by matches().


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