IMP logo
Public Member Functions

IMP::WeakPointer< O > Class Template Reference


Detailed Description

template<class O>
class IMP::WeakPointer< O >

A weak pointer to an IMP::Object or IMP::RefCountedObject.

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.

Parameters:
[in]OThe type of IMP::Object-derived object to point to
Inheritance diagram for IMP::WeakPointer< O >:

Public Member Functions

 WeakPointer ()
 initialize to NULL
 WeakPointer (O *o)
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.
const O & operator* () const
O & operator* ()
O * operator-> ()
O * operator-> () const
WeakPointer< O > & operator= (O *o)
 Set it from a possibly NULL pointer.

Constructor & Destructor Documentation

template<class O>
IMP::WeakPointer< O >::WeakPointer ( O *  o) [explicit]

initialize from a pointer


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

Generated on Thu Mar 24 2011 02:01:44 for IMP by doxygen 1.7.3