Jive reference manual
|
Provides `safe' acces to a collectable object without preventing the deletion of that object. More...
#include <jem/base/WeakRef.h>
Public Member Functions | |
WeakRef () | |
Constructs a WeakRef that does not point to any object. More... | |
WeakRef (const Ref< T > &rhs) | |
Creates a WeakRef that points to an existing object. More... | |
WeakRef (const WeakRef &rhs) | |
Creates a copy of another WeakRef . More... | |
WeakRef & | operator= (const WeakRef &rhs) |
Copies another WeakRef . More... | |
Ref< T > | get () const |
Returns the object this WeakRef is pointing to. More... | |
void | swap (WeakRef &rhs) |
Interchanges two WeakRef objects. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
void | swap (WeakRef< T > &lhs, WeakRef< T > &rhs) |
Interchanges two WeakRef objects. More... | |
Like the template class Ref
, the class WeakRef
acts as a pointer to a collectable object of type T. Unlike a Ref
, however, a WeakRef
does not prevent the deletion of a collectable object. This means that if a collectable object can be reached only through one or more WeakRef
instances, the collectable object will eventually be deleted.
A WeakRef
is safe in the sense that it will return a NIL
Ref
instance when the collectable object no longer exists.
Ref
. jem::WeakRef< T >::WeakRef | ( | ) |
jem::WeakRef< T >::WeakRef | ( | const Ref< T > & | rhs | ) |
jem::WeakRef< T >::WeakRef | ( | const WeakRef< T > & | rhs | ) |
WeakRef& jem::WeakRef< T >::operator= | ( | const WeakRef< T > & | rhs | ) |
Ref<T> jem::WeakRef< T >::get | ( | ) | const |
void jem::WeakRef< T >::swap | ( | WeakRef< T > & | rhs | ) |