diff options
Diffstat (limited to 'qpid/cpp/src/qmf/ObjectIdImpl.cpp')
-rw-r--r-- | qpid/cpp/src/qmf/ObjectIdImpl.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/qpid/cpp/src/qmf/ObjectIdImpl.cpp b/qpid/cpp/src/qmf/ObjectIdImpl.cpp index 75661fdb47..c0618ccc49 100644 --- a/qpid/cpp/src/qmf/ObjectIdImpl.cpp +++ b/qpid/cpp/src/qmf/ObjectIdImpl.cpp @@ -100,6 +100,15 @@ void ObjectIdImpl::fromString(const std::string& repr) agent = 0; } +std::string ObjectIdImpl::asString() const +{ + stringstream val; + + val << getFlags() << "-" << getSequence() << "-" << getBrokerBank() << "-" << + getAgentBank() << "-" << getObjectNum(); + return val.str(); +} + bool ObjectIdImpl::operator==(const ObjectIdImpl& other) const { uint64_t otherFirst = agent == 0 ? other.first : other.first & 0xffff000000000000LL; @@ -126,15 +135,11 @@ bool ObjectIdImpl::operator>(const ObjectIdImpl& other) const // Wrappers //================================================================== -ObjectId::ObjectId() -{ - impl = new ObjectIdImpl(this); -} +ObjectId::ObjectId() : impl(new ObjectIdImpl(this)) {} -ObjectId::ObjectId(ObjectIdImpl* i) -{ - impl = i; -} +ObjectId::ObjectId(const ObjectId& from) : impl(new ObjectIdImpl(*(from.impl))) {} + +ObjectId::ObjectId(ObjectIdImpl* i) : impl(i) {} ObjectId::~ObjectId() { |