#include "dptr_base.h"
Go to the source code of this file.
Classes | |
class | SharedDPtr |
Base class of shared d-pointers. More... | |
Defines | |
#define | DEFINE_SHARED_DPTR(Class) |
Defines the methods of the shared d-pointer wrapper. |
#define DEFINE_SHARED_DPTR | ( | Class | ) |
Class::DPrivate::DPrivate(){d=new Class::Private;}\ Class::DPrivate::DPrivate(const DPrivate&dp){d=dp.d;d->attach();}\ Class::DPrivate::~DPrivate(){d->detach();}\ Class::DPrivate Class::DPrivate::clone()const{DPrivate r;*(r.d)=*d;return r;}\ Class::DPrivate& Class::DPrivate::operator=(const DPrivate&dp)\ {if(d!=dp.d){d->detach();d=dp.d;d->attach();}return *this;}\ void Class::DPrivate::decouple()\ {if(d->currentRefCount()>1){Private *p=new Class::Private(*d);d->detach();d=p;}}
Defines the methods of the shared d-pointer wrapper.
This implements the shared version of the d-pointer wrapper. To be used in implementation where the actual d-pointer class is implemented.
Class | the base class within which the d-pointer was declared |