15 #ifndef _GRIDGAIN_CACHE_QUERY_CURSOR 16 #define _GRIDGAIN_CACHE_QUERY_CURSOR 20 #include <ignite/common/concurrent.h> 24 #include "gridgain/impl/cache/query/query_impl.h" 25 #include "gridgain/impl/operations.h" 36 template<
typename K,
typename V>
53 QueryCursor(impl::cache::query::QueryCursorImpl* impl) : impl(impl)
82 impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
85 return impl0->HasNext(&err);
89 "Instance is not usable (did you check for error?).");
119 impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
122 impl::Out2Operation<K, V> outOp;
124 impl0->GetNext(outOp, &err);
128 K& key = outOp.Get1();
129 V& val = outOp.Get2();
139 "Instance is not usable (did you check for error?).");
167 impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
170 impl::OutQueryGetAllOperation<K, V> outOp(&res);
172 impl0->GetAll(outOp, &err);
176 "Instance is not usable (did you check for error?).");
186 return impl.IsValid();
191 ignite::common::concurrent::SharedPointer<impl::cache::query::QueryCursorImpl> impl;
bool HasNext(GridError &err)
Check whether next entry exists.
Definition: query_cursor.h:80
static const int GG_ERR_GENERIC
Generic GridGain error.
Definition: grid_error.h:104
CacheEntry< K, V > GetNext()
Get next entry.
Definition: query_cursor.h:100
void GetAll(std::vector< CacheEntry< K, V >> &res)
Get all entries.
Definition: query_cursor.h:150
void GetAll(std::vector< CacheEntry< K, V >> &res, GridError &err)
Get all entries.
Definition: query_cursor.h:165
QueryCursor(impl::cache::query::QueryCursorImpl *impl)
Constructor.
Definition: query_cursor.h:53
Declares gridgain::GridError class.
int32_t GetCode() const
Get error code.
Definition: grid_error.cpp:74
Query cursor.
Definition: query_cursor.h:37
Declares gridgain::cache::CacheEntry class.
CacheEntry< K, V > GetNext(GridError &err)
Get next entry.
Definition: query_cursor.h:117
static const int GG_SUCCESS
Success.
Definition: grid_error.h:74
bool IsValid()
Check if the instance is valid.
Definition: query_cursor.h:184
QueryCursor()
Default constructor.
Definition: query_cursor.h:43
static void ThrowIfNeeded(GridError &err)
Throw an error if code is not GG_SUCCESS.
Definition: grid_error.cpp:22
Cache entry.
Definition: cache_entry.h:28
bool HasNext()
Check whether next entry exists.
Definition: query_cursor.h:63
GridGain API.
Definition: cache.h:35
Grid error information.
Definition: grid_error.h:70