LockableObj Class Reference

Abstract interface for lockable objects. More...

#include <lockingptr.h>

Inheritance diagram for LockableObj:

Definition ClassDef DirDef FileDef GroupDef MemberDef NamespaceDef PageDef List of all members.

Public Member Functions

 LockableObj ()
virtual ~LockableObj ()
bool isLocked () const
virtual void lock () const=0
virtual void unlock () const=0

Public Attributes

int m_lockCount

Detailed Description

Abstract interface for lockable objects.

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.


Constructor & Destructor Documentation

LockableObj::LockableObj (  )  [inline]

Definition at line 34 of file lockingptr.h.

virtual LockableObj::~LockableObj (  )  [inline, virtual]

Definition at line 35 of file lockingptr.h.


Member Function Documentation

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().


Member Data Documentation

int LockableObj::m_lockCount

Definition at line 51 of file lockingptr.h.

Referenced by isLocked(), LockingPtr< T >::LockingPtr(), LockingPtr< T >::operator=(), and LockingPtr< T >::~LockingPtr().


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



Generated on Mon Mar 31 10:59:01 2008 by  doxygen 1.5.1