diff options
Diffstat (limited to 'common/datastorequery.cpp')
-rw-r--r-- | common/datastorequery.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/common/datastorequery.cpp b/common/datastorequery.cpp index 0987d68..de2d124 100644 --- a/common/datastorequery.cpp +++ b/common/datastorequery.cpp | |||
@@ -91,7 +91,7 @@ class Filter : public FilterBase { | |||
91 | public: | 91 | public: |
92 | typedef QSharedPointer<Filter> Ptr; | 92 | typedef QSharedPointer<Filter> Ptr; |
93 | 93 | ||
94 | QHash<QByteArray, Sink::Query::Comparator> propertyFilter; | 94 | QHash<QByteArray, Sink::QueryBase::Comparator> propertyFilter; |
95 | 95 | ||
96 | Filter(FilterBase::Ptr source, DataStoreQuery *store) | 96 | Filter(FilterBase::Ptr source, DataStoreQuery *store) |
97 | : FilterBase(source, store) | 97 | : FilterBase(source, store) |
@@ -146,18 +146,18 @@ public: | |||
146 | typedef QSharedPointer<Reduce> Ptr; | 146 | typedef QSharedPointer<Reduce> Ptr; |
147 | 147 | ||
148 | struct Aggregator { | 148 | struct Aggregator { |
149 | Query::Reduce::Aggregator::Operation operation; | 149 | QueryBase::Reduce::Aggregator::Operation operation; |
150 | QByteArray property; | 150 | QByteArray property; |
151 | QByteArray resultProperty; | 151 | QByteArray resultProperty; |
152 | 152 | ||
153 | Aggregator(Query::Reduce::Aggregator::Operation o, const QByteArray &property_, const QByteArray &resultProperty_) | 153 | Aggregator(QueryBase::Reduce::Aggregator::Operation o, const QByteArray &property_, const QByteArray &resultProperty_) |
154 | : operation(o), property(property_), resultProperty(resultProperty_) | 154 | : operation(o), property(property_), resultProperty(resultProperty_) |
155 | { | 155 | { |
156 | 156 | ||
157 | } | 157 | } |
158 | 158 | ||
159 | void process() { | 159 | void process() { |
160 | if (operation == Query::Reduce::Aggregator::Count) { | 160 | if (operation == QueryBase::Reduce::Aggregator::Count) { |
161 | mResult = mResult.toInt() + 1; | 161 | mResult = mResult.toInt() + 1; |
162 | } else { | 162 | } else { |
163 | Q_ASSERT(false); | 163 | Q_ASSERT(false); |
@@ -165,7 +165,7 @@ public: | |||
165 | } | 165 | } |
166 | 166 | ||
167 | void process(const QVariant &value) { | 167 | void process(const QVariant &value) { |
168 | if (operation == Query::Reduce::Aggregator::Collect) { | 168 | if (operation == QueryBase::Reduce::Aggregator::Collect) { |
169 | mResult = mResult.toList() << value; | 169 | mResult = mResult.toList() << value; |
170 | } else { | 170 | } else { |
171 | Q_ASSERT(false); | 171 | Q_ASSERT(false); |
@@ -189,10 +189,10 @@ public: | |||
189 | QSet<QByteArray> mReducedValues; | 189 | QSet<QByteArray> mReducedValues; |
190 | QByteArray mReductionProperty; | 190 | QByteArray mReductionProperty; |
191 | QByteArray mSelectionProperty; | 191 | QByteArray mSelectionProperty; |
192 | Query::Reduce::Selector::Comparator mSelectionComparator; | 192 | QueryBase::Reduce::Selector::Comparator mSelectionComparator; |
193 | QList<Aggregator> mAggregators; | 193 | QList<Aggregator> mAggregators; |
194 | 194 | ||
195 | Reduce(const QByteArray &reductionProperty, const QByteArray &selectionProperty, Query::Reduce::Selector::Comparator comparator, FilterBase::Ptr source, DataStoreQuery *store) | 195 | Reduce(const QByteArray &reductionProperty, const QByteArray &selectionProperty, QueryBase::Reduce::Selector::Comparator comparator, FilterBase::Ptr source, DataStoreQuery *store) |
196 | : FilterBase(source, store), | 196 | : FilterBase(source, store), |
197 | mReductionProperty(reductionProperty), | 197 | mReductionProperty(reductionProperty), |
198 | mSelectionProperty(selectionProperty), | 198 | mSelectionProperty(selectionProperty), |
@@ -213,8 +213,8 @@ public: | |||
213 | return QByteArray(); | 213 | return QByteArray(); |
214 | } | 214 | } |
215 | 215 | ||
216 | static bool compare(const QVariant &left, const QVariant &right, Query::Reduce::Selector::Comparator comparator) { | 216 | static bool compare(const QVariant &left, const QVariant &right, QueryBase::Reduce::Selector::Comparator comparator) { |
217 | if (comparator == Query::Reduce::Selector::Max) { | 217 | if (comparator == QueryBase::Reduce::Selector::Max) { |
218 | return left > right; | 218 | return left > right; |
219 | } | 219 | } |
220 | return false; | 220 | return false; |
@@ -302,7 +302,7 @@ public: | |||
302 | } | 302 | } |
303 | }; | 303 | }; |
304 | 304 | ||
305 | DataStoreQuery::DataStoreQuery(const Sink::Query &query, const QByteArray &type, EntityStore &store) | 305 | DataStoreQuery::DataStoreQuery(const Sink::QueryBase &query, const QByteArray &type, EntityStore &store) |
306 | : mQuery(query), mType(type), mStore(store) | 306 | : mQuery(query), mType(type), mStore(store) |
307 | { | 307 | { |
308 | setupQuery(); | 308 | setupQuery(); |
@@ -398,7 +398,7 @@ QVector<QByteArray> DataStoreQuery::indexLookup(const QByteArray &property, cons | |||
398 | /* } */ | 398 | /* } */ |
399 | /* } */ | 399 | /* } */ |
400 | 400 | ||
401 | QByteArrayList DataStoreQuery::executeSubquery(const Query &subquery) | 401 | QByteArrayList DataStoreQuery::executeSubquery(const QueryBase &subquery) |
402 | { | 402 | { |
403 | Q_ASSERT(!subquery.type().isEmpty()); | 403 | Q_ASSERT(!subquery.type().isEmpty()); |
404 | auto sub = DataStoreQuery(subquery, subquery.type(), mStore); | 404 | auto sub = DataStoreQuery(subquery, subquery.type(), mStore); |