KSharedPtr< T > Struct Template Reference
Can be used to control the lifetime of an object that has derived KShared. More...
#include <ksharedptr.h>
Inheritance diagram for KSharedPtr< T >:

| Public Member Functions | |
| KSharedPtr () | |
| KSharedPtr (T *t) | |
| KSharedPtr (const KSharedPtr &p) | |
| ~KSharedPtr () | |
| KSharedPtr< T > & | operator= (const KSharedPtr< T > &p) | 
| KSharedPtr< T > & | operator= (T *p) | 
| bool | operator== (const KSharedPtr< T > &p) const | 
| bool | operator!= (const KSharedPtr< T > &p) const | 
| bool | operator== (const T *p) const | 
| bool | operator!= (const T *p) const | 
| bool | operator! () const | 
| operator T * () const | |
| T * | data () | 
| const T * | data () const | 
| const T & | operator * () const | 
| T & | operator * () | 
| const T * | operator-> () const | 
| T * | operator-> () | 
| int | count () const | 
Detailed Description
template<class T>
 struct KSharedPtr< T >
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.
- Author:
- Waldo Bastian <bastian@kde.org>
- Version:
- Id
- ksharedptr.h,v 1.22 2003/08/20 08:01:42 coolo Exp
 
Definition at line 96 of file ksharedptr.h.
Constructor & Destructor Documentation
| 
 | |||||||||
| Creates a null pointer. 
 Definition at line 102 of file ksharedptr.h. | 
| 
 | ||||||||||
| Creates a new pointer. 
 
 Definition at line 108 of file ksharedptr.h. | 
| 
 | ||||||||||
| Copies a pointer. 
 
 Definition at line 115 of file ksharedptr.h. | 
| 
 | |||||||||
| Unreferences the object that this pointer points to. If it was the last reference, the object will be deleted. Definition at line 122 of file ksharedptr.h. | 
Member Function Documentation
| 
 | |||||||||
| Returns the pointer. 
 
 Definition at line 149 of file ksharedptr.h. | 
| 
 | |||||||||
| Returns the pointer. 
 
 Definition at line 155 of file ksharedptr.h. | 
| 
 | |||||||||
| Returns the number of references. 
 
 Definition at line 166 of file ksharedptr.h. | 
The documentation for this struct was generated from the following file:

