Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

KSharedPtr< T > Struct Template Reference

#include </home/clem/local/src/opie/noncore/apps/tinykate/libkate/microkde/ksharedptr.h>

Inheritance diagram for KSharedPtr< T >:

Inheritance graph
[legend]
Collaboration diagram for KSharedPtr< T >:

Collaboration graph
[legend]
List of all members.

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

Private Attributes

T * ptr

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.1 2002/11/10 21:10:14 jowenn Exp

Definition at line 96 of file ksharedptr.h.


Constructor & Destructor Documentation

template<class T>
KSharedPtr< T >::KSharedPtr  )  [inline]
 

Definition at line 99 of file ksharedptr.h.

template<class T>
KSharedPtr< T >::KSharedPtr T *  t  )  [inline]
 

Definition at line 101 of file ksharedptr.h.

template<class T>
KSharedPtr< T >::KSharedPtr const KSharedPtr< T > &  p  )  [inline]
 

Definition at line 103 of file ksharedptr.h.

template<class T>
KSharedPtr< T >::~KSharedPtr  )  [inline]
 

Definition at line 106 of file ksharedptr.h.


Member Function Documentation

template<class T>
int KSharedPtr< T >::count  )  const [inline]
 

Definition at line 137 of file ksharedptr.h.

template<class T>
const T* KSharedPtr< T >::data  )  const [inline]
 

Definition at line 130 of file ksharedptr.h.

template<class T>
T* KSharedPtr< T >::data  )  [inline]
 

Definition at line 129 of file ksharedptr.h.

Referenced by TextLine::unWrap().

template<class T>
T& KSharedPtr< T >::operator *  )  [inline]
 

Definition at line 133 of file ksharedptr.h.

template<class T>
const T& KSharedPtr< T >::operator *  )  const [inline]
 

Definition at line 132 of file ksharedptr.h.

template<class T>
KSharedPtr< T >::operator T *  )  const [inline]
 

Definition at line 127 of file ksharedptr.h.

template<class T>
bool KSharedPtr< T >::operator!  )  const [inline]
 

Definition at line 126 of file ksharedptr.h.

template<class T>
bool KSharedPtr< T >::operator!= const T *  p  )  const [inline]
 

Definition at line 125 of file ksharedptr.h.

template<class T>
bool KSharedPtr< T >::operator!= const KSharedPtr< T > &  p  )  const [inline]
 

Definition at line 123 of file ksharedptr.h.

template<class T>
T* KSharedPtr< T >::operator->  )  [inline]
 

Definition at line 135 of file ksharedptr.h.

template<class T>
const T* KSharedPtr< T >::operator->  )  const [inline]
 

Definition at line 134 of file ksharedptr.h.

template<class T>
KSharedPtr<T>& KSharedPtr< T >::operator= T *  p  )  [inline]
 

Definition at line 115 of file ksharedptr.h.

template<class T>
KSharedPtr<T>& KSharedPtr< T >::operator= const KSharedPtr< T > &  p  )  [inline]
 

Definition at line 108 of file ksharedptr.h.

template<class T>
bool KSharedPtr< T >::operator== const T *  p  )  const [inline]
 

Definition at line 124 of file ksharedptr.h.

template<class T>
bool KSharedPtr< T >::operator== const KSharedPtr< T > &  p  )  const [inline]
 

Definition at line 122 of file ksharedptr.h.


Member Data Documentation

template<class T>
T* KSharedPtr< T >::ptr [private]
 

Definition at line 139 of file ksharedptr.h.

Referenced by KSharedPtr< TextLine >::count(), KSharedPtr< TextLine >::data(), KSharedPtr< TextLine >::KSharedPtr(), KSharedPtr< TextLine >::operator *(), KSharedPtr< TextLine >::operator T *(), KSharedPtr< TextLine >::operator!(), KSharedPtr< TextLine >::operator!=(), KSharedPtr< TextLine >::operator->(), KSharedPtr< TextLine >::operator=(), KSharedPtr< TextLine >::operator==(), and KSharedPtr< TextLine >::~KSharedPtr().


The documentation for this struct was generated from the following file:
Generated on Sat Nov 5 17:38:07 2005 for OPIE by  doxygen 1.4.2