ucc::SharedPointer Class Reference

The shared pointer is used to manage a singleton instance of shared object. More...

#include <thread.h>

Inheritance diagram for ucc::SharedPointer:

Inheritance graph
[legend]
Collaboration diagram for ucc::SharedPointer:

Collaboration graph
[legend]

Protected Member Functions

 SharedPointer ()
 Created shared locking for pointer.
 ~SharedPointer ()
 Destroy lock and release any blocked threads.
void replace (SharedObject *object)
 Replace existing singleton instance with new one.
SharedObjectshare (void)
 Acquire a shared reference to the singleton object.

Friends

class shared_release

Detailed Description

The shared pointer is used to manage a singleton instance of shared object.

This class is used to support the templated shared_pointer class and the shared_release class, and is not meant to be used directly or as a base for anything else. One or more threads may aquire a shared lock to the singleton object through this pointer, and it can only be replaced with a new singleton instance when no threads reference it. The conditional lock is used to manage shared access for use and exclusive access when modified.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 1393 of file thread.h.


Constructor & Destructor Documentation

ucc::SharedPointer::SharedPointer (  )  [protected]

Created shared locking for pointer.

Must be assigned by replace.


Member Function Documentation

void ucc::SharedPointer::replace ( SharedObject object  )  [protected]

Replace existing singleton instance with new one.

This happens during exclusive locking, and the commit method of the object will be called.

Parameters:
object being set.

SharedObject* ucc::SharedPointer::share ( void   )  [protected]

Acquire a shared reference to the singleton object.

This is a form of shared access lock. Derived classes and templates access "release" when the shared pointer is no longer needed.

Returns:
shared object.


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

Generated on Wed May 13 09:11:44 2009 for UCommon by  doxygen 1.5.8