#include <SafePtr.h>

Public Member Functions | |
| SafePtr () | |
| SafePtr (T *pSubject) | |
| virtual | ~SafePtr () |
| void | reset (T *pSubject=NULL) |
| T * | get () |
| const T * | get () const |
| T * | operator-> () |
| const T * | operator-> () const |
Protected Member Functions | |
| void | attach (const std::string &signal, const Slot &slot) |
| void | detach (const std::string &signal, const Slot &slot) |
This class handles a number of issues relating to the management of Subject attachment lifetimes:
This class is intended to be used as a member variable, in place of a raw pointer to the Subject. If subclasses are to be allowed to attach to the Subject, the variable should be made protected.
Note that this class will not cause any kind of callback when its Subject has been deleted. It will simply NULLify the pointer. If you require any special handling for when the Subject has been deleted, You should separately attach to SIGNAL_NAME(Subject, Deleted).
Definition at line 34 of file SafePtr.h.
| void SafePtr< T >::reset | ( | T * | pSubject = NULL |
) |
Change what Subject to observe.
This will automatically detach from the old Subject, and attach to the new one.
| pSubject | The subject to begin observing. |
Reimplemented in AttachmentPtr< T >, AttachmentPtr< DockWindow >, AttachmentPtr< ApplicationServices >, and AttachmentPtr< SessionManager >.
| T* SafePtr< T >::get | ( | ) |
| const T* SafePtr< T >::get | ( | ) | const |
| T* SafePtr< T >::operator-> | ( | ) |
| const T* SafePtr< T >::operator-> | ( | ) | const |