#include <lockingptr.h>
Inheritance diagram for LockableObj:
Public Member Functions | |
LockableObj () | |
virtual | ~LockableObj () |
bool | isLocked () const |
virtual void | lock () const=0 |
virtual void | unlock () const=0 |
Public Attributes | |
int | m_lockCount |
By implementing this interface, a smart pointer can be created which will lock this object. This is used to prevent that an internal pointer owned by a lockable object would become invalid when the object is removed from memory, leaving the client with an invalid pointer. By letting the client use a smart pointer instead of the real object the object will be locked into memory until the pointer is no longer used, at which point the owner object will be unlock and can be removed from memory.
Definition at line 31 of file lockingptr.h.
LockableObj::LockableObj | ( | ) | [inline] |
Definition at line 34 of file lockingptr.h.
virtual LockableObj::~LockableObj | ( | ) | [inline, virtual] |
Definition at line 35 of file lockingptr.h.
bool LockableObj::isLocked | ( | ) | const [inline] |
Returns TRUE if the object is currently locked.
Definition at line 38 of file lockingptr.h.
References m_lockCount.
Referenced by MemberDef::flushToDisk(), and MemberDef::loadFromDisk().
virtual void LockableObj::lock | ( | ) | const [pure virtual] |
Called when the object is locked.
Implemented in Definition.
Referenced by LockingPtr< T >::LockingPtr().
virtual void LockableObj::unlock | ( | ) | const [pure virtual] |
Called when the object is unlocked.
Implemented in Definition.
Referenced by LockingPtr< T >::operator=(), and LockingPtr< T >::~LockingPtr().
Definition at line 51 of file lockingptr.h.
Referenced by isLocked(), LockingPtr< T >::LockingPtr(), LockingPtr< T >::operator=(), and LockingPtr< T >::~LockingPtr().