diff options
Diffstat (limited to 'cpp/src/qpid/management/ManagementObject.cpp')
-rw-r--r-- | cpp/src/qpid/management/ManagementObject.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/cpp/src/qpid/management/ManagementObject.cpp b/cpp/src/qpid/management/ManagementObject.cpp index 4ac6613419..4b87800174 100644 --- a/cpp/src/qpid/management/ManagementObject.cpp +++ b/cpp/src/qpid/management/ManagementObject.cpp @@ -109,16 +109,18 @@ void ObjectId::fromString(const std::string& text) bool ObjectId::operator==(const ObjectId &other) const { - uint64_t otherFirst = agent == 0 ? other.first : other.first & 0xffff000000000000LL; - - return first == otherFirst && second == other.second; + return v2Key == other.v2Key; } bool ObjectId::operator<(const ObjectId &other) const { - uint64_t otherFirst = agent == 0 ? other.first : other.first & 0xffff000000000000LL; + return v2Key < other.v2Key; +} - return (first < otherFirst) || ((first == otherFirst) && (second < other.second)); +bool ObjectId::equalV1(const ObjectId &other) const +{ + uint64_t otherFirst = agent == 0 ? other.first : other.first & 0xffff000000000000LL; + return first == otherFirst && second == other.second; } void ObjectId::encode(framing::Buffer& buffer) const @@ -136,6 +138,14 @@ void ObjectId::decode(framing::Buffer& buffer) second = buffer.getLongLong(); } +void ObjectId::setV2Key(const ManagementObject& object) +{ + std::stringstream oname; + oname << object.getPackageName() << "." << object.getClassName() << ":" << object.getKey(); + v2Key = oname.str(); +} + + namespace qpid { namespace management { |