- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Classes | Public Types | Static Public Member Functions | Public Attributes

# ExternalRefCountWithCustomDeleter< T, Deleter > Struct Template Reference

Search for all occurrences

## Detailed Description

### template<class T, typename Deleter>
struct QtSharedPointer::ExternalRefCountWithCustomDeleter< T, Deleter >

Definition at line 220 of file qsharedpointer_impl.h.

`#include <qsharedpointer_impl.h>`

Inheritance diagram for ExternalRefCountWithCustomDeleter< T, Deleter >:
[legend]

List of all members.

## 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

## Member Typedef Documentation

typedef ExternalRefCountWithCustomDeleter Self

Search for all occurrences

Definition at line 222 of file qsharedpointer_impl.h.

typedef ExternalRefCountWithDestroyFn BaseClass

Search for all occurrences

Definition at line 223 of file qsharedpointer_impl.h.

## Member Function Documentation

static void deleter | ( | ExternalRefCountData * | self | ) | `[inline, static]`

Search for all occurrences

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]`

Search for all occurrences

Definition at line 245 of file qsharedpointer_impl.h.

            {
                internalSafetyCheckRemove2(self);
                deleter(self);
            }

static Self* create | ( | T * | ptr,
|  | Deleter | userDeleter
| ) |  | `[inline, static]`

Search for all occurrences

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;
            }

## Member Data Documentation

CustomDeleter extra

Search for all occurrences

Definition at line 232 of file qsharedpointer_impl.h.

The documentation for this struct was generated from the following file:

- QtCore/qsharedpointer_impl.h