Definition at line 220 of file qsharedpointer_impl.h.
#include <qsharedpointer_impl.h>

Classes |
|
| struct | CustomDeleter |
Public Types |
|
|
typedef ExternalRefCountWithCustomDeleter |
Self |
|
typedef ExternalRefCountWithDestroyFn |
BaseClass |
Static Public Member Functions |
|
| static void | deleter (ExternalRefCountData *self) |
| static void | safetyCheckDeleter (ExternalRefCountData *self) |
| static Self * | create (T *ptr, Deleter userDeleter) |
Public Attributes |
|
| CustomDeleter | extra |
Definition at line 222 of file qsharedpointer_impl.h.
Definition at line 223 of file qsharedpointer_impl.h.
| static void deleter | ( | ExternalRefCountData * | self | ) | [inline, static] |
Definition at line 237 of file qsharedpointer_impl.h.
{
Self *realself = static_cast<Self *>(self);
executeDeleter(realself->extra.ptr, realself->extra.deleter);
// delete the deleter too
realself->extra.~CustomDeleter();
}
| static void safetyCheckDeleter | ( | ExternalRefCountData * | self | ) | [inline, static] |
Definition at line 245 of file qsharedpointer_impl.h.
{
internalSafetyCheckRemove2(self);
deleter(self);
}
| static Self* create | ( | T * | ptr, |
| Deleter | userDeleter | ||
| ) | [inline, static] |
Definition at line 251 of file qsharedpointer_impl.h.
{
# ifdef QT_SHAREDPOINTER_TRACK_POINTERS
DestroyerFn destroy = &safetyCheckDeleter;
# else
DestroyerFn destroy = &deleter;
# endif
Self *d = static_cast<Self *>(::operator new(sizeof(Self)));
// initialize the two sub-objects
new (&d->extra) CustomDeleter(ptr, userDeleter);
new (d) BaseClass(destroy); // can't throw
return d;
}
Definition at line 232 of file qsharedpointer_impl.h.