mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Database: Add Empty and CancelAll functions to AsyncCallbackProcessor and enable callback concept check
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#ifndef DatabaseEnvFwd_h__
|
||||
#define DatabaseEnvFwd_h__
|
||||
|
||||
#include "AsyncCallbackProcessorFwd.h"
|
||||
#include <memory>
|
||||
|
||||
struct QueryResultFieldMetadata;
|
||||
@@ -45,9 +46,7 @@ class PreparedResultSet;
|
||||
using PreparedQueryResult = std::shared_ptr<PreparedResultSet>;
|
||||
|
||||
class QueryCallback;
|
||||
|
||||
template<typename T>
|
||||
class AsyncCallbackProcessor;
|
||||
bool InvokeAsyncCallbackIfReady(QueryCallback& callback);
|
||||
|
||||
using QueryCallbackProcessor = AsyncCallbackProcessor<QueryCallback>;
|
||||
|
||||
@@ -57,6 +56,7 @@ template<typename T>
|
||||
class Transaction;
|
||||
|
||||
class TransactionCallback;
|
||||
bool InvokeAsyncCallbackIfReady(TransactionCallback& callback);
|
||||
|
||||
template<typename T>
|
||||
using SQLTransaction = std::shared_ptr<Transaction<T>>;
|
||||
@@ -77,6 +77,7 @@ using LoginDatabaseQueryHolder = SQLQueryHolder<LoginDatabaseConnection>;
|
||||
using WorldDatabaseQueryHolder = SQLQueryHolder<WorldDatabaseConnection>;
|
||||
|
||||
class SQLQueryHolderCallback;
|
||||
bool InvokeAsyncCallbackIfReady(SQLQueryHolderCallback& callback);
|
||||
|
||||
// mysql
|
||||
struct MySQLHandle;
|
||||
|
||||
@@ -57,4 +57,6 @@ private:
|
||||
std::queue<QueryCallbackData, std::list<QueryCallbackData>> _callbacks;
|
||||
};
|
||||
|
||||
inline bool InvokeAsyncCallbackIfReady(QueryCallback& callback) { return callback.InvokeIfReady(); }
|
||||
|
||||
#endif // _QUERY_CALLBACK_H
|
||||
|
||||
@@ -79,4 +79,6 @@ public:
|
||||
std::function<void(SQLQueryHolderBase const&)> m_callback;
|
||||
};
|
||||
|
||||
inline bool InvokeAsyncCallbackIfReady(SQLQueryHolderCallback& callback) { return callback.InvokeIfReady(); }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -122,4 +122,6 @@ public:
|
||||
std::function<void(bool)> m_callback;
|
||||
};
|
||||
|
||||
inline bool InvokeAsyncCallbackIfReady(TransactionCallback& callback) { return callback.InvokeIfReady(); }
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user