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...
 
 ~SafePointeeBase ()
 Destructor. More...
 
SafePointeeBaseoperator= (const SafePointeeBase &)=delete
 Prevent derived classes from accidentally calling the assignment operator. More...
 

Protected Member Functions

 SafePointeeBase ()
 Default constructor. More...
 

Friends

class detail::SafeRemnant< T >
 

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

Member Typedef Documentation

◆ SafePointeeType

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

The type of object being pointed to.

Constructor & Destructor Documentation

◆ SafePointeeBase() [1/2]

template<class T>
regina::SafePointeeBase< T >::SafePointeeBase ( const SafePointeeBase< T > &  )
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 remnant_ to zero on the copied object.

◆ ~SafePointeeBase()

template<class T >
regina::SafePointeeBase< T >::~SafePointeeBase ( )
inline

Destructor.

Once this destructor is called, any SafePtr that points to this object will be aware that the object has expired and that the pointer cannot be dereferenced any longer.

◆ SafePointeeBase() [2/2]

template<class T >
regina::SafePointeeBase< T >::SafePointeeBase ( )
inlineprotected

Default constructor.

Member Function Documentation

◆ operator=()

template<class T>
SafePointeeBase& regina::SafePointeeBase< T >::operator= ( const SafePointeeBase< T > &  )
delete

Prevent derived classes from accidentally calling the assignment operator.


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

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