ucc::mutex_pointer< T > Class Template Reference

Typed smart locked pointer class. More...

#include <thread.h>

Inheritance diagram for ucc::mutex_pointer< T >:

Inheritance graph
[legend]
Collaboration diagram for ucc::mutex_pointer< T >:

Collaboration graph
[legend]

Public Member Functions

 mutex_pointer ()
 Create a pointer with no reference.
 mutex_pointer (T *object)
 Create a pointer with a reference to a heap object.
T & operator* () const
 Reference object we are pointing to through pointer indirection.
T * operator-> () const
 Reference member of object we are pointing to.
T * get (void) const
 Get pointer to object.

Detailed Description

template<class T>
class ucc::mutex_pointer< T >

Typed smart locked pointer class.

This is used to manage references to objects which are protected by an auto-generated mutex. The mutex is released when the pointer falls out of scope.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 2475 of file thread.h.


Constructor & Destructor Documentation

template<class T >
ucc::mutex_pointer< T >::mutex_pointer ( T *  object  )  [inline]

Create a pointer with a reference to a heap object.

Parameters:
object we are referencing.

Definition at line 2487 of file thread.h.


Member Function Documentation

template<class T >
T* ucc::mutex_pointer< T >::get ( void   )  const [inline]

Get pointer to object.

Returns:
pointer or NULL if we are not referencing an object.

Definition at line 2507 of file thread.h.

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

Reference object we are pointing to through pointer indirection.

Returns:
object we are pointing to.

Definition at line 2493 of file thread.h.

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

Reference member of object we are pointing to.

Returns:
reference to member of pointed object.

Definition at line 2500 of file thread.h.


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

Generated on Wed May 13 08:42:18 2009 for UCommon by  doxygen 1.5.7.1