#include <smartptr.h>
Collaboration diagram for SmartPtr:
Public Methods | |
SmartPtr () | |
build Smart-NULL-Ptr. More... | |
SmartPtr (T *p) | |
build normal SmartPtr. More... | |
~SmartPtr () | |
destroy SmartPtr. More... | |
SmartPtr (const SmartPtr< T > &other) | |
SmartPtr< T > & | operator= (const SmartPtr< T > &other) |
T * | operator-> () |
const T * | operator-> () const |
T & | operator * () |
const T & | operator * () const |
bool | Null () const |
void | SetNull () |
SmartPtr< T > | deep_copy () const |
bool | sameObject (const SmartPtr< T > &other) const |
Private Methods | |
void | Unbind () |
Private Attributes | |
Counted< T > * | object |
Definition at line 67 of file smartptr.h.
|
build Smart-NULL-Ptr.
Definition at line 77 of file smartptr.h. |
|
build normal SmartPtr. By passing an object to a SmartPtr you loose the responsibility for the object. That means : Never free an object which was passed to a SmartPtr! The object will be destroyed, when the last SmartPtr (pointing to that object) gets destroyed.
Definition at line 87 of file smartptr.h. |
|
destroy SmartPtr. object will not be destroyed as long as any other SmartPtr points to it Definition at line 96 of file smartptr.h. |
|
Definition at line 98 of file smartptr.h. |
|
Definition at line 71 of file smartptr.h. Referenced by SmartPtr::operator=(), SmartPtr::SetNull(), and SmartPtr::~SmartPtr(). |
|
Definition at line 102 of file smartptr.h. |
|
Definition at line 109 of file smartptr.h. |
|
Definition at line 110 of file smartptr.h. |
|
Definition at line 112 of file smartptr.h. |
|
Definition at line 113 of file smartptr.h. |
|
test if SmartPtr is 0 Definition at line 116 of file smartptr.h. |
|
set SmartPtr to 0 Definition at line 119 of file smartptr.h. |
|
create a deep copy of the object pointed to by the smart pointer. Afterwards there exist two equal copies of the object.
Definition at line 127 of file smartptr.h. |
|
test if two SmartPtrs point to the same object (this is used for operators == and !=). if you like to compare the objects themselves use (*smart_ptr1 == *smart_ptr2)
Definition at line 137 of file smartptr.h. Referenced by rs::operator!=(), and rs::operator==(). |
|
Definition at line 69 of file smartptr.h. Referenced by SmartPtr::operator=(), SmartPtr::sameObject(), and SmartPtr::SmartPtr(). |
Contact me in case of errors or questions. This documentation is powered by ![]() |
(C) 2000-2002 ![]() |