summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/management/ManagementObject.cpp
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2008-10-10 22:18:42 +0000
committerTed Ross <tross@apache.org>2008-10-10 22:18:42 +0000
commitb590b12a2f48f93d92a71d4fac2f2711189ce4ef (patch)
treeeadbd3b1d2bfb6652d2f658490cedb6d0d92b486 /cpp/src/qpid/management/ManagementObject.cpp
parent91f45702afcf3b675fe80dbcf3a452daa61469e4 (diff)
downloadqpid-python-b590b12a2f48f93d92a71d4fac2f2711189ce4ef.tar.gz
QPID-1350 - Object reference following in the QMF console API
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@703588 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/management/ManagementObject.cpp')
-rw-r--r--cpp/src/qpid/management/ManagementObject.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/cpp/src/qpid/management/ManagementObject.cpp b/cpp/src/qpid/management/ManagementObject.cpp
index b31fff83ae..09abbeb0ca 100644
--- a/cpp/src/qpid/management/ManagementObject.cpp
+++ b/cpp/src/qpid/management/ManagementObject.cpp
@@ -57,15 +57,26 @@ ObjectId::ObjectId(AgentAttachment* _agent, uint8_t flags, uint16_t seq, uint64_
ObjectId::ObjectId(std::istream& in) : agent(0)
{
-#define FIELDS 5
string text;
+ in >> text;
+ fromString(text);
+}
+
+ObjectId::ObjectId(const string& text) : agent(0)
+{
+ fromString(text);
+}
+
+void ObjectId::fromString(const string& text)
+{
+#define FIELDS 5
+ string copy(text.c_str());
char* cText;
char* field[FIELDS];
bool atFieldStart = true;
int idx = 0;
- in >> text;
- cText = const_cast<char*>(text.c_str());
+ cText = const_cast<char*>(copy.c_str());
for (char* cursor = cText; *cursor; cursor++) {
if (atFieldStart) {
if (idx >= FIELDS)
@@ -90,6 +101,7 @@ ObjectId::ObjectId(std::istream& in) : agent(0)
second = atoll(field[4]);
}
+
bool ObjectId::operator==(const ObjectId &other) const
{
uint64_t otherFirst = agent == 0 ? other.first : other.first & 0xffff000000000000LL;