blob: 508056d4896e04a2a7bc8e5be305c2b450b54e62 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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
|