qpid::messaging::Receiver Class Reference

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

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Types | Protected Attributes
qpid::messaging::Receiver Class Reference
Qpid C++ Client API

Interface through which messages are received. More...

`#include <qpid/messaging/Receiver.h>`

List of all members.

## Public Member Functions
| Receiver (ReceiverImpl *impl=0)
| Receiver (const Receiver &)
| ~Receiver ()
Receiver & | operator= (const Receiver &)
bool | get (Message &message, Duration timeout=Duration::FOREVER)
| Retrieves a message from this receivers local queue, or waits for upto the specified timeout for a message to become available.
Message | get (Duration timeout=Duration::FOREVER)
| Retrieves a message from this receivers local queue, or waits for up to the specified timeout for a message to become available.
bool | fetch (Message &message, Duration timeout=Duration::FOREVER)
| Retrieves a message for this receivers subscription or waits for up to the specified timeout for one to become available.
Message | fetch (Duration timeout=Duration::FOREVER)
| Retrieves a message for this receivers subscription or waits for up to the specified timeout for one to become available.
void | setCapacity (uint32_t)
| Sets the capacity for the receiver.
uint32_t | getCapacity ()
uint32_t | getAvailable ()
uint32_t | getUnsettled ()
void | close ()
| Cancels this receiver.
bool | isClosed () const
| Return true if the receiver was closed by a call to close()
const std::string & | getName () const
| Returns the name of this receiver.
Session | getSession () const
| Returns a handle to the session associated with this receiver.
QPID_MESSAGING_INLINE_EXTERN bool | isValid () const
QPID_MESSAGING_INLINE_EXTERN bool | isNull () const
QPID_MESSAGING_INLINE_EXTERN | operator bool () const
| Conversion to bool supports idiom if (handle) { handle->...
QPID_MESSAGING_INLINE_EXTERN bool | operator! () const
| Operator ! supports idiom if (!handle) { do_if_handle_is_null(); }.
void | swap (Handle< T > &h)
## Protected Types
typedef T | Impl
## Protected Attributes
Impl * | impl

## Detailed Description

Interface through which messages are received.

## Member Typedef Documentation

typedef T qpid::messaging::Handle::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

void qpid::messaging::Receiver::close | ( |  | ) |

Cancels this receiver.

bool qpid::messaging::Receiver::fetch | ( | Message & | message,
|  | Duration | timeout = `Duration::FOREVER`
| ) |  |

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 returning false.

Returns:
  false if there is no message to give after waiting for the specified timeout, or if the Receiver is closed, in which case isClose() will be true.

Message qpid::messaging::Receiver::fetch | ( | Duration | timeout = `Duration::FOREVER` | ) |

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.

Exceptions:

  NoMessageAvailable | if there is no message to give after waiting for the specified timeout, or if the Receiver is closed, in which case isClose() will be true.

bool qpid::messaging::Receiver::get | ( | Message & | message,
|  | Duration | timeout = `Duration::FOREVER`
| ) |  |

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

Message qpid::messaging::Receiver::get | ( | Duration | timeout = `Duration::FOREVER` | ) |

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

Exceptions:

  NoMessageAvailable | if there is no message to give after waiting for the specified timeout, or if the Receiver is closed, in which case isClose() will be true.

uint32_t qpid::messaging::Receiver::getAvailable | ( |  | ) |

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

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).

const std::string& qpid::messaging::Receiver::getName | ( |  | ) | const

Returns the name of this receiver.

Session qpid::messaging::Receiver::getSession | ( |  | ) | const

Returns a handle to the session associated with this receiver.

uint32_t qpid::messaging::Receiver::getUnsettled | ( |  | ) |

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.

bool qpid::messaging::Receiver::isClosed | ( |  | ) | const

Return true if the receiver was closed by a call to close()

QPID_MESSAGING_INLINE_EXTERN bool qpid::messaging::Handle::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.

QPID_MESSAGING_INLINE_EXTERN bool qpid::messaging::Handle::isValid | ( |  | ) | const`[inline, inherited]`

Returns:
  true if handle is valid, i.e. not null.

Definition at line 43 of file Handle.h.

QPID_MESSAGING_INLINE_EXTERN qpid::messaging::Handle::operator bool | ( |  | ) | const`[inline, inherited]`

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

}

Definition at line 49 of file Handle.h.

QPID_MESSAGING_INLINE_EXTERN bool qpid::messaging::Handle::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 & |  | ) |

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::Handle::swap | ( | Handle< T > & | h | ) | `[inline, inherited]`

Definition at line 54 of file Handle.h.

## Member Data Documentation

Impl* qpid::messaging::Handle::impl`[protected, inherited]`

Definition at line 64 of file Handle.h.

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

- qpid/messaging/Receiver.h