#include "QueryCallback.h"
◆ QueryCallback() [1/4]
115{
118}
void Construct(T &t, Args &&... args)
Definition QueryCallback.cpp:23
QueryResultFuture _string
Definition QueryCallback.h:60
bool _isPrepared
Definition QueryCallback.h:64
References _isPrepared, _string, and Construct().
◆ QueryCallback() [2/4]
◆ QueryCallback() [3/4]
127{
132}
std::queue< QueryCallbackData, std::list< QueryCallbackData > > _callbacks
Definition QueryCallback.h:67
friend void MoveFrom(T *to, T &&from)
Definition QueryCallback.cpp:53
friend void ConstructActiveMember(T *obj)
Definition QueryCallback.cpp:35
References _callbacks, _isPrepared, ConstructActiveMember(), and MoveFrom().
◆ ~QueryCallback()
QueryCallback::~QueryCallback |
( |
| ) |
|
153{
155}
friend void DestroyActiveMember(T *obj)
Definition QueryCallback.cpp:44
References DestroyActiveMember.
◆ QueryCallback() [4/4]
◆ InvokeIfReady()
bool QueryCallback::InvokeIfReady |
( |
| ) |
|
187{
188 QueryCallbackData& callback =
_callbacks.front();
189 auto checkStateAndReturnCompletion = [this]()
190 {
194 {
196 return true;
197 }
198
199
200 if (!hasNext)
201 return true;
202
204 return false;
205 };
206
208 {
209 if (
_string.valid() &&
_string.wait_for(0s) == std::future_status::ready)
210 {
213 cb(*this, f.get());
214 return checkStateAndReturnCompletion();
215 }
216 }
217 else
218 {
220 {
223 cb(*this, f.get());
224 return checkStateAndReturnCompletion();
225 }
226 }
227
228 return false;
229}
std::future< PreparedQueryResult > PreparedQueryResultFuture
Definition DatabaseEnvFwd.h:46
std::future< QueryResult > QueryResultFuture
Definition DatabaseEnvFwd.h:28
std::shared_ptr< ResultSet > QueryResult
Definition DatabaseEnvFwd.h:27
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition DatabaseEnvFwd.h:45
#define ASSERT
Definition Errors.h:68
Definition QueryCallback.h:29
References _callbacks, _isPrepared, QueryCallback::QueryCallbackData::_prepared, _prepared, QueryCallback::QueryCallbackData::_string, _string, and ASSERT.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ SetNextQuery()
◆ WithCallback()
158{
160}
QueryCallback && WithChainingCallback(std::function< void(QueryCallback &, QueryResult)> &&callback)
Definition QueryCallback.cpp:167
References WithChainingCallback().
◆ WithChainingCallback()
◆ WithChainingPreparedCallback()
◆ WithPreparedCallback()
163{
165}
QueryCallback && WithChainingPreparedCallback(std::function< void(QueryCallback &, PreparedQueryResult)> &&callback)
Definition QueryCallback.cpp:174
References WithChainingPreparedCallback().
◆ ConstructActiveMember
template<typename T >
void ConstructActiveMember |
( |
T * |
obj | ) |
|
|
friend |
36{
37 if (!obj->_isPrepared)
39 else
41}
◆ DestroyActiveMember
template<typename T >
void DestroyActiveMember |
( |
T * |
obj | ) |
|
|
friend |
◆ MoveFrom
template<typename T >
void MoveFrom |
( |
T * |
to, |
|
|
T && |
from |
|
) |
| |
|
friend |
54{
55 ASSERT(to->_isPrepared == from._isPrepared);
56
57 if (!to->_isPrepared)
58 to->_string = std::move(from._string);
59 else
60 to->_prepared = std::move(from._prepared);
61}
Referenced by SetNextQuery().
◆ [union]
◆ _callbacks
◆ _isPrepared
bool QueryCallback::_isPrepared |
|
private |
◆ _prepared
◆ _string
The documentation for this class was generated from the following files: