qpid::client::LocalQueue Class Reference
[Application API for an AMQP client.]

A local queue to collect messages retrieved from a remote broker queue. More...

#include <LocalQueue.h>

Collaboration diagram for qpid::client::LocalQueue:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LocalQueue (AckPolicy ackPolicy=AckPolicy())
 Create a local queue.
bool get (Message &result, sys::Duration timeout=0)
 Wait up to timeout for the next message from the local queue.
Message get ()
 Get the next message off the local queue, or wait for a message from the broker queue.
Message pop ()
 Synonym for get().
bool empty () const
 Return true if local queue is empty.
size_t size () const
 Number of messages on the local queue.
void setAckPolicy (AckPolicy)
 Set the message acknowledgement policy.
AckPolicygetAckPolicy ()
 Get the message acknowledgement policy.


Detailed Description

A local queue to collect messages retrieved from a remote broker queue.

Create a queue and subscribe it using the SubscriptionManager. Messages from the remote queue on the broker will be stored in the local queue until you retrieve them.

Definition at line 41 of file LocalQueue.h.


Constructor & Destructor Documentation

qpid::client::LocalQueue::LocalQueue ( AckPolicy  ackPolicy = AckPolicy()  ) 

Create a local queue.

Subscribe the local queue to a remote broker queue with a SubscriptionManager.

LocalQueue is an alternative to implementing a MessageListener.

Parameters:
ackPolicy Policy for acknowledging messages.
See also:
AckPolicy.


Member Function Documentation

bool qpid::client::LocalQueue::get ( Message result,
sys::Duration  timeout = 0 
)

Wait up to timeout for the next message from the local queue.

Parameters:
result Set to the message from the queue.
timeout wait up this timeout for a message to appear.
Returns:
true if result was set, false if queue was empty after timeout.

Message qpid::client::LocalQueue::get (  ) 

Get the next message off the local queue, or wait for a message from the broker queue.

Exceptions:
ClosedException if subscription has been closed.

Message qpid::client::LocalQueue::pop (  ) 

Synonym for get().

bool qpid::client::LocalQueue::empty (  )  const

Return true if local queue is empty.

void qpid::client::LocalQueue::setAckPolicy ( AckPolicy   ) 

Set the message acknowledgement policy.

See also:
AckPolicy.

AckPolicy& qpid::client::LocalQueue::getAckPolicy (  ) 

Get the message acknowledgement policy.

See also:
AckPolicy.


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

Generated on Thu Oct 16 13:38:19 2008 for Qpid by  doxygen 1.5.6