1 /****************************************************************************
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this
14 ** file. Please review the following information to ensure the GNU Lesser
15 ** General Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 ** GNU General Public License Usage
23 ** Alternatively, this file may be used under the terms of the GNU General
24 ** Public License version 3.0 as published by the Free Software Foundation
25 ** and appearing in the file LICENSE.GPL included in the packaging of this
26 ** file. Please review the following information to ensure the GNU General
27 ** Public License version 3.0 requirements will be met:
28 ** http://www.gnu.org/copyleft/gpl.html.
31 ** Alternatively, this file may be used in accordance with the terms and
32 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
46 // This file is not part of the Qt API. It exists purely as an
47 // implementation detail. This header file may change from version to
48 // version without notice, or even be removed.
52 #ifndef Patternist_AtomicMathematicianLocators_H
53 #define Patternist_AtomicMathematicianLocators_H
55 #include "qatomicmathematician_p.h"
56 #include "qatomicmathematicianlocator_p.h"
60 * @short Contains AtomicMathematicianLocator sub-classes that finds classes
61 * which can perform arithmetics between atomic values.
71 * @author Frans Englich <frans.englich@nokia.com>
74 class DoubleMathematicianLocator : public AtomicMathematicianLocator
76 using AtomicMathematicianLocator::visit;
77 virtual AtomicTypeVisitorResult::Ptr visit(const DayTimeDurationType *, const qint16 op,
78 const SourceLocationReflection *const r) const;
79 virtual AtomicTypeVisitorResult::Ptr visit(const DecimalType *, const qint16 op,
80 const SourceLocationReflection *const r) const;
81 virtual AtomicTypeVisitorResult::Ptr visit(const DoubleType *, const qint16 op,
82 const SourceLocationReflection *const r) const;
83 virtual AtomicTypeVisitorResult::Ptr visit(const FloatType *, const qint16 op,
84 const SourceLocationReflection *const r) const;
85 virtual AtomicTypeVisitorResult::Ptr visit(const IntegerType *, const qint16 op,
86 const SourceLocationReflection *const r) const;
87 virtual AtomicTypeVisitorResult::Ptr visit(const YearMonthDurationType *, const qint16 op,
88 const SourceLocationReflection *const r) const;
92 * @author Frans Englich <frans.englich@nokia.com>
95 class FloatMathematicianLocator : public AtomicMathematicianLocator
97 using AtomicMathematicianLocator::visit;
98 virtual AtomicTypeVisitorResult::Ptr visit(const DayTimeDurationType *, const qint16 op,
99 const SourceLocationReflection *const r) const;
100 virtual AtomicTypeVisitorResult::Ptr visit(const DecimalType *, const qint16 op,
101 const SourceLocationReflection *const r) const;
102 virtual AtomicTypeVisitorResult::Ptr visit(const DoubleType *, const qint16 op,
103 const SourceLocationReflection *const r) const;
104 virtual AtomicTypeVisitorResult::Ptr visit(const FloatType *, const qint16 op,
105 const SourceLocationReflection *const r) const;
106 virtual AtomicTypeVisitorResult::Ptr visit(const IntegerType *, const qint16 op,
107 const SourceLocationReflection *const r) const;
108 virtual AtomicTypeVisitorResult::Ptr visit(const YearMonthDurationType *, const qint16 op,
109 const SourceLocationReflection *const r) const;
113 * @author Frans Englich <frans.englich@nokia.com>
116 class DecimalMathematicianLocator : public AtomicMathematicianLocator
118 using AtomicMathematicianLocator::visit;
119 virtual AtomicTypeVisitorResult::Ptr visit(const DayTimeDurationType *, const qint16 op,
120 const SourceLocationReflection *const r) const;
121 virtual AtomicTypeVisitorResult::Ptr visit(const DecimalType *, const qint16 op,
122 const SourceLocationReflection *const r) const;
123 virtual AtomicTypeVisitorResult::Ptr visit(const DoubleType *, const qint16 op,
124 const SourceLocationReflection *const r) const;
125 virtual AtomicTypeVisitorResult::Ptr visit(const FloatType *, const qint16 op,
126 const SourceLocationReflection *const r) const;
127 virtual AtomicTypeVisitorResult::Ptr visit(const IntegerType *, const qint16 op,
128 const SourceLocationReflection *const r) const;
129 virtual AtomicTypeVisitorResult::Ptr visit(const YearMonthDurationType *, const qint16 op,
130 const SourceLocationReflection *const r) const;
134 * @author Frans Englich <frans.englich@nokia.com>
137 class IntegerMathematicianLocator : public AtomicMathematicianLocator
139 using AtomicMathematicianLocator::visit;
140 virtual AtomicTypeVisitorResult::Ptr visit(const DayTimeDurationType *, const qint16 op,
141 const SourceLocationReflection *const r) const;
142 virtual AtomicTypeVisitorResult::Ptr visit(const DecimalType *, const qint16 op,
143 const SourceLocationReflection *const r) const;
144 virtual AtomicTypeVisitorResult::Ptr visit(const DoubleType *, const qint16 op,
145 const SourceLocationReflection *const r) const;
146 virtual AtomicTypeVisitorResult::Ptr visit(const FloatType *, const qint16 op,
147 const SourceLocationReflection *const r) const;
148 virtual AtomicTypeVisitorResult::Ptr visit(const IntegerType *, const qint16 op,
149 const SourceLocationReflection *const r) const;
150 virtual AtomicTypeVisitorResult::Ptr visit(const YearMonthDurationType *, const qint16 op,
151 const SourceLocationReflection *const r) const;
155 * @author Frans Englich <frans.englich@nokia.com>
158 class DateMathematicianLocator : public AtomicMathematicianLocator
160 using AtomicMathematicianLocator::visit;
161 virtual AtomicTypeVisitorResult::Ptr visit(const DateType *, const qint16 op,
162 const SourceLocationReflection *const r) const;
163 virtual AtomicTypeVisitorResult::Ptr visit(const YearMonthDurationType *, const qint16 op,
164 const SourceLocationReflection *const r) const;
165 virtual AtomicTypeVisitorResult::Ptr visit(const DayTimeDurationType *, const qint16 op,
166 const SourceLocationReflection *const r) const;
170 * @author Frans Englich <frans.englich@nokia.com>
173 class SchemaTimeMathematicianLocator : public AtomicMathematicianLocator
175 using AtomicMathematicianLocator::visit;
176 virtual AtomicTypeVisitorResult::Ptr visit(const SchemaTimeType *, const qint16 op,
177 const SourceLocationReflection *const r) const;
178 virtual AtomicTypeVisitorResult::Ptr visit(const DayTimeDurationType *, const qint16 op,
179 const SourceLocationReflection *const r) const;
183 * @author Frans Englich <frans.englich@nokia.com>
186 class DateTimeMathematicianLocator : public AtomicMathematicianLocator
188 using AtomicMathematicianLocator::visit;
189 virtual AtomicTypeVisitorResult::Ptr visit(const DateTimeType *, const qint16 op,
190 const SourceLocationReflection *const r) const;
191 virtual AtomicTypeVisitorResult::Ptr visit(const YearMonthDurationType *, const qint16 op,
192 const SourceLocationReflection *const r) const;
193 virtual AtomicTypeVisitorResult::Ptr visit(const DayTimeDurationType *, const qint16 op,
194 const SourceLocationReflection *const r) const;
197 * @author Frans Englich <frans.englich@nokia.com>
200 class DayTimeDurationMathematicianLocator : public AtomicMathematicianLocator
202 using AtomicMathematicianLocator::visit;
203 virtual AtomicTypeVisitorResult::Ptr visit(const DateTimeType *, const qint16 op,
204 const SourceLocationReflection *const r) const;
205 virtual AtomicTypeVisitorResult::Ptr visit(const DateType *, const qint16 op,
206 const SourceLocationReflection *const r) const;
207 virtual AtomicTypeVisitorResult::Ptr visit(const DayTimeDurationType *, const qint16 op,
208 const SourceLocationReflection *const r) const;
209 virtual AtomicTypeVisitorResult::Ptr visit(const DecimalType *, const qint16 op,
210 const SourceLocationReflection *const r) const;
211 virtual AtomicTypeVisitorResult::Ptr visit(const DoubleType *, const qint16 op,
212 const SourceLocationReflection *const r) const;
213 virtual AtomicTypeVisitorResult::Ptr visit(const FloatType *, const qint16 op,
214 const SourceLocationReflection *const r) const;
215 virtual AtomicTypeVisitorResult::Ptr visit(const IntegerType *, const qint16 op,
216 const SourceLocationReflection *const r) const;
217 virtual AtomicTypeVisitorResult::Ptr visit(const SchemaTimeType *, const qint16 op,
218 const SourceLocationReflection *const r) const;
222 * @author Frans Englich <frans.englich@nokia.com>
225 class YearMonthDurationMathematicianLocator : public AtomicMathematicianLocator
227 using AtomicMathematicianLocator::visit;
228 virtual AtomicTypeVisitorResult::Ptr visit(const DateTimeType *, const qint16 op,
229 const SourceLocationReflection *const r) const;
230 virtual AtomicTypeVisitorResult::Ptr visit(const DateType *, const qint16 op,
231 const SourceLocationReflection *const r) const;
232 virtual AtomicTypeVisitorResult::Ptr visit(const DecimalType *, const qint16 op,
233 const SourceLocationReflection *const r) const;
234 virtual AtomicTypeVisitorResult::Ptr visit(const DoubleType *, const qint16 op,
235 const SourceLocationReflection *const r) const;
236 virtual AtomicTypeVisitorResult::Ptr visit(const FloatType *, const qint16 op,
237 const SourceLocationReflection *const r) const;
238 virtual AtomicTypeVisitorResult::Ptr visit(const IntegerType *, const qint16 op,
239 const SourceLocationReflection *const r) const;
240 virtual AtomicTypeVisitorResult::Ptr visit(const YearMonthDurationType *, const qint16 op,
241 const SourceLocationReflection *const r) const;