ucc::exclusive_lock Class Reference

A kind of smart pointer object to support exclusive locking protocol. More...

#include <access.h>

Collaboration diagram for ucc::exclusive_lock:

Collaboration graph
[legend]

Public Member Functions

 exclusive_lock (Exclusive *object)
 Create an instance of an exclusive object reference.
 ~exclusive_lock ()
 Destroy reference to exclusively locked object, release lock.
bool operator! ()
 Test if the reference holds an active lock.
 operator bool ()
 Test if the reference holds an active lock.
void release (void)
 Release a held lock programatically.

Detailed Description

A kind of smart pointer object to support exclusive locking protocol.

This object initiates an exclusive lock for the object being referenced when it is instanciated, and releases the exclusive lock when it is destroyed. You would pass the pointer an object that has the Exclusive as a base class.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 123 of file access.h.


Constructor & Destructor Documentation

ucc::exclusive_lock::exclusive_lock ( Exclusive object  ) 

Create an instance of an exclusive object reference.

Parameters:
object containing Exclusive base class protocol to lock.


Member Function Documentation

ucc::exclusive_lock::operator bool (  )  [inline]

Test if the reference holds an active lock.

Returns:
true if locking an object.

Definition at line 151 of file access.h.

Here is the call graph for this function:

bool ucc::exclusive_lock::operator! (  )  [inline]

Test if the reference holds an active lock.

Returns:
true if is not locking an object.

Definition at line 144 of file access.h.

Here is the call graph for this function:

void ucc::exclusive_lock::release ( void   ) 

Release a held lock programatically.

This can be used to de-reference the object being exclusively locked without having to wait for the destructor to be called when the exclusive_lock falls out of scope.


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

Generated on Mon Jul 27 21:11:22 2009 for UCommon by  doxygen 1.5.9