ANTLR Support Libraries 2.7.1+
|
Go to the documentation of this file. 1 #ifndef INC_RefCount_hpp__
2 #define INC_RefCount_hpp__
12 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
23 Ref(T* p) : ptr(p), count(1) {}
34 : ref(p ? new Ref(p) : 0)
38 : ref(other.ref ? other.ref->increment() : 0)
43 if (ref && ref->decrement())
49 if (ref && ref->decrement())
57 return ref ? ref->
ptr : 0;
62 return ref ? ref->ptr : 0;
67 return ref ? ref->ptr : 0;
76 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
80 #endif //INC_RefCount_hpp__
T *const ptr
Definition: RefCount.hpp:20
Ref(T *p)
Definition: RefCount.hpp:23
struct RefCount::Ref * ref
RefCount(T *p=0)
Definition: RefCount.hpp:33
Definition: RefCount.hpp:17
Ref & operator=(const Ref &)
RefCount< T > & operator=(const RefCount< T > &other)
Definition: RefCount.hpp:46
~Ref()
Definition: RefCount.hpp:24
Ref * increment()
Definition: RefCount.hpp:25
bool decrement()
Definition: RefCount.hpp:26
T * get() const
Definition: RefCount.hpp:65
unsigned int count
Definition: RefCount.hpp:21
RefCount(const RefCount< T > &other)
Definition: RefCount.hpp:37
T * operator->() const
Definition: RefCount.hpp:60
Definition: RefCount.hpp:19
~RefCount()
Definition: RefCount.hpp:41
#define ANTLR_API
Definition: config.hpp:22
Definition: ANTLRException.hpp:15