GNE::WeakPtr< T > Class Template Reference
[Mid-Level API]

The WeakPtr class is a weak pointer to an object managed by SmartPtr. More...

#include <WeakPtr.h>

List of all members.

Public Member Functions

template<class Y>
 WeakPtr (const boost::shared_ptr< Y > &o)
template<class Y>
 WeakPtr (const boost::weak_ptr< T > &o)
template<class Y>
WeakPtroperator= (const boost::weak_ptr< Y > &r)
template<class Y>
WeakPtroperator= (const boost::shared_ptr< Y > &r)


Detailed Description

template<class T>
class GNE::WeakPtr< T >

The WeakPtr class is a weak pointer to an object managed by SmartPtr.

Weak pointers do not prevent the objects they refer to from being destroyed when all strong pointers disappear.

You cannot access the object directly through the weak pointer. You have to construct a strong pointer (SmartPtr) in order to use the object. If the object pointed to has been destructed, then the created strong pointer will be empty ("null"). You can do this through the lock method.

For now the implementation of WeakPtr is based on boost::weak_ptr. You can see details at http://www.boost.org/libs/smart_ptr/shared_ptr.htm This class is CopyConstructable and Assignable so it can be used in the standard container objects (such as std::vector).

See the expointers example for usage of weak_ptr.


The documentation for this class was generated from the following file:
Generated on Tue Sep 5 23:47:51 2006 for GNE by  doxygen 1.4.7