Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACE_Lock_Adapter Class Template Reference

This is an adapter that allows applications to transparently combine the abstract base class (which contains pure virtual methods) with any of the other concrete ACE synchronization classes (e.g., , , , etc.). More...

`#include <Synch_T.h>`

Inheritance diagram for ACE_Lock_Adapter

[legend]
Collaboration diagram for ACE_Lock_Adapter:

[legend]
List of all members.

## Public Types
typedef ACE_LOCKING_MECHANISM | ACE_LOCK
## Public Methods
| ACE_Lock_Adapter (ACE_LOCKING_MECHANISM &lock)
| Constructor. All locking requests will be forwarded to <lock>.
| ACE_Lock_Adapter (void)
| Constructor. Since no lock is provided by the user, one will be created internally.
virtual | ~ACE_Lock_Adapter (void)
| Destructor. If <lock_> was not passed in by the user, it will be deleted.
virtual int | acquire (void)
| Block the thread until the lock is acquired.
virtual int | tryacquire (void)
| Conditionally acquire the lock (i.e., won't block).
virtual int | release (void)
| Release the lock.
virtual int | acquire_read (void)
virtual int | acquire_write (void)
virtual int | tryacquire_read (void)
| Conditionally acquire a read lock. If the locking mechanism doesn't support read locks then this just calls .
virtual int | tryacquire_write (void)
| Conditionally acquire a write lock. If the locking mechanism doesn't support read locks then this just calls .
virtual int | tryacquire_write_upgrade (void)
virtual int | remove (void)
| Explicitly destroy the lock.
## Private Attributes
ACE_LOCKING_MECHANISM* | lock_
| The concrete locking mechanism that all the methods delegate to.
int | delete_lock_
| This flag keep track of whether we are responsible for deleting the lock.

## Detailed Description

### template<class ACE_LOCKING_MECHANISM> template class ACE_Lock_Adapter

This is an adapter that allows applications to transparently combine the abstract base class (which contains pure virtual methods) with any of the other concrete ACE synchronization classes (e.g., , , , etc.).

This class uses a form of the Adapter pattern.

## Member Typedef Documentation

template<classACE_LOCKING_MECHANISM>
typedef ACE_LOCKING_MECHANISM ACE_Lock_Adapter<ACE_LOCKING_MECHANISM>::ACE_LOCK

## Constructor & Destructor Documentation

template<classACE_LOCKING_MECHANISM>
ACE_INLINE ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::ACE_Lock_Adapter<ACE_LOCKING_MECHANISM> ( | ACE_LOCKING_MECHANISM & lock )

| Constructor. All locking requests will be forwarded to <lock>.

template<classACE_LOCKING_MECHANISM>
ACE_Lock_Adapter<ACE_LOCKING_MECHANISM>::ACE_Lock_Adapter<ACE_LOCKING_MECHANISM> ( | void )

| Constructor. Since no lock is provided by the user, one will be created internally.

template<classACE_LOCKING_MECHANISM>
ACE_INLINE ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::~ACE_Lock_Adapter<ACE_LOCKING_MECHANISM> ( | void )`[virtual]`

| Destructor. If <lock_> was not passed in by the user, it will be deleted.

## Member Function Documentation

template<classACE_LOCKING_MECHANISM>
ACE_INLINE int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::acquire ( | void )`[virtual]`

| Block the thread until the lock is acquired. Reimplemented from ACE_Lock.

template<classACE_LOCKING_MECHANISM>
ACE_INLINE int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::acquire_read ( | void )`[virtual]`

| Block until the thread acquires a read lock. If the locking mechanism doesn't support read locks then this just calls . Reimplemented from ACE_Lock.

template<classACE_LOCKING_MECHANISM>
ACE_INLINE int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::acquire_write ( | void )`[virtual]`

| Block until the thread acquires a write lock. If the locking mechanism doesn't support read locks then this just calls . Reimplemented from ACE_Lock.

template<classACE_LOCKING_MECHANISM>
ACE_INLINE int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::release ( | void )`[virtual]`

| Release the lock. Reimplemented from ACE_Lock.

template<classACE_LOCKING_MECHANISM>
ACE_INLINE int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::remove ( | void )`[virtual]`

| Explicitly destroy the lock. Reimplemented from ACE_Lock.

template<classACE_LOCKING_MECHANISM>
ACE_INLINE int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::tryacquire ( | void )`[virtual]`

| Conditionally acquire the lock (i.e., won't block). Reimplemented from ACE_Lock.

template<classACE_LOCKING_MECHANISM>
ACE_INLINE int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::tryacquire_read ( | void )`[virtual]`

| Conditionally acquire a read lock. If the locking mechanism doesn't support read locks then this just calls . Reimplemented from ACE_Lock.

template<classACE_LOCKING_MECHANISM>
ACE_INLINE int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::tryacquire_write ( | void )`[virtual]`

| Conditionally acquire a write lock. If the locking mechanism doesn't support read locks then this just calls . Reimplemented from ACE_Lock.

template<classACE_LOCKING_MECHANISM>
ACE_INLINE int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::tryacquire_write_upgrade ( | void )`[virtual]`

| Conditionally try to upgrade a lock held for read to a write lock. If the locking mechanism doesn't support read locks then this just calls . Returns 0 on success, -1 on failure. Reimplemented from ACE_Lock.

## Member Data Documentation

template<classACE_LOCKING_MECHANISM>
int ACE_Lock_Adapter<ACE_LOCKING_MECHANISM>::delete_lock_`[private]`

| This flag keep track of whether we are responsible for deleting the lock.

template<classACE_LOCKING_MECHANISM>
ACE_LOCKING_MECHANISM * ACE_Lock_Adapter<ACE_LOCKING_MECHANISM>::lock_`[private]`

| The concrete locking mechanism that all the methods delegate to.

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

- Synch_T.h
- Synch_T.i