mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
44 lines
687 B
C++
44 lines
687 B
C++
/*
|
|
* 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
|