LockingPtr< T > Class Template Reference

Smart pointer which keeps a lock on the owner of the pointer. More...

#include <lockingptr.h>

List of all members.

Public Member Functions

 LockingPtr (const LockableObj *o, const T *p)
 LockingPtr (const LockingPtr &lp)
LockingPtroperator= (const LockingPtr &lp)
 ~LockingPtr ()
bool isNull () const
bool operator! () const
bool operator== (T *p) const
bool operator== (const LockingPtr &lp) const
bool operator!= (T *p) const
bool operator!= (const LockingPtr &lp) const
const T & operator * () const
T * pointer () const
T * operator-> () const


Detailed Description

template<class T>
class LockingPtr< T >

Smart pointer which keeps a lock on the owner of the pointer.

With the pointer an owner object derived from LockableObj is associated. As long as the smart object exists it will keep a lock on the obj by calling LockableObj::lock(). Smart pointers can be copied and passed by value. As soon as there or no more smart pointer references to the object, LockableObj::unlock() will be called automatically.

Definition at line 62 of file lockingptr.h.


Constructor & Destructor Documentation

template<class T>
LockingPtr< T >::LockingPtr ( const LockableObj o,
const T *  p 
) [inline]

Creates a smart pointer for pointer p owned by object o.

Definition at line 70 of file lockingptr.h.

References LockableObj::lock(), and LockableObj::m_lockCount.

template<class T>
LockingPtr< T >::LockingPtr ( const LockingPtr< T > &  lp  )  [inline]

Copies the smart pointer lp

Definition at line 80 of file lockingptr.h.

References LockableObj::m_lockCount, LockingPtr< T >::m_owner, and LockingPtr< T >::m_ptr.

template<class T>
LockingPtr< T >::~LockingPtr (  )  [inline]

Destroys the smart pointer, will unlock the owner.

Definition at line 104 of file lockingptr.h.

References LockableObj::m_lockCount, and LockableObj::unlock().


Member Function Documentation

template<class T>
LockingPtr& LockingPtr< T >::operator= ( const LockingPtr< T > &  lp  )  [inline]

Assigns the smart pointer lp

Definition at line 89 of file lockingptr.h.

References LockableObj::m_lockCount, LockingPtr< T >::m_owner, LockingPtr< T >::m_ptr, and LockableObj::unlock().

template<class T>
bool LockingPtr< T >::isNull (  )  const [inline]

Definition at line 113 of file lockingptr.h.

Referenced by DotCallGraph::buildGraph(), and generateDEFForMember().

template<class T>
bool LockingPtr< T >::operator! (  )  const [inline]

Definition at line 118 of file lockingptr.h.

template<class T>
bool LockingPtr< T >::operator== ( T *  p  )  const [inline]

Definition at line 123 of file lockingptr.h.

template<class T>
bool LockingPtr< T >::operator== ( const LockingPtr< T > &  lp  )  const [inline]

Definition at line 128 of file lockingptr.h.

References LockingPtr< T >::m_ptr.

template<class T>
bool LockingPtr< T >::operator!= ( T *  p  )  const [inline]

Definition at line 133 of file lockingptr.h.

template<class T>
bool LockingPtr< T >::operator!= ( const LockingPtr< T > &  lp  )  const [inline]

Definition at line 138 of file lockingptr.h.

References LockingPtr< T >::m_ptr.

template<class T>
const T& LockingPtr< T >::operator * (  )  const [inline]

Dereference operator

Definition at line 144 of file lockingptr.h.

template<class T>
T* LockingPtr< T >::pointer (  )  const [inline]

Definition at line 149 of file lockingptr.h.

Referenced by MemberDef::addListReference(), NamespaceDef::addListReferences(), GroupDef::addListReferences(), FileDef::addListReferences(), ClassDef::addListReferences(), VhdlDocGen::findFunction(), getDefs(), GroupDef::insertMember(), ClassDef::mergeMembers(), and VhdlDocGen::writeVHDLDeclaration().

template<class T>
T* LockingPtr< T >::operator-> (  )  const [inline]

Pointer operator

Definition at line 155 of file lockingptr.h.


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