33 class counted_ptr_counter{
84 #ifndef NO_MEMBER_TEMPLATES 90 static_cast<X*>(r.get());
98 static_cast<X*>(r.
get());
104 #endif // NO_MEMBER_TEMPLATES 113 operator void*()
const{
114 return (
void*)
get();
133 template <
typename X>
class const_counted_ptr :
public counted_ptr<X>{
167 #ifndef NO_MEMBER_TEMPLATES 172 static_cast<X*>(r.get());
179 static_cast<X*>(r.get());
187 static_cast<X*>(r.get());
198 static_cast<X*>(r.
get());
204 #endif // NO_MEMBER_TEMPLATES 205 const X&
operator*()
const throw(){
return *(static_cast<X*>(this->itsCounter->ptr));}
206 const X*
operator->()
const throw(){
return static_cast<X*>(this->itsCounter->ptr);}
207 const X*
get()
const throw(){
return ((this->itsCounter) ? static_cast<X*>(this->itsCounter->ptr) : 0);}
213 #endif // COUNTED_PTR_H
const_counted_ptr(const const_counted_ptr< Y > &r)
void acquire(const counted_ptr< X > &c)
const X & operator *() const
void acquire(counted_ptr_counter *c)
const X * operator->() const
counted_ptr & operator=(const counted_ptr< Y > &r)
counted_ptr_counter(void *p=0, unsigned c=1)
counted_ptr & operator=(const counted_ptr &r)
const_counted_ptr & operator=(const const_counted_ptr< Y > &r)
const_counted_ptr(const counted_ptr< X > &other)
const_counted_ptr(X *p=0)
const_counted_ptr(const const_counted_ptr &other)
const_counted_ptr & operator=(const counted_ptr< Y > &r)
const_counted_ptr & operator=(const counted_ptr< X > &r)
void acquire(const counted_ptr< X > &other)
const_counted_ptr(const counted_ptr< Y > &r)
counted_ptr(const counted_ptr &r)
counted_ptr(const counted_ptr< Y > &r)
void acquire(counted_ptr_counter *c)
const_counted_ptr & operator=(const const_counted_ptr &r)
counted_ptr_counter * itsCounter