summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/console/Object.h
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2008-12-23 19:38:25 +0000
committerTed Ross <tross@apache.org>2008-12-23 19:38:25 +0000
commit12d7d4125a42a7f0ab26a89c3c34e88135cf5869 (patch)
tree5970de22eb3027833688156a4116d71ef6b44442 /cpp/src/qpid/console/Object.h
parent912a6db37456524c60e1b7f3236de4dca3c77636 (diff)
downloadqpid-python-12d7d4125a42a7f0ab26a89c3c34e88135cf5869.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/qpid@729075 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/console/Object.h')
-rw-r--r--cpp/src/qpid/console/Object.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/cpp/src/qpid/console/Object.h b/cpp/src/qpid/console/Object.h
index 918bee8af1..54a3e0f6e8 100644
--- a/cpp/src/qpid/console/Object.h
+++ b/cpp/src/qpid/console/Object.h
@@ -24,6 +24,7 @@
#include "ObjectId.h"
#include "qpid/framing/Uuid.h"
#include "qpid/framing/FieldTable.h"
+#include <boost/shared_ptr.hpp>
#include <map>
#include <set>
#include <vector>
@@ -47,13 +48,25 @@ namespace console {
struct MethodResponse {
uint32_t code;
std::string text;
- std::map<std::string, Value*> arguments;
+ std::map<std::string, boost::shared_ptr<Value> > arguments;
};
class Object {
public:
typedef std::vector<Object> Vector;
- typedef std::map<std::string, Value*> AttributeMap;
+ struct AttributeMap : public std::map<std::string, boost::shared_ptr<Value> > {
+ void addRef(const std::string& key, const ObjectId& val);
+ void addUint(const std::string& key, uint32_t val);
+ void addInt(const std::string& key, int32_t val);
+ void addUint64(const std::string& key, uint64_t val);
+ void addInt64(const std::string& key, int64_t val);
+ void addString(const std::string& key, const std::string& val);
+ void addBool(const std::string& key, bool val);
+ void addFloat(const std::string& key, float val);
+ void addDouble(const std::string& key, double val);
+ void addUuid(const std::string& key, const framing::Uuid& val);
+ void addMap(const std::string& key, const framing::FieldTable& val);
+ };
Object(Broker* broker, SchemaClass* schemaClass, framing::Buffer& buffer, bool prop, bool stat);
~Object();