struct KSharedPtr
|
Can be used to control the lifetime of an object that has derived
KShared. More... |
|
|
Public Methods
Can be used to control the lifetime of an object that has derived
KShared. As long a someone holds a KSharedPtr on some KShared
object it won't become deleted but is deleted once its reference
count is 0. This struct emulates C++ pointers perfectly. So just
use it like a simple C++ pointer.
KShared and KSharedPtr are preferred over QShared / QSharedPtr
since they are more safe.
Creates a null pointer.
KSharedPtr ( T* t )
| KSharedPtr |
Creates a new pointer.
Parameters:
Copies a pointer.
Parameters:
~KSharedPtr ()
| ~KSharedPtr |
Unreferences the object that this pointer points to. If it was
the last reference, the object will be deleted.
bool operator== ( const KSharedPtr& p )
| operator== |
[const]
bool operator!= ( const KSharedPtr& p )
| operator!= |
[const]
bool operator== ( const T* p )
| operator== |
[const]
bool operator!= ( const T* p )
| operator!= |
[const]
bool operator! ()
| operator! |
[const]
operator T* ()
| operator T* |
[const]
Returns the pointer.
Returns: the pointer
[const]
Returns the pointer.
Returns: the pointer
const T& operator* ()
| operator* |
[const]
T& operator* ()
| operator* |
const T* operator-> ()
| operator-> |
[const]
T* operator-> ()
| operator-> |
[const]
Returns the number of references.
Returns: the number of references
- Version: $Id: KSharedPtr.html 203394 2003-01-28 18:16:22Z ctennis $
- Author: Waldo Bastian
- Generated: caleb on tcdevel on Tue Jan 28 12:54:04 2003, using kdoc $.