Apache Qpid C++ API
Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation

qpid::messaging::Receiver Class Reference

Interface through which messages are received. More...

#include <qpid/messaging/Receiver.h>

List of all members.

Classes

struct  NoMessageAvailable

Public Member Functions

 Receiver (ReceiverImpl *impl=0)
 Receiver (const Receiver &)
 ~Receiver ()
Receiveroperator= (const Receiver &)
bool get (Message &message, qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE)
 Retrieves a message from this receivers local queue, or waits for upto the specified timeout for a message to become available.
Message get (qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE)
 Retrieves a message from this receivers local queue, or waits for upto the specified timeout for a message to become available.
bool fetch (Message &message, qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE)
 Retrieves a message for this receivers subscription or waits for upto the specified timeout for one to become available.
Message fetch (qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE)
 Retrieves a message for this receivers subscription or waits for up to the specified timeout for one to become available.
void start ()
 Enables the message flow for this receiver.
void stop ()
 Stops the message flow for this receiver (but does not cancel the subscription).
void setCapacity (uint32_t)
 Sets the capacity for the receiver.
uint32_t getCapacity ()
 Returns the capacity of the receiver.
uint32_t available ()
 Returns the number of messages received and waiting to be fetched.
uint32_t pendingAck ()
 Returns a count of the number of messages received on this receiver that have been acknowledged, but for which that acknowledgement has not yet been confirmed as processed by the server.
void cancel ()
 Cancels this receiver.
void setListener (MessageListener *listener)
 Set a message listener for this receiver.
bool isValid () const
bool isNull () const
 operator bool () const
 Conversion to bool supports idiom if (handle) { handle->.
bool operator! () const
 Operator ! supports idiom if (!handle) { do_if_handle_is_null(); }.
void swap (Handle< ReceiverImpl > &h)

Protected Types

typedef ReceiverImpl Impl

Protected Attributes

Implimpl

Detailed Description

Interface through which messages are received.

Definition at line 45 of file Receiver.h.


Member Typedef Documentation

typedef ReceiverImpl qpid::client::Handle< ReceiverImpl >::Impl [protected, inherited]

Definition at line 57 of file Handle.h.


Constructor & Destructor Documentation

qpid::messaging::Receiver::Receiver ( ReceiverImpl *  impl = 0  ) 
qpid::messaging::Receiver::Receiver ( const Receiver  ) 
qpid::messaging::Receiver::~Receiver (  ) 

Member Function Documentation

uint32_t qpid::messaging::Receiver::available (  ) 

Returns the number of messages received and waiting to be fetched.

void qpid::messaging::Receiver::cancel (  ) 

Cancels this receiver.

Message qpid::messaging::Receiver::fetch ( qpid::sys::Duration  timeout = qpid::sys::TIME_INFINITE  ) 

Retrieves a message for this receivers subscription or waits for up to the specified timeout for one to become available.

Unlike get() this method will check with the server that there is no message for the subscription this receiver is serving before throwing an exception.

bool qpid::messaging::Receiver::fetch ( Message message,
qpid::sys::Duration  timeout = qpid::sys::TIME_INFINITE 
)

Retrieves a message for this receivers subscription or waits for upto the specified timeout for one to become available.

Unlike get() this method will check with the server that there is no message for the subscription this receiver is serving before returning false.

Message qpid::messaging::Receiver::get ( qpid::sys::Duration  timeout = qpid::sys::TIME_INFINITE  ) 

Retrieves a message from this receivers local queue, or waits for upto the specified timeout for a message to become available.

Throws NoMessageAvailable if there is no message to give after waiting for the specified timeout.

bool qpid::messaging::Receiver::get ( Message message,
qpid::sys::Duration  timeout = qpid::sys::TIME_INFINITE 
)

Retrieves a message from this receivers local queue, or waits for upto the specified timeout for a message to become available.

Returns false if there is no message to give after waiting for the specified timeout.

uint32_t qpid::messaging::Receiver::getCapacity (  ) 

Returns the capacity of the receiver.

The capacity determines how many incoming messages can be held in the receiver before being requested by a client via fetch() (or pushed to a listener).

bool qpid::client::Handle< ReceiverImpl >::isNull (  )  const [inline, inherited]
Returns:
true if handle is null. It is an error to call any function on a null handle.

Definition at line 46 of file Handle.h.

bool qpid::client::Handle< ReceiverImpl >::isValid (  )  const [inline, inherited]
Returns:
true if handle is valid, i.e. not null.

Definition at line 43 of file Handle.h.

qpid::client::Handle< ReceiverImpl >::operator bool (  )  const [inline, inherited]

Conversion to bool supports idiom if (handle) { handle->.

.. }

Definition at line 49 of file Handle.h.

bool qpid::client::Handle< ReceiverImpl >::operator! (  )  const [inline, inherited]

Operator ! supports idiom if (!handle) { do_if_handle_is_null(); }.

Definition at line 52 of file Handle.h.

Receiver& qpid::messaging::Receiver::operator= ( const Receiver  ) 
uint32_t qpid::messaging::Receiver::pendingAck (  ) 

Returns a count of the number of messages received on this receiver that have been acknowledged, but for which that acknowledgement has not yet been confirmed as processed by the server.

void qpid::messaging::Receiver::setCapacity ( uint32_t   ) 

Sets the capacity for the receiver.

The capacity determines how many incoming messages can be held in the receiver before being requested by a client via fetch() (or pushed to a listener).

void qpid::messaging::Receiver::setListener ( MessageListener listener  ) 

Set a message listener for this receiver.

See also:
Session::dispatch()
void qpid::messaging::Receiver::start (  ) 

Enables the message flow for this receiver.

void qpid::messaging::Receiver::stop (  ) 

Stops the message flow for this receiver (but does not cancel the subscription).

void qpid::client::Handle< ReceiverImpl >::swap ( Handle< ReceiverImpl > &  h  )  [inline, inherited]

Definition at line 54 of file Handle.h.


Member Data Documentation

Impl* qpid::client::Handle< ReceiverImpl >::impl [protected, inherited]

Definition at line 64 of file Handle.h.


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

Qpid C++ API Reference
Generated on Tue May 4 18:07:22 2010 for Qpid C++ Client API by doxygen 1.6.1