ExternalRefCountWithContiguousData< T > Struct Template Reference


Detailed Description

template<class T>
struct QtSharedPointer::ExternalRefCountWithContiguousData< T >

Definition at line 277 of file qsharedpointer_impl.h.

#include <qsharedpointer_impl.h>

Inheritance diagram for ExternalRefCountWithContiguousData< T >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef
ExternalRefCountWithDestroyFn 
Parent

Static Public Member Functions

static void  deleter (ExternalRefCountData *self)
static void  safetyCheckDeleter (ExternalRefCountData *self)
static ExternalRefCountData create (T **ptr)

Public Attributes

data

Member Typedef Documentation


Member Function Documentation

static void deleter ( ExternalRefCountData self ) [inline, static]

Definition at line 282 of file qsharedpointer_impl.h.

        {
            ExternalRefCountWithContiguousData *that =
                    static_cast<ExternalRefCountWithContiguousData *>(self);
            that->data.~T();
        }
static void safetyCheckDeleter ( ExternalRefCountData self ) [inline, static]
static ExternalRefCountData* create ( T **  ptr ) [inline, static]

Definition at line 294 of file qsharedpointer_impl.h.

        {
# ifdef QT_SHAREDPOINTER_TRACK_POINTERS
            DestroyerFn destroy = &safetyCheckDeleter;
# else
            DestroyerFn destroy = &deleter;
# endif
            ExternalRefCountWithContiguousData *d =
                static_cast<ExternalRefCountWithContiguousData *>(::operator new(sizeof(ExternalRefCountWithContiguousData)));

            // initialize the d-pointer sub-object
            // leave d->data uninitialized
            new (d) Parent(destroy); // can't throw

            *ptr = &d->data;
            return d;
        }

Member Data Documentation


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