cartobase  4.5.0
carto::WeakObject Class Reference

Base class for weakly referenced objects. More...

#include "cartobase/smart/weakobject.h"

Inheritance diagram for carto::WeakObject:

Public Member Functions

template<typename T >
void attachWeakPtr (weak_ptr< T > &) const
 
template<typename T >
void detachWeakPtr (weak_ptr< T > &) const
 
template<typename T >
void attachWeakPtr (weak_shared_ptr< T > &) const
 
template<typename T >
void detachWeakPtr (weak_shared_ptr< T > &) const
 
virtual ~WeakObject ()
 

Protected Member Functions

 WeakObject ()
 
 WeakObject (const WeakObject &)
 
WeakObjectoperator= (const WeakObject &)
 

Detailed Description

Base class for weakly referenced objects.

WeakObject implements a specialized observer/subject pattern where weak_ptr is the observer.

When destroyed, observers are notified and point to null

See also
rc_ptr weak_ptr

Definition at line 48 of file weakobject.h.

Constructor & Destructor Documentation

virtual carto::WeakObject::~WeakObject ( )
virtual
carto::WeakObject::WeakObject ( )
protected
carto::WeakObject::WeakObject ( const WeakObject )
protected

Member Function Documentation

template<typename T >
void carto::WeakObject::attachWeakPtr ( weak_ptr< T > &  ptr) const
inline

Definition at line 83 of file weakobject.h.

Referenced by attachWeakPtr().

template<typename T >
void carto::WeakObject::attachWeakPtr ( weak_shared_ptr< T > &  ptr) const
inline

Definition at line 99 of file weakobject.h.

References attachWeakPtr().

template<typename T >
void carto::WeakObject::detachWeakPtr ( weak_ptr< T > &  ptr) const
inline

Definition at line 91 of file weakobject.h.

Referenced by detachWeakPtr().

template<typename T >
void carto::WeakObject::detachWeakPtr ( weak_shared_ptr< T > &  ptr) const
inline

Definition at line 107 of file weakobject.h.

References detachWeakPtr().

WeakObject& carto::WeakObject::operator= ( const WeakObject )
protected

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