23 #ifndef _IGNITE_CACHE_QUERY_QUERY_CURSOR 24 #define _IGNITE_CACHE_QUERY_QUERY_CURSOR 28 #include <ignite/common/concurrent.h> 32 #include "ignite/impl/cache/query/query_impl.h" 33 #include "ignite/impl/operations.h" 53 template<
typename K,
typename V>
75 QueryCursor(impl::cache::query::QueryCursorImpl* impl) : impl(impl)
112 impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
115 return impl0->HasNext(err);
119 "Instance is not usable (did you check for error?).");
158 impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
161 impl::Out2Operation<K, V> outOp;
163 impl0->GetNext(outOp, err);
167 K& key = outOp.Get1();
168 V& val = outOp.Get2();
178 "Instance is not usable (did you check for error?).");
213 impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
216 impl::OutQueryGetAllOperation<K, V> outOp(res);
218 impl0->GetAll(outOp, err);
222 "Instance is not usable (did you check for error?).");
232 template<
typename OutIter>
235 impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
238 impl::OutQueryGetAllOperationIter<K, V, OutIter> outOp(iter);
240 impl0->GetAll(outOp);
245 "Instance is not usable (did you check for error?).");
262 return impl.IsValid();
267 ignite::common::concurrent::SharedPointer<impl::cache::query::QueryCursorImpl> impl;
273 #endif //_IGNITE_CACHE_QUERY_QUERY_CURSOR void GetAll(std::vector< CacheEntry< K, V > > &res, IgniteError &err)
Get all entries.
Definition: query_cursor.h:211
QueryCursor(impl::cache::query::QueryCursorImpl *impl)
Constructor.
Definition: query_cursor.h:75
bool HasNext(IgniteError &err)
Check whether next entry exists.
Definition: query_cursor.h:110
void GetAll(OutIter iter)
Get all entries.
Definition: query_cursor.h:233
int32_t GetCode() const
Get error code.
Definition: ignite_error.cpp:78
CacheEntry< K, V > GetNext(IgniteError &err)
Get next entry.
Definition: query_cursor.h:156
QueryCursor()
Default constructor.
Definition: query_cursor.h:63
Cache entry class template.
Definition: cache_entry.h:40
static const int IGNITE_SUCCESS
Success.
Definition: ignite_error.h:98
CacheEntry< K, V > GetNext()
Get next entry.
Definition: query_cursor.h:134
Declares ignite::cache::CacheEntry class.
Ignite error information.
Definition: ignite_error.h:94
bool HasNext()
Check whether next entry exists.
Definition: query_cursor.h:89
bool IsValid() const
Check if the instance is valid.
Definition: query_cursor.h:260
Apache Ignite API.
Definition: cache.h:48
Declares ignite::IgniteError class.
void GetAll(std::vector< CacheEntry< K, V > > &res)
Get all entries.
Definition: query_cursor.h:193
Query cursor class template.
Definition: query_cursor.h:54
static void ThrowIfNeeded(const IgniteError &err)
Throw an error if code is not IGNITE_SUCCESS.
Definition: ignite_error.cpp:27
static const int IGNITE_ERR_GENERIC
Generic Ignite error.
Definition: ignite_error.h:131