summaryrefslogtreecommitdiff
path: root/qpid/cpp/tests/topic_publisher.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2006-12-13 19:03:52 +0000
committerGordon Sim <gsim@apache.org>2006-12-13 19:03:52 +0000
commit347dae32c31219bdcf70932be0005364d736c774 (patch)
treebac0abc9ae7cf3a92dafeff1da5a14877c58c1f9 /qpid/cpp/tests/topic_publisher.cpp
parent92f385cd2bbfda511fecabf8d0fd747f10d40d43 (diff)
downloadqpid-python-347dae32c31219bdcf70932be0005364d736c774.tar.gz
A bit more documentation for the client tests which are currently doubling as examples.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@486797 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/tests/topic_publisher.cpp')
-rw-r--r--qpid/cpp/tests/topic_publisher.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/qpid/cpp/tests/topic_publisher.cpp b/qpid/cpp/tests/topic_publisher.cpp
index 86dae8e172..b95abd9d66 100644
--- a/qpid/cpp/tests/topic_publisher.cpp
+++ b/qpid/cpp/tests/topic_publisher.cpp
@@ -18,6 +18,22 @@
* under the License.
*
*/
+
+/**
+ * This file provides one half of a test and example of a pub-sub
+ * style of interaction. See topic_listener.cpp for the other half, in
+ * which the logic for subscribers is defined.
+ *
+ * This file contains the publisher logic. The publisher will send a
+ * number of messages to the exchange with the appropriate routing key
+ * for the logical 'topic'. Once it has done this it will then send a
+ * request that each subscriber report back with the number of message
+ * it has received and the time that elapsed between receiving the
+ * first one and receiving the report request. Once the expected
+ * number of reports are received, it sends out a request that each
+ * subscriber shutdown.
+ */
+
#include <QpidError.h>
#include <ClientChannel.h>
#include <Connection.h>
@@ -34,6 +50,11 @@ using namespace qpid::client;
using namespace qpid::sys;
using std::string;
+/**
+ * The publishing logic is defined in this class. It implements
+ * message listener and can therfore be used to receive messages sent
+ * back by the subscribers.
+ */
class Publisher : public MessageListener{
Channel* const channel;
const std::string controlTopic;
@@ -51,6 +72,9 @@ public:
void terminate();
};
+/**
+ * A utility class for managing the options passed in to the test
+ */
class Args{
string host;
int port;