23 #ifndef __ccxx_SharedPtr_hxx 24 #define __ccxx_SharedPtr_hxx 50 : _object(other._object),
79 if(other._object == _object)
83 _object = other._object;
143 operator const void *()
const 144 {
return(_object ?
this : NULL); }
148 {
return(_object == NULL); }
152 {
return(_object == other._object); }
156 {
return(!
operator==(other)); }
160 {
return(_object ? _refs->
get() : 0); }
168 : _object(dynamic_cast<T *>(other._object))
181 : _object(static_cast<T *>(other._object)),
202 #endif // __ccxx_SharedPtr_hxx ~SharedPtr()
Destructor.
Definition: SharedPtr.h++:57
int getRefCount() const
Get the reference count for this pointer.
Definition: SharedPtr.h++:159
T & operator*()
Dereference operator.
Definition: SharedPtr.h++:115
A threadsafe, reference-counting smart pointer.
Definition: SharedPtr.h++:39
const T * operator->() const
Pointer-to-member operator.
Definition: SharedPtr.h++:107
bool operator!() const
Test if the pointer is NULL.
Definition: SharedPtr.h++:139
An exception indicating an attempt to dereference a null pointer.
Definition: NullPointerException.h++:37
int32_t get() const
Get the current value of the counter.
Definition: AtomicCounter.c++:139
friend class SharedPtr
Definition: SharedPtr.h++:164
SharedPtr(const SharedPtr &other)
Copy constructor.
Definition: SharedPtr.h++:49
SharedPtr & operator=(const SharedPtr &other)
Assignment operator.
Definition: SharedPtr.h++:77
bool isNull() const
Test if the pointer is NULL.
Definition: SharedPtr.h++:147
T * operator->()
Pointer-to-member operator.
Definition: SharedPtr.h++:103
An integer counter whose value is modified in an atomic fashion.
Definition: AtomicCounter.h++:36
bool operator==(const SharedPtr &other) const
Equality operator.
Definition: SharedPtr.h++:151
SharedPtr< U > staticCast()
Static cast.
Definition: SharedPtr.h++:66
const T & operator*() const
Dereference operator.
Definition: SharedPtr.h++:127
Definition: AllocationMap.c++:25
SharedPtr< U > dynamicCast()
Dynamic cast.
Definition: SharedPtr.h++:73
bool operator!=(const SharedPtr &other) const
Inequality operator.
Definition: SharedPtr.h++:155
SharedPtr(T *object=NULL)
Construct a new SharedPtr for the given object pointer.
Definition: SharedPtr.h++:44
SharedPtr & operator=(T *object)
Assignment operator.
Definition: SharedPtr.h++:90