ExternalRefCountWithCustomDeleter< T, Deleter > Struct Template Reference


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 >:
Inheritance graph
[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


Member Function Documentation

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

Member Data Documentation


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