mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
refactor(Core): apply clang-tidy modernize-use-equals-default (#3834)
This commit is contained in:
@@ -39,7 +39,7 @@ namespace VMAP
|
||||
public:
|
||||
IVMapManager() : iEnableLineOfSightCalc(true), iEnableHeightCalc(true) { }
|
||||
|
||||
virtual ~IVMapManager() { }
|
||||
virtual ~IVMapManager() = default;
|
||||
|
||||
virtual int loadMap(const char* pBasePath, unsigned int pMapId, int x, int y) = 0;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
/* Activity state */
|
||||
DatabaseWorkerPool();
|
||||
|
||||
~DatabaseWorkerPool() { }
|
||||
~DatabaseWorkerPool() = default;
|
||||
|
||||
bool Open(const std::string& infoString, uint8 async_threads, uint8 synch_threads);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ enum ConnectionFlags
|
||||
|
||||
struct MySQLConnectionInfo
|
||||
{
|
||||
MySQLConnectionInfo() { }
|
||||
MySQLConnectionInfo() = default;
|
||||
MySQLConnectionInfo(const std::string& infoString)
|
||||
{
|
||||
Tokenizer tokens(infoString, ';');
|
||||
|
||||
@@ -16,7 +16,7 @@ private:
|
||||
typedef std::pair<SQLElementData, SQLResultSetUnion> SQLResultPair;
|
||||
std::vector<SQLResultPair> m_queries;
|
||||
public:
|
||||
SQLQueryHolder() { }
|
||||
SQLQueryHolder() = default;
|
||||
~SQLQueryHolder();
|
||||
bool SetQuery(size_t index, const char* sql);
|
||||
bool SetPQuery(size_t index, const char* format, ...) ATTR_PRINTF(3, 4);
|
||||
|
||||
@@ -49,7 +49,7 @@ class TransactionTask : public SQLOperation
|
||||
|
||||
public:
|
||||
TransactionTask(SQLTransaction trans) : m_trans(trans) { } ;
|
||||
~TransactionTask() override { };
|
||||
~TransactionTask() override = default;
|
||||
|
||||
protected:
|
||||
bool Execute() override;
|
||||
|
||||
@@ -15,7 +15,7 @@ template <class TO, class FROM> class RefManager : public LinkedListHead
|
||||
{
|
||||
public:
|
||||
typedef LinkedListHead::Iterator< Reference<TO, FROM>> iterator;
|
||||
RefManager() { }
|
||||
RefManager() = default;
|
||||
virtual ~RefManager() { clearReferences(); }
|
||||
|
||||
Reference<TO, FROM>* getFirst() { return ((Reference<TO, FROM>*) LinkedListHead::getFirst()); }
|
||||
|
||||
@@ -28,7 +28,7 @@ protected:
|
||||
virtual void sourceObjectDestroyLink() = 0;
|
||||
public:
|
||||
Reference() { iRefTo = nullptr; iRefFrom = nullptr; }
|
||||
virtual ~Reference() { }
|
||||
virtual ~Reference() = default;
|
||||
|
||||
// Create new link
|
||||
void link(TO* toObj, FROM* fromObj)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
class ByteBufferException : public std::exception
|
||||
{
|
||||
public:
|
||||
~ByteBufferException() noexcept override { }
|
||||
~ByteBufferException() noexcept override = default;
|
||||
|
||||
[[nodiscard]] char const* what() const noexcept override { return msg_.c_str(); }
|
||||
|
||||
@@ -37,15 +37,14 @@ class ByteBufferPositionException : public ByteBufferException
|
||||
{
|
||||
public:
|
||||
ByteBufferPositionException(bool add, size_t pos, size_t size, size_t valueSize);
|
||||
~ByteBufferPositionException() noexcept override { }
|
||||
~ByteBufferPositionException() noexcept override = default;
|
||||
};
|
||||
|
||||
class ByteBufferSourceException : public ByteBufferException
|
||||
{
|
||||
public:
|
||||
ByteBufferSourceException(size_t pos, size_t size, size_t valueSize);
|
||||
|
||||
~ByteBufferSourceException() noexcept override { }
|
||||
~ByteBufferSourceException() noexcept override = default;
|
||||
};
|
||||
|
||||
class ByteBuffer
|
||||
|
||||
@@ -36,9 +36,7 @@ namespace ACE_Based
|
||||
}
|
||||
|
||||
//! Destroy a LockedQueue.
|
||||
virtual ~LockedQueue()
|
||||
{
|
||||
}
|
||||
virtual ~LockedQueue() = default;
|
||||
|
||||
//! Adds an item to the queue.
|
||||
void add(const T& item)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace acore
|
||||
class Runnable
|
||||
{
|
||||
public:
|
||||
virtual ~Runnable() {}
|
||||
virtual ~Runnable() = default;
|
||||
virtual void run() = 0;
|
||||
|
||||
void incReference() { ++m_refs; }
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
m_addTime = 0;
|
||||
m_execTime = 0;
|
||||
}
|
||||
virtual ~BasicEvent() { } // override destructor to perform some actions on event removal
|
||||
virtual ~BasicEvent() = default; // override destructor to perform some actions on event removal
|
||||
|
||||
// this method executes when the event is triggered
|
||||
// return false if event does not want to be deleted
|
||||
|
||||
@@ -188,7 +188,7 @@ AuthSocket::AuthSocket(RealmSocket& socket) :
|
||||
}
|
||||
|
||||
// Close patch file descriptor before leaving
|
||||
AuthSocket::~AuthSocket() { }
|
||||
AuthSocket::~AuthSocket() = default;
|
||||
|
||||
// Accept the connection
|
||||
void AuthSocket::OnAccept()
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
class RealmAcceptor : public ACE_Acceptor<RealmSocket, ACE_SOCK_Acceptor>
|
||||
{
|
||||
public:
|
||||
RealmAcceptor() { }
|
||||
RealmAcceptor() = default;
|
||||
virtual ~RealmAcceptor()
|
||||
{
|
||||
if (reactor())
|
||||
|
||||
@@ -295,8 +295,8 @@ private:
|
||||
|
||||
class AchievementGlobalMgr
|
||||
{
|
||||
AchievementGlobalMgr() {}
|
||||
~AchievementGlobalMgr() {}
|
||||
AchievementGlobalMgr() = default;
|
||||
~AchievementGlobalMgr() = default;
|
||||
|
||||
public:
|
||||
static AchievementGlobalMgr* instance();
|
||||
|
||||
@@ -246,7 +246,7 @@ struct BattlegroundScore
|
||||
DamageDone(0), HealingDone(0), player(player)
|
||||
{ }
|
||||
|
||||
virtual ~BattlegroundScore() { } //virtual destructor is used when deleting score from scores map
|
||||
virtual ~BattlegroundScore() = default; //virtual destructor is used when deleting score from scores map
|
||||
|
||||
uint32 KillingBlows;
|
||||
uint32 Deaths;
|
||||
|
||||
@@ -29,7 +29,7 @@ class TempSummon : public Creature
|
||||
{
|
||||
public:
|
||||
explicit TempSummon(SummonPropertiesEntry const* properties, uint64 owner, bool isWorldObject);
|
||||
~TempSummon() override {}
|
||||
~TempSummon() override = default;
|
||||
void Update(uint32 time) override;
|
||||
virtual void InitStats(uint32 lifetime);
|
||||
virtual void InitSummon();
|
||||
|
||||
@@ -958,7 +958,7 @@ class PlayerTaxi
|
||||
{
|
||||
public:
|
||||
PlayerTaxi();
|
||||
~PlayerTaxi() {}
|
||||
~PlayerTaxi() = default;
|
||||
// Nodes
|
||||
void InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint8 level);
|
||||
void LoadTaxiMask(std::string const& data);
|
||||
|
||||
@@ -1077,7 +1077,7 @@ typedef std::unordered_map<uint32 /*category*/, GlobalCooldown> GlobalCooldownLi
|
||||
class GlobalCooldownMgr // Shared by Player and CharmInfo
|
||||
{
|
||||
public:
|
||||
GlobalCooldownMgr() {}
|
||||
GlobalCooldownMgr() = default;
|
||||
|
||||
public:
|
||||
bool HasGlobalCooldown(SpellInfo const* spellInfo) const;
|
||||
@@ -1303,7 +1303,7 @@ struct SpellProcEventEntry; // used only private
|
||||
class MMapTargetData
|
||||
{
|
||||
public:
|
||||
MMapTargetData() {}
|
||||
MMapTargetData() = default;
|
||||
MMapTargetData(uint32 endTime, const Position* o, const Position* t)
|
||||
{
|
||||
_endTime = endTime;
|
||||
|
||||
@@ -95,8 +95,8 @@ typedef std::map<int8, VehicleSeat> SeatMap;
|
||||
class TransportBase
|
||||
{
|
||||
protected:
|
||||
TransportBase() { }
|
||||
virtual ~TransportBase() { }
|
||||
TransportBase() = default;
|
||||
virtual ~TransportBase() = default;
|
||||
|
||||
public:
|
||||
/// This method transforms supplied transport offsets into global coordinates
|
||||
|
||||
@@ -83,7 +83,7 @@ class GameEventMgr
|
||||
{
|
||||
private:
|
||||
GameEventMgr();
|
||||
~GameEventMgr() {};
|
||||
~GameEventMgr() = default;;
|
||||
|
||||
public:
|
||||
static GameEventMgr* instance();
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
private:
|
||||
|
||||
//Non instanceable only static
|
||||
HashMapHolder() {}
|
||||
HashMapHolder() = default;
|
||||
|
||||
static LockType i_lock;
|
||||
static MapType m_objectMap;
|
||||
|
||||
@@ -17,7 +17,7 @@ class WorldObject;
|
||||
|
||||
struct CellArea
|
||||
{
|
||||
CellArea() {}
|
||||
CellArea() = default;
|
||||
CellArea(CellCoord low, CellCoord high) : low_bound(low), high_bound(high) {}
|
||||
|
||||
bool operator!() const { return low_bound == high_bound; }
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
/** destructor to clean up its resources. This includes unloading the
|
||||
grid if it has not been unload.
|
||||
*/
|
||||
~Grid() {}
|
||||
~Grid() = default;
|
||||
|
||||
/** an object of interested enters the grid
|
||||
*/
|
||||
|
||||
@@ -159,7 +159,7 @@ struct LootItem
|
||||
// Should be called for non-reference LootStoreItem entries only (reference = 0)
|
||||
explicit LootItem(LootStoreItem const& li);
|
||||
|
||||
LootItem() {}
|
||||
LootItem() = default;
|
||||
|
||||
// Basic checks for player/item compatibility - if false no chance to see the item in the loot
|
||||
bool AllowedForPlayer(Player const* player) const;
|
||||
@@ -233,7 +233,7 @@ class LootTemplate
|
||||
typedef std::vector<LootGroup*> LootGroups;
|
||||
|
||||
public:
|
||||
LootTemplate() { }
|
||||
LootTemplate() = default;
|
||||
~LootTemplate();
|
||||
|
||||
// Adds an entry to the group (at loading stage)
|
||||
@@ -268,7 +268,7 @@ private:
|
||||
class LootValidatorRef : public Reference<Loot, LootValidatorRef>
|
||||
{
|
||||
public:
|
||||
LootValidatorRef() {}
|
||||
LootValidatorRef() = default;
|
||||
void targetObjectDestroyLink() override {}
|
||||
void sourceObjectDestroyLink() override {}
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Movement
|
||||
|
||||
FacingInfo(float o) : angle(o) {}
|
||||
FacingInfo(uint64 t) : target(t) {}
|
||||
FacingInfo() {}
|
||||
FacingInfo() = default;
|
||||
};
|
||||
|
||||
struct MoveSplineInitArgs
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace Movement
|
||||
[[nodiscard]] index_type computeIndexInBounds(length_type length) const;
|
||||
public:
|
||||
|
||||
explicit Spline() {}
|
||||
explicit Spline() = default;
|
||||
|
||||
/** Calculates the position for given t
|
||||
@param t - percent of spline's length, assumes that t in range [0, 1]. */
|
||||
|
||||
@@ -164,9 +164,7 @@ protected:
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~ScriptObject()
|
||||
{
|
||||
}
|
||||
virtual ~ScriptObject() = default;
|
||||
|
||||
private:
|
||||
|
||||
@@ -177,9 +175,7 @@ template<class TObject> class UpdatableScript
|
||||
{
|
||||
protected:
|
||||
|
||||
UpdatableScript()
|
||||
{
|
||||
}
|
||||
UpdatableScript() = default;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ class PacketFilter
|
||||
{
|
||||
public:
|
||||
explicit PacketFilter(WorldSession* pSession) : m_pSession(pSession) {}
|
||||
virtual ~PacketFilter() {}
|
||||
virtual ~PacketFilter() = default;
|
||||
|
||||
virtual bool Process(WorldPacket* /*packet*/) { return true; }
|
||||
[[nodiscard]] virtual bool ProcessLogout() const { return true; }
|
||||
@@ -133,7 +133,7 @@ class MapSessionFilter : public PacketFilter
|
||||
{
|
||||
public:
|
||||
explicit MapSessionFilter(WorldSession* pSession) : PacketFilter(pSession) {}
|
||||
~MapSessionFilter() override {}
|
||||
~MapSessionFilter() override = default;
|
||||
|
||||
bool Process(WorldPacket* packet) override;
|
||||
//in Map::Update() we do not process player logout!
|
||||
@@ -146,7 +146,7 @@ class WorldSessionFilter : public PacketFilter
|
||||
{
|
||||
public:
|
||||
explicit WorldSessionFilter(WorldSession* pSession) : PacketFilter(pSession) {}
|
||||
~WorldSessionFilter() override {}
|
||||
~WorldSessionFilter() override = default;
|
||||
|
||||
bool Process(WorldPacket* packet) override;
|
||||
};
|
||||
@@ -181,7 +181,7 @@ protected:
|
||||
uint8 CharCount;
|
||||
|
||||
private:
|
||||
virtual ~CharacterCreateInfo() {};
|
||||
virtual ~CharacterCreateInfo() = default;;
|
||||
};
|
||||
|
||||
struct PacketCounter
|
||||
|
||||
@@ -55,7 +55,7 @@ class Weather
|
||||
public:
|
||||
|
||||
Weather(uint32 zone, WeatherData const* weatherChances);
|
||||
~Weather() { };
|
||||
~Weather() = default;;
|
||||
|
||||
bool Update(uint32 diff);
|
||||
bool ReGenerate();
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
#include "RealmSocket.h"
|
||||
#include "Log.h"
|
||||
|
||||
RealmSocket::Session::Session() { }
|
||||
|
||||
RealmSocket::Session::~Session() { }
|
||||
RealmSocket::Session::Session() = default;
|
||||
|
||||
RealmSocket::Session::~Session() = default;
|
||||
|
||||
RealmSocket::RealmSocket() :
|
||||
input_buffer_(4096), session_(nullptr),
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
typedef std::map<std::string, Realm> RealmMap;
|
||||
|
||||
RealmList();
|
||||
~RealmList() { }
|
||||
~RealmList() = default;
|
||||
|
||||
static RealmList* instance();
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@ public:
|
||||
public:
|
||||
Exception(const std::string& message): message(message)
|
||||
{ }
|
||||
virtual ~Exception()
|
||||
{ }
|
||||
virtual ~Exception() = default;
|
||||
const std::string& getMessage() {return message;}
|
||||
private:
|
||||
std::string message;
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace MMAP
|
||||
MapTiles() : m_mapId(uint32(-1)), m_tiles(nullptr) {}
|
||||
|
||||
MapTiles(uint32 id, std::set<uint32>* tiles) : m_mapId(id), m_tiles(tiles) {}
|
||||
~MapTiles() {}
|
||||
~MapTiles() = default;
|
||||
|
||||
uint32 m_mapId;
|
||||
std::set<uint32>* m_tiles;
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace MMAP
|
||||
char const* MAP_VERSION_MAGIC = "v1.8";
|
||||
|
||||
TerrainBuilder::TerrainBuilder(bool skipLiquid) : m_skipLiquid (skipLiquid) { }
|
||||
TerrainBuilder::~TerrainBuilder() { }
|
||||
TerrainBuilder::~TerrainBuilder() = default;
|
||||
|
||||
/**************************************************************************/
|
||||
void TerrainBuilder::getLoopVars(Spot portion, int& loopStart, int& loopEnd, int& loopInc)
|
||||
|
||||
@@ -27,8 +27,7 @@ public:
|
||||
public:
|
||||
Exception(const std::string& message): message(message)
|
||||
{ }
|
||||
virtual ~Exception()
|
||||
{ }
|
||||
virtual ~Exception() = default;
|
||||
const std::string& getMessage() {return message;}
|
||||
private:
|
||||
std::string message;
|
||||
|
||||
Reference in New Issue
Block a user