diff options
author | Ted Ross <tross@apache.org> | 2008-12-23 19:38:25 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2008-12-23 19:38:25 +0000 |
commit | 564775ae717db7743d41f7620cde8845dc7d35b8 (patch) | |
tree | 8e5f5b8985a5428ce766ef05161887b256615a88 /qpid/cpp/examples/qmf-console/console.cpp | |
parent | 1ac4193fbf6dcbf1e95da4250b6d3bb1d928ab2f (diff) | |
download | qpid-python-564775ae717db7743d41f7620cde8845dc7d35b8.tar.gz |
QPID-1412 Updates and fixes for the c++ console API:
- Added event support
- Converted raw pointers to shared_ptrs in references to Values.
This fixes a memory leak in the original code.
- Added wrappers to make value access more convenient.
- Added timeout handling for synchronous operations.
Timeout values are configurable.
- Fixed a bug in getObjects whereby waitForStable was not called and
the operation could fail if called too early.
- Added examples "printevents" and "ping" to illustrate the usage of
different aspects of the API.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@729075 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/examples/qmf-console/console.cpp')
-rw-r--r-- | qpid/cpp/examples/qmf-console/console.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/qpid/cpp/examples/qmf-console/console.cpp b/qpid/cpp/examples/qmf-console/console.cpp index c98f1ace34..5700d5556f 100644 --- a/qpid/cpp/examples/qmf-console/console.cpp +++ b/qpid/cpp/examples/qmf-console/console.cpp @@ -21,17 +21,9 @@ #include "qpid/console/ConsoleListener.h" #include "qpid/console/SessionManager.h" -#include "qpid/console/Value.h" -#include <unistd.h> -#include <cstdlib> -#include <iostream> - -#include <sstream> using namespace std; using namespace qpid::console; -using std::cout; -using std::endl; class Listener : public ConsoleListener { public: @@ -68,6 +60,10 @@ public: void objectStats(Broker& broker, Object& object) { cout << "objectStats: broker=" << broker << " object=" << object << endl; } + + void event(Event& event) { + cout << "event: " << event << endl; + } }; @@ -127,8 +123,8 @@ int main_int(int /*argc*/, char** /*argv*/) Object::AttributeMap args; MethodResponse result; - args["sequence"] = new UintValue(1); - args["body"] = new StringValue("Testing..."); + args.addUint("sequence", 1); + args.addString("body", "Testing..."); cout << "Call echo method..." << endl; broker.invokeMethod("echo", args, result); |