qpid::sys::ProducerConsumer::Lock Class Reference

Base class for producer and consumer locks. More...

#include <ProducerConsumer.h>

Inheritance diagram for qpid::sys::ProducerConsumer::Lock:

Inheritance graph
[legend]
Collaboration diagram for qpid::sys::ProducerConsumer::Lock:

Collaboration graph
[legend]
List of all members.

Public Member Functions

bool isOk () const
 You must call isOk() after creating a lock to verify its state.
void confirm ()
 Confirm that an item was produced/consumed.
void cancel ()
 Cancel the lock to indicate nothing was produced/consumed.
bool isTimedOut () const
 True if this lock experienced a timeout.
bool isShutdown () const
 True if we have been shutdown.

Public Attributes

ProducerConsumerpc

Protected Types

 INCOMPLETE
 CONFIRMED
 CANCELLED
 TIMEOUT
enum  Status { INCOMPLETE, CONFIRMED, CANCELLED, TIMEOUT }
 Lock status.

Protected Member Functions

 Lock (ProducerConsumer &p)
void checkOk () const

Protected Attributes

Mutex::ScopedLock lock
Status status

Detailed Description

Base class for producer and consumer locks.


Member Function Documentation

void qpid::sys::ProducerConsumer::Lock::cancel (  ) 

Cancel the lock to indicate nothing was produced/consumed.

Note that locks are not actually released until destroyed.

Precondition:
isOk()

void qpid::sys::ProducerConsumer::Lock::confirm (  ) 

Confirm that an item was produced/consumed.

Precondition:
isOk()

bool qpid::sys::ProducerConsumer::Lock::isOk (  )  const

You must call isOk() after creating a lock to verify its state.

Returns:
true means the lock succeeded. You MUST call either confirm() or cancel() before the lock goes out of scope.
false means the lock failed - timed out or the ProducerConsumer is shutdown. You should not do anything in the scope of the lock.


The documentation for this class was generated from the following file:
Generated on Tue Apr 17 14:22:22 2007 for Qpid by  doxygen 1.4.7