21template<
typename T,
typename... Args>
24 new (&t) T(std::forward<Args>(args)...);
36 if (!obj->_isPrepared)
45 if (!obj->_isPrepared)
54 ASSERT(to->_isPrepared == from._isPrepared);
57 to->_string = std::move(from._string);
59 to->_prepared = std::move(from._prepared);
97 template<
typename T>
friend void MoveFrom(T* to, T&& from);
163 return std::move(*
this);
170 return std::move(*
this);
181 auto checkStateAndReturnCompletion = [
this]()
201 if (
_string.valid() &&
_string.wait_for(std::chrono::seconds(0)) == std::future_status::ready)
206 return checkStateAndReturnCompletion();
211 if (
_prepared.valid() &&
_prepared.wait_for(std::chrono::seconds(0)) == std::future_status::ready)
216 return checkStateAndReturnCompletion();
std::future< PreparedQueryResult > PreparedQueryResultFuture
std::future< QueryResult > QueryResultFuture
std::shared_ptr< ResultSet > QueryResult
std::shared_ptr< PreparedResultSet > PreparedQueryResult
void Construct(T &t, Args &&... args)
void MoveFrom(T *to, T &&from)
void ConstructActiveMember(T *obj)
void DestroyActiveMember(T *obj)
std::queue< QueryCallbackData, std::list< QueryCallbackData > > _callbacks
QueryResultFuture _string
PreparedQueryResultFuture _prepared
friend void MoveFrom(T *to, T &&from)
QueryCallback && WithCallback(std::function< void(QueryResult)> &&callback)
QueryCallback(QueryResultFuture &&result)
QueryCallback & operator=(QueryCallback &&right) noexcept
void SetNextQuery(QueryCallback &&next)
QueryCallback && WithChainingPreparedCallback(std::function< void(QueryCallback &, PreparedQueryResult)> &&callback)
friend void DestroyActiveMember(T *obj)
QueryCallback && WithChainingCallback(std::function< void(QueryCallback &, QueryResult)> &&callback)
QueryCallback && WithPreparedCallback(std::function< void(PreparedQueryResult)> &&callback)
QueryCallbackData & operator=(QueryCallbackData &&right) noexcept
std::function< void(QueryCallback &, QueryResult)> _string
QueryCallbackData(std::function< void(QueryCallback &, QueryResult)> &&callback)
friend void MoveFrom(T *to, T &&from)
QueryCallbackData & operator=(QueryCallbackData const &)=delete
friend void ConstructActiveMember(T *obj)
QueryCallbackData(QueryCallbackData &&right) noexcept
friend void DestroyActiveMember(T *obj)
std::function< void(QueryCallback &, PreparedQueryResult)> _prepared
QueryCallbackData(QueryCallbackData const &)=delete
QueryCallbackData(std::function< void(QueryCallback &, PreparedQueryResult)> &&callback)