mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 09:03:47 +00:00
refactor(Core): rename namespaces and macros to acore (#2454)
This commit is contained in:
@@ -212,7 +212,7 @@ SQLTransaction DatabaseWorkerPool<T>::BeginTransaction()
|
||||
template <class T>
|
||||
void DatabaseWorkerPool<T>::CommitTransaction(SQLTransaction transaction)
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
//! Only analyze transaction weaknesses in Debug mode.
|
||||
//! Ideally we catch the faults in Debug mode and then correct them,
|
||||
//! so there's no need to waste these CPU cycles in Release mode.
|
||||
@@ -227,7 +227,7 @@ void DatabaseWorkerPool<T>::CommitTransaction(SQLTransaction transaction)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif // TRINITY_DEBUG
|
||||
#endif // ACORE_DEBUG
|
||||
|
||||
Enqueue(new TransactionTask(transaction));
|
||||
}
|
||||
|
||||
@@ -57,10 +57,10 @@ class DatabaseWorkerPool
|
||||
template<typename Format, typename... Args>
|
||||
void PExecute(Format&& sql, Args&&... args)
|
||||
{
|
||||
if (ACORE::IsFormatEmptyOrNull(sql))
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
return;
|
||||
|
||||
Execute(ACORE::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
Execute(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
}
|
||||
|
||||
//! Enqueues a one-way SQL operation in prepared statement format that will be executed asynchronously.
|
||||
@@ -80,10 +80,10 @@ class DatabaseWorkerPool
|
||||
template<typename Format, typename... Args>
|
||||
void DirectPExecute(Format&& sql, Args&&... args)
|
||||
{
|
||||
if (ACORE::IsFormatEmptyOrNull(sql))
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
return;
|
||||
|
||||
DirectExecute(ACORE::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
DirectExecute(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
}
|
||||
|
||||
//! Directly executes a one-way SQL operation in prepared statement format, that will block the calling thread until finished.
|
||||
@@ -103,10 +103,10 @@ class DatabaseWorkerPool
|
||||
template<typename Format, typename... Args>
|
||||
QueryResult PQuery(Format&& sql, T* conn, Args&&... args)
|
||||
{
|
||||
if (ACORE::IsFormatEmptyOrNull(sql))
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
return QueryResult(nullptr);
|
||||
|
||||
return Query(ACORE::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str(), conn);
|
||||
return Query(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str(), conn);
|
||||
}
|
||||
|
||||
//! Directly executes an SQL query in string format -with variable args- that will block the calling thread until finished.
|
||||
@@ -114,10 +114,10 @@ class DatabaseWorkerPool
|
||||
template<typename Format, typename... Args>
|
||||
QueryResult PQuery(Format&& sql, Args&&... args)
|
||||
{
|
||||
if (ACORE::IsFormatEmptyOrNull(sql))
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
return QueryResult(nullptr);
|
||||
|
||||
return Query(ACORE::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
return Query(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
}
|
||||
|
||||
//! Directly executes an SQL query in prepared format that will block the calling thread until finished.
|
||||
@@ -138,10 +138,10 @@ class DatabaseWorkerPool
|
||||
template<typename Format, typename... Args>
|
||||
QueryResultFuture AsyncPQuery(Format&& sql, Args&&... args)
|
||||
{
|
||||
if (ACORE::IsFormatEmptyOrNull(sql))
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
return QueryResult(nullptr);
|
||||
|
||||
return AsyncQuery(ACORE::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
return AsyncQuery(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
}
|
||||
|
||||
//! Enqueues a query in prepared format that will set the value of the PreparedQueryResultFuture return object as soon as the query is executed.
|
||||
|
||||
@@ -29,7 +29,7 @@ class Field
|
||||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_TINY))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetUInt8() on non-tinyint field. Using type: %s.", FieldTypeToString(data.type));
|
||||
@@ -47,7 +47,7 @@ class Field
|
||||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_TINY))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetInt8() on non-tinyint field. Using type: %s.", FieldTypeToString(data.type));
|
||||
@@ -72,7 +72,7 @@ class Field
|
||||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_SHORT) && !IsType(MYSQL_TYPE_YEAR))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetUInt16() on non-smallint field. Using type: %s.", FieldTypeToString(data.type));
|
||||
@@ -90,7 +90,7 @@ class Field
|
||||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_SHORT) && !IsType(MYSQL_TYPE_YEAR))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetInt16() on non-smallint field. Using type: %s.", FieldTypeToString(data.type));
|
||||
@@ -108,7 +108,7 @@ class Field
|
||||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_INT24) && !IsType(MYSQL_TYPE_LONG))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetUInt32() on non-(medium)int field. Using type: %s.", FieldTypeToString(data.type));
|
||||
@@ -126,7 +126,7 @@ class Field
|
||||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_INT24) && !IsType(MYSQL_TYPE_LONG))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetInt32() on non-(medium)int field. Using type: %s.", FieldTypeToString(data.type));
|
||||
@@ -144,7 +144,7 @@ class Field
|
||||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_LONGLONG) && !IsType(MYSQL_TYPE_BIT))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetUInt64() on non-bigint field. Using type: %s.", FieldTypeToString(data.type));
|
||||
@@ -162,7 +162,7 @@ class Field
|
||||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_LONGLONG) && !IsType(MYSQL_TYPE_BIT))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetInt64() on non-bigint field. Using type: %s.", FieldTypeToString(data.type));
|
||||
@@ -180,7 +180,7 @@ class Field
|
||||
if (!data.value)
|
||||
return 0.0f;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_FLOAT))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetFloat() on non-float field. Using type: %s.", FieldTypeToString(data.type));
|
||||
@@ -198,7 +198,7 @@ class Field
|
||||
if (!data.value)
|
||||
return 0.0f;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_DOUBLE))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetDouble() on non-double field. Using type: %s.", FieldTypeToString(data.type));
|
||||
@@ -216,7 +216,7 @@ class Field
|
||||
if (!data.value)
|
||||
return NULL;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (IsNumeric())
|
||||
{
|
||||
sLog->outSQLDriver("Error: GetCString() on numeric field. Using type: %s.", FieldTypeToString(data.type));
|
||||
@@ -345,7 +345,7 @@ class Field
|
||||
}
|
||||
|
||||
private:
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
static char const* FieldTypeToString(enum_field_types type)
|
||||
{
|
||||
switch (type)
|
||||
|
||||
@@ -48,7 +48,7 @@ class ResultSet
|
||||
MYSQL_FIELD* _fields;
|
||||
};
|
||||
|
||||
typedef Trinity::AutoPtr<ResultSet, ACE_Thread_Mutex> QueryResult;
|
||||
typedef acore::AutoPtr<ResultSet, ACE_Thread_Mutex> QueryResult;
|
||||
|
||||
class PreparedResultSet
|
||||
{
|
||||
@@ -93,7 +93,7 @@ class PreparedResultSet
|
||||
|
||||
};
|
||||
|
||||
typedef Trinity::AutoPtr<PreparedResultSet, ACE_Thread_Mutex> PreparedQueryResult;
|
||||
typedef acore::AutoPtr<PreparedResultSet, ACE_Thread_Mutex> PreparedQueryResult;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class Transaction
|
||||
bool _cleanedUp;
|
||||
|
||||
};
|
||||
typedef Trinity::AutoPtr<Transaction, ACE_Thread_Mutex> SQLTransaction;
|
||||
typedef acore::AutoPtr<Transaction, ACE_Thread_Mutex> SQLTransaction;
|
||||
|
||||
/*! Low level class*/
|
||||
class TransactionTask : public SQLOperation
|
||||
|
||||
Reference in New Issue
Block a user