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.
[in] | O | The type of IMP::Object-derived object to point to |
Public Member Functions | |
O * | get () const |
get the raw pointer | |
operator O * () const | |
convert to the raw pointer | |
bool | operator! () const |
Return true if the pointer is not NULL. | |
O & | operator* () |
const O & | operator* () const |
O * | operator-> () |
const O * | operator-> () const |
WeakPointer< O > & | operator= (O *o) |
Set it from a possibly NULL pointer. | |
WeakPointer (O *o) | |
WeakPointer () | |
initialize to NULL |
IMP::WeakPointer< O >::WeakPointer | ( | O * | o | ) | [explicit] |
initialize from a pointer
O& IMP::WeakPointer< O >::operator* | ( | ) |
it's a pointer
const O& IMP::WeakPointer< O >::operator* | ( | ) | const |
it's a pointer
O* IMP::WeakPointer< O >::operator-> | ( | ) |
it's a pointer
const O* IMP::WeakPointer< O >::operator-> | ( | ) | const |
it's a pointer