#include <Pt/SmartPtr.h>
Non-intrusive reference counting for SmartPtr. More...
Inherited by SmartPtr< T, OwnershipPolicy, DestroyPolicy >.
Public Member Functions | |
| int | refs () const |
| Returns the refcount. | |
Protected Member Functions | |
| ExternalRefCounted () | |
| Default constructor. | |
| bool | unlink (T *object) |
| unlink a smart pointer from a managed object | |
| void | link (const ExternalRefCounted &ptr, T *object) |
| link a smart pointer to a managed object | |
Non-intrusive reference couting means that the reference count is not part of the managed heap object but part of the policy. Linking and unlinking will increase and decrease the policies counter and delete the managed object if it reaches zero. A small amount of memory needs to be allocated for the counter variable.