mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-31 09:33:47 +00:00
Project restructuring [PART.2]
This commit is contained in:
43
modules/worldengine/nucleus/src/AutoPtr.h
Normal file
43
modules/worldengine/nucleus/src/AutoPtr.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (C)
|
||||
*
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef _TRINITY_AUTO_PTR_H
|
||||
#define _TRINITY_AUTO_PTR_H
|
||||
|
||||
#include <ace/Bound_Ptr.h>
|
||||
|
||||
namespace Trinity
|
||||
{
|
||||
|
||||
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 Trinity
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user