Regina Calculation Engine
Public Member Functions | Static Public Member Functions | List of all members
regina::detail::SafeRemnant< T > Class Template Reference

A helper class for SafePtr. More...

#include <utilities/saferemnant.h>

Inheritance diagram for regina::detail::SafeRemnant< T >:

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...
 

Detailed Description

template<class T>
class regina::detail::SafeRemnant< T >

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.

Template Parameters
Tthe pointee type. This must derive from SafePointeeBase<T>.
Author
Matthias Goerner

The documentation for this class was generated from the following files:

Copyright © 1999-2016, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).