Classes | Defines

dptr.h File Reference

#include "dptr_base.h"

Go to the source code of this file.

Classes

class  DPtr
 Base class of non-shared d-pointers. More...

Defines

#define DEFINE_DPTR(Class)
 Creates definitions for methods of the non-shared d-pointer wrapper.

Define Documentation

#define DEFINE_DPTR (   Class  ) 
Value:
Class::DPrivate::DPrivate(){d=new Class::Private;}\
 Class::DPrivate::DPrivate(const Class::DPrivate&dp){d=new Class::Private(*(dp.d));}\
 Class::DPrivate::~DPrivate(){delete d;}\
 Class::DPrivate Class::DPrivate::clone()const{DPrivate r;*(r.d)=*d;return r;}\
 Class::DPrivate& Class::DPrivate::operator=(const Class::DPrivate&dp)\
 {if(d!=dp.d)*d=*(dp.d);return *this;}

Creates definitions for methods of the non-shared d-pointer wrapper.

This variant is not shared between instances of the containing class, but it is able to copy its content (using the contents copy constructor and assignment operator). You cannot use this variant if any of the content classes have inaccessable copy constructors or assignment operators (like Qt's QObject and its subclasses).

To be used in implementation where the actual d-pointer class is implemented.

Parameters:
Class the base class within which the d-pointer was declared
 All Classes Files Functions Variables Defines