Regina Calculation Engine
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
regina::SafePointeeBase< T > Class Template Reference

A base class for objects of type T to be referenceable by a SafePtr. More...

#include <utilities/safepointeebase.h>

Public Types

typedef T SafePointeeType
 The type of object being pointed to. More...
 

Public Member Functions

 SafePointeeBase (const SafePointeeBase &)=delete
 Prevent derived classes from accidentally calling the copy constructor. More...
 
SafePointeeBaseoperator= (const SafePointeeBase &)=delete
 Prevent derived classes from accidentally calling the assignment operator. More...
 
bool hasSafePtr () const
 Is there one or more SafePtr currently pointing to this object? More...
 

Protected Member Functions

 SafePointeeBase ()
 Default constructor. More...
 

Friends

template<class U >
class regina::SafePtr
 

Detailed Description

template<class T>
class regina::SafePointeeBase< T >

A base class for objects of type T to be referenceable by a SafePtr.

Such objects are referred to as pointees of SafePtr.

The class T must derive from SafePointeeBase<T>, and must implement hasOwner() to indicate whether any non-SafePtr claims ownership of it. Details of ownership semantics (and in particular, the requirements for hasOwner()) are explained in the documentation for SafePtr.

The overhead introduced by subclassing from SafePointeeBase without using the features of the accompanying smart pointer SafePtr are minimal: one extra atomic integer that needs to be zeroed upon construction.

Regina's classes that derive from SafePointeeBase do so to help with python wrapping.

Template Parameters
Tthe type of object being pointed to. This must derive from SafePointeeBase<T>.
Author
Matthias Goerner

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

Copyright © 1999-2020, 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).