digikam
Digikam::DSharedDataPointer< T > Class Template Reference
#include <dshareddata.h>

Detailed Description
template<class T>
class Digikam::DSharedDataPointer< T >
Definition at line 71 of file dshareddata.h.
Public Member Functions | |
| T * | assign (T *o) |
| T * | assign (const DSharedDataPointer< T > &o) |
| T * | constCastData () const |
| const T * | constData () const |
| const T * | data () const |
| T * | data () |
| DSharedDataPointer (const DSharedDataPointer< T > &o) | |
| DSharedDataPointer (T *data) | |
| DSharedDataPointer () | |
| const T & | operator * () const |
| T & | operator * () |
| operator const T * () const | |
| operator T * () | |
| bool | operator! () const |
| bool | operator!= (const DSharedDataPointer< T > &other) const |
| const T * | operator-> () const |
| T * | operator-> () |
| DSharedDataPointer & | operator= (T *o) |
| DSharedDataPointer< T > & | operator= (const DSharedDataPointer< T > &o) |
| bool | operator== (const DSharedDataPointer< T > &other) const |
| T * | unassign () |
| ~DSharedDataPointer () | |
Constructor & Destructor Documentation
| Digikam::DSharedDataPointer< T >::DSharedDataPointer | ( | ) | [inline] |
Definition at line 106 of file dshareddata.h.
| Digikam::DSharedDataPointer< T >::DSharedDataPointer | ( | T * | data | ) | [inline, explicit] |
Definition at line 108 of file dshareddata.h.
| Digikam::DSharedDataPointer< T >::~DSharedDataPointer | ( | ) | [inline] |
Definition at line 111 of file dshareddata.h.
| Digikam::DSharedDataPointer< T >::DSharedDataPointer | ( | const DSharedDataPointer< T > & | o | ) | [inline] |
Definition at line 114 of file dshareddata.h.
Member Function Documentation
| T* Digikam::DSharedDataPointer< T >::assign | ( | T * | o | ) | [inline] |
Definition at line 153 of file dshareddata.h.
| T* Digikam::DSharedDataPointer< T >::assign | ( | const DSharedDataPointer< T > & | o | ) | [inline] |
The assign operator is like operator=, with the difference that the old pointer is not deleted if its reference count is 0, but returned.
Use this if you need to do your own deleting, if e.g. the object need to be removed from a list or a cache.
- Returns:
- A T object with reference count 0, which may be deleted; or 0 if no object need to be dropped.
Definition at line 135 of file dshareddata.h.
| T* Digikam::DSharedDataPointer< T >::constCastData | ( | ) | const [inline] |
This method carries out a const_cast, so it returns a non-const pointer from a const DSharedDataPointer.
Typically, this should only be used if you know it should be used (to implement a lazy loading caching technique or similar)
Definition at line 101 of file dshareddata.h.
| const T* Digikam::DSharedDataPointer< T >::constData | ( | ) | const [inline] |
Definition at line 94 of file dshareddata.h.
| const T* Digikam::DSharedDataPointer< T >::data | ( | ) | const [inline] |
Definition at line 93 of file dshareddata.h.
| T* Digikam::DSharedDataPointer< T >::data | ( | ) | [inline] |
Definition at line 91 of file dshareddata.h.
| const T& Digikam::DSharedDataPointer< T >::operator * | ( | ) | const [inline] |
Definition at line 86 of file dshareddata.h.
| T& Digikam::DSharedDataPointer< T >::operator * | ( | ) | [inline] |
Use this class to store pointers to a shared data object, which inherits DSharedData.
This class is inspired by QSharedDataPointer, but differs in two points:
- it provides "explicit sharing": A change to the data affects all classes keeping a pointer to the shared data. No automatic copying is done.
- no method "detach()" is provided, ackknowledging the fact that the copy constructor of class T may not be used. Various operators for accessing the pointer const and non-const
Definition at line 85 of file dshareddata.h.
| Digikam::DSharedDataPointer< T >::operator const T * | ( | ) | const [inline] |
Definition at line 90 of file dshareddata.h.
| Digikam::DSharedDataPointer< T >::operator T * | ( | ) | [inline] |
Definition at line 89 of file dshareddata.h.
| bool Digikam::DSharedDataPointer< T >::operator! | ( | ) | const [inline] |
Definition at line 179 of file dshareddata.h.
| bool Digikam::DSharedDataPointer< T >::operator!= | ( | const DSharedDataPointer< T > & | other | ) | const [inline] |
Definition at line 104 of file dshareddata.h.
| const T* Digikam::DSharedDataPointer< T >::operator-> | ( | ) | const [inline] |
Definition at line 88 of file dshareddata.h.
| T* Digikam::DSharedDataPointer< T >::operator-> | ( | ) | [inline] |
Definition at line 87 of file dshareddata.h.
| DSharedDataPointer& Digikam::DSharedDataPointer< T >::operator= | ( | T * | o | ) | [inline] |
Definition at line 121 of file dshareddata.h.
| DSharedDataPointer<T>& Digikam::DSharedDataPointer< T >::operator= | ( | const DSharedDataPointer< T > & | o | ) | [inline] |
Definition at line 116 of file dshareddata.h.
| bool Digikam::DSharedDataPointer< T >::operator== | ( | const DSharedDataPointer< T > & | other | ) | const [inline] |
Definition at line 103 of file dshareddata.h.
| T* Digikam::DSharedDataPointer< T >::unassign | ( | ) | [inline] |
Semantics like assign, but no new pointer is assigned to this.
Definition at line 174 of file dshareddata.h.
The documentation for this class was generated from the following file:
KDE 4.2 API Reference