IMP
2.0.1
The Integrative Modeling Platform
|
#include <IMP/base/WeakPointer.h>
Public Types | |
typedef internal::PointerBase < internal::CheckedWeakPointerTraits < O > > | P |
Public Member Functions | |
template<class Any > | |
WeakPointer (const Any &o) | |
template<class OT > | |
WeakPointer< O > & | operator= (const internal::PointerBase< OT > &o) |
template<class OT > | |
WeakPointer< O > & | operator= (OT *o) |
WeakPointer< O > & | operator= (nullptr_t o) |
WeakPointer< O > & | operator= (const P &o) |
WeakPointers do not do reference counting and do not claim ownership of the pointed object. As a result, they can be used to break cycles in reference counted pointers. For example, since an IMP::Model contains a reference counted pointer to an IMP::Particle, the IMP::Particle has a WeakPointer back to the Model.
This version of a WeakPointer only works on complete types, but adds additional checks of correct usage (eg that the Object has not bee previously freed) compared to UncheckedWeakPointer.
Definition at line 74 of file base/WeakPointer.h.