From 808e18100fda27d1f349422ffa7e5a3dc10343be Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 4 Jan 2008 16:49:29 +0000 Subject: Provide method to test for empty local queue. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@608915 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/LocalQueue.cpp | 7 +++++++ cpp/src/qpid/client/LocalQueue.h | 1 + 2 files changed, 8 insertions(+) (limited to 'cpp/src/qpid/client') diff --git a/cpp/src/qpid/client/LocalQueue.cpp b/cpp/src/qpid/client/LocalQueue.cpp index 7fbe4a053e..f44a04837b 100644 --- a/cpp/src/qpid/client/LocalQueue.cpp +++ b/cpp/src/qpid/client/LocalQueue.cpp @@ -47,4 +47,11 @@ Message LocalQueue::pop() { void LocalQueue::setAckPolicy(AckPolicy a) { autoAck=a; } +bool LocalQueue::empty() +{ + if (!queue) + throw ClosedException(); + return queue->isEmpty(); +} + }} // namespace qpid::client diff --git a/cpp/src/qpid/client/LocalQueue.h b/cpp/src/qpid/client/LocalQueue.h index 1c910bd3ee..0c958d8f24 100644 --- a/cpp/src/qpid/client/LocalQueue.h +++ b/cpp/src/qpid/client/LocalQueue.h @@ -42,6 +42,7 @@ class LocalQueue *@exception ClosedException if subscription has been closed. */ Message pop(); + bool empty(); void setAckPolicy(AckPolicy); -- cgit v1.2.1