diff options
| author | Gordon Sim <gsim@apache.org> | 2006-12-13 19:03:52 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2006-12-13 19:03:52 +0000 |
| commit | 8e367bd7aa3d0fc3517f093e117e53bbe7c1f83d (patch) | |
| tree | 906c287bfc338cdfe981a906a20858db7ee4d381 /cpp/tests/topic_publisher.cpp | |
| parent | aefda495b3452c599ea92cdb22b1d01b7ceed11d (diff) | |
| download | qpid-python-8e367bd7aa3d0fc3517f093e117e53bbe7c1f83d.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/qpid@486797 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/tests/topic_publisher.cpp')
| -rw-r--r-- | cpp/tests/topic_publisher.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cpp/tests/topic_publisher.cpp b/cpp/tests/topic_publisher.cpp index 86dae8e172..b95abd9d66 100644 --- a/cpp/tests/topic_publisher.cpp +++ b/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; |
