summaryrefslogtreecommitdiffstats
path: root/common/query.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-14 13:26:21 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-15 07:12:13 +0200
commitbb70bdcd0eaf72ffc304536267a66c5de5eaf2e9 (patch)
tree659702de6c71ea8f6e15836e56fd44be625ab553 /common/query.h
parentbd64dd286ddc0c5732b9977f78dc945ac40f5b4f (diff)
downloadsink-bb70bdcd0eaf72ffc304536267a66c5de5eaf2e9.tar.gz
sink-bb70bdcd0eaf72ffc304536267a66c5de5eaf2e9.zip
Synchronous API
Diffstat (limited to 'common/query.h')
-rw-r--r--common/query.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/common/query.h b/common/query.h
index 717ed75..d2c0e2e 100644
--- a/common/query.h
+++ b/common/query.h
@@ -36,7 +36,9 @@ public:
36 enum Flag 36 enum Flag
37 { 37 {
38 /** Leave the query running and continuously update the result set. */ 38 /** Leave the query running and continuously update the result set. */
39 LiveQuery 39 LiveQuery,
40 /** Run the query synchronously. */
41 SynchronousQuery
40 }; 42 };
41 Q_DECLARE_FLAGS(Flags, Flag) 43 Q_DECLARE_FLAGS(Flags, Flag)
42 44
@@ -139,7 +141,9 @@ public:
139 141
140 static Query IdentityFilter(const ApplicationDomain::Entity &entity) 142 static Query IdentityFilter(const ApplicationDomain::Entity &entity)
141 { 143 {
142 return IdentityFilter(entity.identifier()); 144 auto query = IdentityFilter(entity.identifier());
145 query.resources << entity.resourceInstanceIdentifier();
146 return query;
143 } 147 }
144 148
145 static Query RequestedProperties(const QByteArrayList &properties) 149 static Query RequestedProperties(const QByteArrayList &properties)
@@ -191,13 +195,13 @@ public:
191 return *this; 195 return *this;
192 } 196 }
193 197
194 Query(const ApplicationDomain::Entity &value) : limit(0) 198 Query(const ApplicationDomain::Entity &value) : limit(0), liveQuery(false), synchronousQuery(false)
195 { 199 {
196 ids << value.identifier(); 200 ids << value.identifier();
197 resources << value.resourceInstanceIdentifier(); 201 resources << value.resourceInstanceIdentifier();
198 } 202 }
199 203
200 Query(Flags flags = Flags()) : limit(0) 204 Query(Flags flags = Flags()) : limit(0), liveQuery(false), synchronousQuery(false)
201 { 205 {
202 } 206 }
203 207
@@ -230,8 +234,9 @@ public:
230 QByteArrayList requestedProperties; 234 QByteArrayList requestedProperties;
231 QByteArray parentProperty; 235 QByteArray parentProperty;
232 QByteArray sortProperty; 236 QByteArray sortProperty;
233 bool liveQuery;
234 int limit; 237 int limit;
238 bool liveQuery;
239 bool synchronousQuery;
235}; 240};
236} 241}
237 242