Regina Calculation Engine
|
A helper class for SafePtr. More...
#include <utilities/saferemnant.h>
Public Member Functions | |
~SafeRemnant () | |
Destroys this remnant. More... | |
T * | get () const |
Dereference this remnant. More... | |
void | expire () |
Expire the remnant so that it can no longer be dereferenced. More... | |
Static Public Member Functions | |
static SafeRemnant< T > * | getOrCreate (T *object) |
Given an object deriving from SafePointeeBase, find or create the remnant corresponding to the object. More... | |
A helper class for SafePtr.
The dereferencing of a SafePtr is indirected through this class, i.e., SafePtr is pointing to this class, which is pointing to the pointee. The pointee in turn derives from SafePointeeBase.
Each remnant is associated with at most one pointee, and each pointee is associated with at most one remnant. However, both relationships are optional:
The lifetime of a remnant is tied to the existence of SafePtr objects that point to it (through reference counting), not to that of the corresponding pointee.
T | the pointee type. This must derive from SafePointeeBase<T>. |