Qt 4.8
Public Functions | Properties | List of all members
PerformComparison Class Reference

Helper class for ComparisonFactory::fromLexical() which exposes CastingPlatform appropriately. More...

Inheritance diagram for PerformComparison:
QPatternist::ComparisonPlatform< PerformComparison, true > QPatternist::SourceLocationReflection

Public Functions

const SourceLocationReflectionactualReflection () const
 
bool operator() (const AtomicValue::Ptr &operand1, const AtomicValue::Ptr &operand2, const SchemaType::Ptr &type, const ReportContext::Ptr &context)
 
AtomicComparator::Operator operatorID () const
 
 PerformComparison (const SourceLocationReflection *const sourceLocationReflection, const AtomicComparator::Operator op)
 
- Public Functions inherited from QPatternist::SourceLocationReflection
virtual QString description () const
 
virtual QSourceLocation sourceLocation () const
 
 SourceLocationReflection ()
 
virtual ~SourceLocationReflection ()
 

Properties

const AtomicComparator::Operator m_operator
 
const SourceLocationReflection *const m_sourceReflection
 

Additional Inherited Members

- Protected Functions inherited from QPatternist::ComparisonPlatform< PerformComparison, true >
const AtomicComparator::Ptrcomparator () const
 
bool compare (const Item &i1, const Item &i2, const AtomicComparator::Ptr &comp, const AtomicComparator::Operator op) const
 Compares i1 and i2 with operator op, using comparator comp. All input arguments must be valid, and not null. More...
 
 ComparisonPlatform ()
 
AtomicComparator::ComparisonResult detailedFlexibleCompare (const Item &it1, const Item &it2, const DynamicContext::Ptr &context) const
 like flexibleCompare(), but returns the result as an AtomicComparator::Operator instead of bool. More...
 
AtomicComparator::Ptr fetchComparator (const ItemType::Ptr &type1, const ItemType::Ptr &type2, const ReportContext::Ptr &context) const
 
bool flexibleCompare (const Item &it1, const Item &it2, const DynamicContext::Ptr &context) const
 Compares it1 against it2, using comparator() and operatorID(). More...
 
void prepareComparison (const AtomicComparator::Ptr &comparator)
 
void useCaseInsensitiveComparator ()
 

Detailed Description

Helper class for ComparisonFactory::fromLexical() which exposes CastingPlatform appropriately.

Definition at line 59 of file qcomparisonfactory.cpp.

Constructors and Destructors

◆ PerformComparison()

PerformComparison::PerformComparison ( const SourceLocationReflection *const  sourceLocationReflection,
const AtomicComparator::Operator  op 
)
inline

Definition at line 63 of file qcomparisonfactory.cpp.

64  : m_sourceReflection(sourceLocationReflection)
65  , m_operator(op)
66  {
68  }
const AtomicComparator::Operator m_operator
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const SourceLocationReflection *const m_sourceReflection

Functions

◆ actualReflection()

const SourceLocationReflection* PerformComparison::actualReflection ( ) const
inlinevirtual

Implements QPatternist::SourceLocationReflection.

Definition at line 100 of file qcomparisonfactory.cpp.

101  {
102  return m_sourceReflection;
103  }
const SourceLocationReflection *const m_sourceReflection

◆ operator()()

bool PerformComparison::operator() ( const AtomicValue::Ptr operand1,
const AtomicValue::Ptr operand2,
const SchemaType::Ptr type,
const ReportContext::Ptr context 
)
inline

Definition at line 70 of file qcomparisonfactory.cpp.

74  {
75  const ItemType::Ptr asItemType((AtomicType::Ptr(type)));
76 
77  /* One area where the Query Transform world differs from the Schema
78  * world is that @c xs:duration is not considedered comparable, because
79  * it's according to Schema is partially comparable. This means
80  * ComparisonPlatform::fetchComparator() flags it as impossible, and
81  * hence we need to override that.
82  *
83  * SchemaType::wxsTypeMatches() will return true for sub-types of @c
84  * xs:duration as well, but that's ok since AbstractDurationComparator
85  * works for them too. */
86  if(BuiltinTypes::xsDuration->wxsTypeMatches(type))
88  else if (BuiltinTypes::xsGYear->wxsTypeMatches(type) ||
90  BuiltinTypes::xsGMonth->wxsTypeMatches(type) ||
94  else
95  prepareComparison(fetchComparator(asItemType, asItemType, context));
96 
97  return flexibleCompare(operand1, operand2, context);
98  }
xsAnyAtomicType numeric xsDuration xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsGYearMonth
xsAnyAtomicType numeric xsDuration xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsGDay
AllCompOperators AtomicComparator::OperatorEqual AtomicComparator::OperatorNotEqual AllCompOperators FloatType IntegerType FloatType IntegerType FloatType AllCompOperators FloatType AllCompOperators AbstractDateTimeComparator
AtomicComparator::Ptr fetchComparator(const ItemType::Ptr &type1, const ItemType::Ptr &type2, const ReportContext::Ptr &context) const
xsAnyAtomicType numeric xsDuration xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsGMonthDay
AllCompOperators AtomicComparator::OperatorEqual AtomicComparator::OperatorNotEqual AllCompOperators FloatType IntegerType FloatType IntegerType FloatType AllCompOperators FloatType AllCompOperators AtomicComparator::OperatorEqual AtomicComparator::OperatorNotEqual AtomicComparator::OperatorEqual AtomicComparator::OperatorNotEqual AtomicComparator::OperatorEqual AtomicComparator::OperatorNotEqual AllCompOperators AbstractDurationComparator
static bool wxsTypeMatches(const SchemaType::Ptr &type, const SchemaType::Ptr &otherType, QSet< SchemaType::Ptr > &visitedTypes, SchemaType::Ptr &conflictingType)
bool flexibleCompare(const Item &it1, const Item &it2, const DynamicContext::Ptr &context) const
Compares it1 against it2, using comparator() and operatorID().
void prepareComparison(const AtomicComparator::Ptr &comparator)

◆ operatorID()

AtomicComparator::Operator PerformComparison::operatorID ( ) const
inline

Definition at line 105 of file qcomparisonfactory.cpp.

106  {
107  return m_operator;
108  }
const AtomicComparator::Operator m_operator

Properties

◆ m_operator

const AtomicComparator::Operator PerformComparison::m_operator
private

Definition at line 112 of file qcomparisonfactory.cpp.

◆ m_sourceReflection

const SourceLocationReflection* const PerformComparison::m_sourceReflection
private

Definition at line 111 of file qcomparisonfactory.cpp.


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