#include <pointer_template.h>
Public Member Functions | |
virtual | ~PointerProtection_Skel () |
destructor | |
void | registerPointer (PointerProtection_Base *n) |
register a pointer | |
void | unregisterPointer (PointerProtection_Base *n) |
unregister a pointer | |
void | clearPointers () |
Removes all pointers from the list. | |
Protected Attributes | |
std::list < PointerProtection_Base * > | _pointers |
Subclass this class if you want your Pointer_template<Bla> to be protected against deletion.
That means Bla has to be a subclass of PointerProtection_Skel and every Pointer_template<Bla> becomes zero if Bla is deleted. So you don't get dangling pointers...
virtual NSCore::PointerProtection_Skel::~PointerProtection_Skel | ( | ) | [inline, virtual] |
destructor
Tells all the registered pointers that this object is deleted.
References clearPointers().
void NSCore::PointerProtection_Skel::registerPointer | ( | PointerProtection_Base * | n | ) | [inline] |
register a pointer
This one is called by Pointer_template to register itself as a pointer and get notified if this object is deleted.
References _pointers.
Referenced by NSCore::Pointer_template< NSCore::QTreeItem >::operator=(), and NSCore::Pointer_template< NSCore::QTreeItem >::Pointer_template().
void NSCore::PointerProtection_Skel::unregisterPointer | ( | PointerProtection_Base * | n | ) | [inline] |
unregister a pointer
Called by Pointer_template to unregister itself from the registered pointers.
References _pointers.
Referenced by NSCore::Pointer_template< NSCore::QTreeItem >::~Pointer_template().
void NSCore::PointerProtection_Skel::clearPointers | ( | ) | [inline] |
Removes all pointers from the list.
References _pointers.
Referenced by NSCore::QTreeItem::treeDeleteLater(), and ~PointerProtection_Skel().
std::list<PointerProtection_Base*> NSCore::PointerProtection_Skel::_pointers [protected] |
Referenced by clearPointers(), registerPointer(), and unregisterPointer().