IMP logo

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] O The type of IMP::Object-derived object to point to
Inheritance diagram for IMP::WeakPointer< O >:

Inheritance graph
[legend]

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

Constructor & Destructor Documentation

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

initialize from a pointer


Member Function Documentation

template<class O>
O& IMP::WeakPointer< O >::operator* (  ) 

it's a pointer

template<class O>
const O& IMP::WeakPointer< O >::operator* (  )  const

it's a pointer

template<class O>
O* IMP::WeakPointer< O >::operator-> (  ) 

it's a pointer

template<class O>
const O* IMP::WeakPointer< O >::operator-> (  )  const

it's a pointer


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

Generated on Mon Mar 8 23:08:47 2010 for IMP by doxygen 1.5.8