Regina Calculation Engine
|
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... | |
SafePointeeBase & | operator= (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 |
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.
T | the type of object being pointed to. This must derive from SafePointeeBase<T>. |
typedef T regina::SafePointeeBase< T >::SafePointeeType |
The type of object being pointed to.
|
delete |
Prevent derived classes from accidentally calling the copy constructor.
A derived class' copy constructor by default calls the protected default constructor, which it should because it sets the refCount_ to zero on the copied object.
|
inlineprotected |
Default constructor.
|
inline |
Is there one or more SafePtr currently pointing to this object?
|
delete |
Prevent derived classes from accidentally calling the assignment operator.