50 : ref(p ? TokenRef::getRef(p) : 0)
54 : ref(other.ref ? other.ref->increment() : 0)
59 if (ref && ref->decrement())
62 TokenRefCount<T>& operator=(
Token* other)
64 TokenRef* tmp = TokenRef::getRef(other);
66 if (ref && ref->decrement())
73 TokenRefCount<T>& operator=(
const TokenRefCount<T>& other)
75 if( other.ref != ref )
77 TokenRef* tmp = other.ref ? other.ref->increment() : 0;
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; }