1 #ifndef INC_ASTRefCount_hpp__
2 # define INC_ASTRefCount_hpp__
13 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
50 : ref(p ?
ASTRef::getRef(p) : 0)
54 : ref(other.ref ? other.ref->increment() : 0)
59 if (ref && ref->decrement())
66 if (ref && ref->decrement())
75 if( other.
ref != ref )
79 if (ref && ref->decrement())
87 operator T* ()
const {
return ref ?
static_cast<T*
>(ref->ptr) : 0; }
88 T*
operator->()
const {
return ref ?
static_cast<T*
>(ref->ptr) : 0; }
89 T*
get()
const {
return ref ?
static_cast<T*
>(ref->ptr) : 0; }
94 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
98 #endif //INC_ASTRefCount_hpp__