2 #ifndef _SCOPED_ARRAY_CPP_
3 #define _SCOPED_ARRAY_CPP_
16 : ptr_(ptr ? new
Shim(ptr) : 0)
66 return ptr_ != 0 ? ptr_->t_ : 0;
73 return ptr_ != 0 ? ptr_->t_ : 0;
80 return ptr_ != 0 ? ptr_->t_ : 0;
87 return ptr_ != 0 ? ptr_->t_ : 0;
105 if (ptr_->refcount_ <= 0)
This template class provides transparent reference counting of its template parameter T.
Shim * ptr_
Pointer to the Shim.
void increment(void)
implementation of the increment operation
void operator=(T *ptr)
assignment operator for times when you don't want the reference increased for incoming ptr
T * get_ptr(void)
get the underlying pointer
T * get(void)
get the underlying pointer
void decrement(void)
implementation of the decrement operation
ScopedArray(void)
default Ctor
A shim class that keeps track of the reference count and a pointer to the type T that's reference cou...