ucommon/access.h File Reference

Locking protocol classes for member function automatic operations. More...

#include <ucommon/platform.h>
#include <ucommon/cpr.h>
#include <ucommon/protocols.h>
Include dependency graph for access.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  exclusive_access
 A kind of smart pointer object to support exclusive locking protocol. More...
class  ExclusiveAccess
 An exclusive locking protocol interface base. More...
class  shared_access
 A kind of smart pointer object to support shared locking protocol. More...
class  SharedAccess
 An exclusive locking access interface base. More...
class  UnlockAccess
 Common unlock protocol for locking protocol interface classes. More...

Defines

#define exclusive_locking(x)   exlock_t __autolock__ = &x
#define exclusive_object()   exlock_t __autolock__ = this
#define protected_locking(x)   shlock_t __autolock__ = &x
#define protected_object()   shlock_t __autolock__ = this

Typedefs

typedef exclusive_access exlock_t
 Convenience type to use for object referencing an exclusive object.
typedef shared_access shlock_t
 Convenience type to use for object referencing a shared object.

Functions

void access (SharedAccess &object)
 Convenience function to access (lock) shared object through it's protocol.
void exclusive (SharedAccess &object)
 Convenience function to exclusive lock shared object through it's protocol.
void lock (ExclusiveAccess &object)
 Convenience function to exclusively lock an object through it's protocol.
void release (shlock_t &reference)
 Convenience function to release a reference to a shared lock.
void release (exlock_t &reference)
 Convenience function to release a reference to an exclusive lock.
void release (SharedAccess &object)
 Convenience function to unlock shared object through it's protocol.
void share (SharedAccess &object)
 Convenience function to restore shared locking for object through it's protocol.
void unlock (ExclusiveAccess &object)
 Convenience function to unlock an exclusive object through it's protocol.

Detailed Description

Locking protocol classes for member function automatic operations.

This header covers ucommon access related classes. These are used to provide automatic management of locks and synchronization objects through common virtual base classes which can be used with automatic objects. These classes are related to "protocols" and are used in conjunction with smart pointer/referencing classes. The access interface supports member functions to acquire a lock when entered and automatically release the lock when the member function returns that are used in conjunction with special referencing smart pointers.

Definition in file access.h.


Function Documentation

void access ( SharedAccess object  )  [inline]

Convenience function to access (lock) shared object through it's protocol.

Parameters:
object to share lock.

Definition at line 253 of file access.h.

void exclusive ( SharedAccess object  )  [inline]

Convenience function to exclusive lock shared object through it's protocol.

Parameters:
object to exclusive lock.

Definition at line 267 of file access.h.

void lock ( ExclusiveAccess object  )  [inline]

Convenience function to exclusively lock an object through it's protocol.

Parameters:
object to lock.

Definition at line 239 of file access.h.

void release ( shlock_t reference  )  [inline]

Convenience function to release a reference to a shared lock.

Parameters:
reference to object referencing shared locked object.

Definition at line 298 of file access.h.

Here is the call graph for this function:

void release ( exlock_t reference  )  [inline]

Convenience function to release a reference to an exclusive lock.

Parameters:
reference to object referencing exclusive locked object.

Definition at line 291 of file access.h.

Here is the call graph for this function:

void release ( SharedAccess object  )  [inline]

Convenience function to unlock shared object through it's protocol.

Parameters:
object to unlock.

Definition at line 260 of file access.h.

void share ( SharedAccess object  )  [inline]

Convenience function to restore shared locking for object through it's protocol.

Parameters:
object to restore shared locking.

Definition at line 274 of file access.h.

void unlock ( ExclusiveAccess object  )  [inline]

Convenience function to unlock an exclusive object through it's protocol.

Parameters:
object to unlock.

Definition at line 246 of file access.h.


Generated on 24 Sep 2014 for ucommon by  doxygen 1.6.1