40#ifndef INCLUDED_WEAK_REFERENCE_H
41#define INCLUDED_WEAK_REFERENCE_H
48class WeakReferenceable;
102 : _referent( referent )
115 _referent->NotifyWeakReferenceDestroyed(
this );
146 SetWeakReference( weakReferenceable );
172 SetWeakReference( weakReferenceable );
202 return ( _weakReference.IsNull() || NULL == _weakReference->GetReferent() );
215 ret =
dynamic_cast<T*
>( _weakReference->GetReferent() );
226 return !_weakReference.IsNull() ? _weakReference->GetReferent() : NULL;
233 if( weakReferenceable )
237 weakRef =
new WeakReferenceImpl( weakReferenceable );
241 _weakReference.Reset( weakRef );
244 ScopedPtr<WeakReference> _weakReference;
Definition: weak_reference.h:92
WeakRef & operator=(const WeakRef< U > &w)
Definition: weak_reference.h:191
WeakRef(WeakReferenceable *weakReferenceable)
Definition: weak_reference.h:144
T * Get() const
Definition: weak_reference.h:208
WeakRef(const WeakRef< U > &w)
Definition: weak_reference.h:161
WeakRef()
Definition: weak_reference.h:136
WeakRef & operator=(const WeakRef &w)
Definition: weak_reference.h:180
bool IsNull() const
Definition: weak_reference.h:200
WeakReferenceable * GetWeakReferenceable() const
Definition: weak_reference.h:224
WeakRef(const WeakRef &w)
Definition: weak_reference.h:152
WeakRef & operator=(WeakReferenceable *weakReferenceable)
Definition: weak_reference.h:170
Definition: weak_reference.h:52
virtual void NotifyReferentDestroyed()=0
Notify this weak reference that the object destroyed.
virtual WeakReferenceable * GetReferent() const =0
Definition: weak_reference.h:65
virtual void AddWeakReference(WeakReference *weakRef)=0
virtual void NotifyWeakReferenceDestroyed(WeakReference *weakReference)=0
Contains the DistiAssert macro.
#define GLS_ASSERT(exp)
Definition: disti_assert.h:150
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:214
Force inclusion of the DirectShow library.
Definition: bmpimage.h:47
A smart pointer with unique ownership – poor man's std::unique_ptr.