mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 00:23:48 +00:00
feat(Core/Misc): remove ACE Auto_Ptr (#3454)
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef _ACORE_AUTO_PTR_H
|
||||
#define _ACORE_AUTO_PTR_H
|
||||
|
||||
#include <ace/Bound_Ptr.h>
|
||||
|
||||
namespace acore
|
||||
{
|
||||
|
||||
template <class Pointer, class Lock>
|
||||
class AutoPtr : public ACE_Strong_Bound_Ptr<Pointer, Lock>
|
||||
{
|
||||
typedef ACE_Strong_Bound_Ptr<Pointer, Lock> Base;
|
||||
|
||||
public:
|
||||
AutoPtr()
|
||||
: Base()
|
||||
{ }
|
||||
|
||||
AutoPtr(Pointer* x)
|
||||
: Base(x)
|
||||
{ }
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return !Base::null();
|
||||
}
|
||||
|
||||
bool operator !() const
|
||||
{
|
||||
return Base::null();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace acore
|
||||
|
||||
#endif
|
||||
@@ -262,7 +262,7 @@ void DatabaseWorkerPool<T>::DirectCommitTransaction(SQLTransaction& transaction)
|
||||
template <class T>
|
||||
void DatabaseWorkerPool<T>::ExecuteOrAppend(SQLTransaction& trans, PreparedStatement* stmt)
|
||||
{
|
||||
if (trans.null())
|
||||
if (!trans)
|
||||
Execute(stmt);
|
||||
else
|
||||
trans->Append(stmt);
|
||||
@@ -271,7 +271,7 @@ void DatabaseWorkerPool<T>::ExecuteOrAppend(SQLTransaction& trans, PreparedState
|
||||
template <class T>
|
||||
void DatabaseWorkerPool<T>::ExecuteOrAppend(SQLTransaction& trans, const char* sql)
|
||||
{
|
||||
if (trans.null())
|
||||
if (!trans)
|
||||
Execute(sql);
|
||||
else
|
||||
trans->Append(sql);
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#ifndef QUERYRESULT_H
|
||||
#define QUERYRESULT_H
|
||||
|
||||
#include "AutoPtr.h"
|
||||
#include <ace/Thread_Mutex.h>
|
||||
|
||||
#include "Errors.h"
|
||||
@@ -52,7 +51,7 @@ private:
|
||||
MYSQL_FIELD* _fields;
|
||||
};
|
||||
|
||||
typedef acore::AutoPtr<ResultSet, ACE_Thread_Mutex> QueryResult;
|
||||
typedef std::shared_ptr<ResultSet> QueryResult;
|
||||
|
||||
class PreparedResultSet
|
||||
{
|
||||
@@ -97,7 +96,7 @@ private:
|
||||
|
||||
};
|
||||
|
||||
typedef acore::AutoPtr<PreparedResultSet, ACE_Thread_Mutex> PreparedQueryResult;
|
||||
typedef std::shared_ptr<PreparedResultSet> PreparedQueryResult;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ protected:
|
||||
|
||||
private:
|
||||
bool _cleanedUp;
|
||||
|
||||
};
|
||||
typedef acore::AutoPtr<Transaction, ACE_Thread_Mutex> SQLTransaction;
|
||||
|
||||
typedef std::shared_ptr<Transaction> SQLTransaction;
|
||||
|
||||
/*! Low level class*/
|
||||
class TransactionTask : public SQLOperation
|
||||
|
||||
Reference in New Issue
Block a user