Main Page   Modules   Namespace List   Class Hierarchy   Compound List   Namespace Members   Compound Members   Related Pages  

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

#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> WeakPtr & operator= (const boost::weak_ptr< Y > &r)
template<class Y> WeakPtr & operator= (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 dissapear.

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 Fri Aug 22 13:40:07 2003 for GNE by doxygen1.3